From 566661aca160410d2bbab95109ddf2edfdc50281 Mon Sep 17 00:00:00 2001 From: Ernest Cui Date: Fri, 12 Apr 2024 18:27:51 +0800 Subject: [PATCH] build: build v3.5.1 --- cli/build/irvm.mjs | 4 +- ...ssMode-016766a9.js => cssMode-a70b8ffe.js} | 2 +- ...r2-16cf0c28.js => freemarker2-d4fc4a18.js} | 2 +- ...ars-8e9b88a4.js => handlebars-84ede268.js} | 2 +- .../{html-d0e282cb.js => html-c86539dd.js} | 2 +- ...lMode-486a6d1f.js => htmlMode-f0b3914e.js} | 2 +- .../{index-3502a0fe.js => index-7530a5d9.js} | 276 +++++++++--------- ...ipt-399e9239.js => javascript-f8924fc5.js} | 2 +- ...nMode-2b57b708.js => jsonMode-d2a2b345.js} | 2 +- ...{liquid-a87f169a.js => liquid-6545a9f9.js} | 2 +- .../{mdx-31bb8f6b.js => mdx-41f16e00.js} | 2 +- ...{python-a17e322c.js => python-a4947be7.js} | 2 +- .../{razor-3c2726ff.js => razor-939b62e5.js} | 2 +- ...{tsMode-dc546b1f.js => tsMode-f8221b75.js} | 2 +- ...ipt-e9193306.js => typescript-b38ad017.js} | 2 +- .../{xml-91f8402c.js => xml-1046e63e.js} | 2 +- .../{yaml-36087f86.js => yaml-01b0ca08.js} | 2 +- docs/index.html | 2 +- package.json | 2 +- 19 files changed, 157 insertions(+), 157 deletions(-) rename docs/assets/{cssMode-016766a9.js => cssMode-a70b8ffe.js} (99%) rename docs/assets/{freemarker2-16cf0c28.js => freemarker2-d4fc4a18.js} (99%) rename docs/assets/{handlebars-8e9b88a4.js => handlebars-84ede268.js} (99%) rename docs/assets/{html-d0e282cb.js => html-c86539dd.js} (98%) rename docs/assets/{htmlMode-486a6d1f.js => htmlMode-f0b3914e.js} (99%) rename docs/assets/{index-3502a0fe.js => index-7530a5d9.js} (95%) rename docs/assets/{javascript-399e9239.js => javascript-f8924fc5.js} (89%) rename docs/assets/{jsonMode-2b57b708.js => jsonMode-d2a2b345.js} (99%) rename docs/assets/{liquid-a87f169a.js => liquid-6545a9f9.js} (98%) rename docs/assets/{mdx-31bb8f6b.js => mdx-41f16e00.js} (98%) rename docs/assets/{python-a17e322c.js => python-a4947be7.js} (98%) rename docs/assets/{razor-3c2726ff.js => razor-939b62e5.js} (99%) rename docs/assets/{tsMode-dc546b1f.js => tsMode-f8221b75.js} (99%) rename docs/assets/{typescript-e9193306.js => typescript-b38ad017.js} (98%) rename docs/assets/{xml-91f8402c.js => xml-1046e63e.js} (97%) rename docs/assets/{yaml-36087f86.js => yaml-01b0ca08.js} (98%) diff --git a/cli/build/irvm.mjs b/cli/build/irvm.mjs index 808703a..7693ff1 100644 --- a/cli/build/irvm.mjs +++ b/cli/build/irvm.mjs @@ -1,4 +1,4 @@ -import t from"fs";import e from"readline";import r from"assert";import n from"util";import i from"path";var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a={exports:{}};const{inspect:u}=n;var l,c,h=function(t,...e){let r=t.replace(/%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g,(function(t,r,n,i,o,s){if(r)return"%";let a,l=0;if(i){if(0===e.length)throw new TypeError("not enough arguments for format string");if(l=e.shift(),!Number.isInteger(l))throw new TypeError("* wants int")}if(void 0!==o){let t=e[0];if("object"!=typeof t||null===t)throw new TypeError("format requires a mapping");if(!(o in t))throw new TypeError(`no such key: '${o}'`);a=t[o]}else{if(0===e.length)throw new TypeError("not enough arguments for format string");a=e.shift()}switch(s){case"s":a=String(a);break;case"r":a=u(a);break;case"d":case"i":if("number"!=typeof a)throw new TypeError(`%${s} format: a number is required, not ${typeof a}`);a=String(a.toFixed(0));break;default:throw new TypeError(`unsupported format character '${s}'`)}return l>0?n?a.padEnd(l):a.padStart(l):a}));if(e.length&&(1!==e.length||"object"!=typeof e[0]||null===e[0]))throw new TypeError("not all arguments converted during string formatting");return r};function f(){if(c)return l;c=1;const t=/([\t\n\x0b\x0c\r ]+)/;class e{constructor(t={}){let{width:e=70,initial_indent:r="",subsequent_indent:n="",expand_tabs:i=!0,replace_whitespace:o=!0,fix_sentence_endings:s=!1,break_long_words:a=!0,drop_whitespace:u=!0,break_on_hyphens:l=!0,tabsize:c=8,max_lines:h,placeholder:f=" [...]"}=t;this.width=e,this.initial_indent=r,this.subsequent_indent=n,this.expand_tabs=i,this.replace_whitespace=o,this.fix_sentence_endings=s,this.break_long_words=a,this.drop_whitespace=u,this.break_on_hyphens=l,this.tabsize=c,this.max_lines=h,this.placeholder=f}_munge_whitespace(t){return this.expand_tabs&&(t=t.replace(/\t/g," ".repeat(this.tabsize))),this.replace_whitespace&&(t=t.replace(/[\t\n\x0b\x0c\r]/g," ")),t}_split(e){let r=e.split(t);return r=r.filter(Boolean),r}_handle_long_word(t,e,r,n){let i;i=n<1?1:n-r,this.break_long_words?(e.push(t[t.length-1].slice(0,i)),t[t.length-1]=t[t.length-1].slice(i)):e||e.push(...t.pop())}_wrap_chunks(t){let e,r=[];if(this.width<=0)throw Error(`invalid width ${this.width} (must be > 0)`);if(void 0!==this.max_lines&&(e=this.max_lines>1?this.subsequent_indent:this.initial_indent,e.length+this.placeholder.trimStart().length>this.width))throw Error("placeholder too large for max width");for(t=t.reverse();t.length>0;){let e,n=[],i=0;e=r?this.subsequent_indent:this.initial_indent;let o=this.width-e.length;for(this.drop_whitespace&&""===t[t.length-1].trim()&&r.length>0&&t.pop();t.length>0;){let e=t[t.length-1].length;if(!(i+e<=o))break;n.push(t.pop()),i+=e}if(t.length&&t[t.length-1].length>o&&(this._handle_long_word(t,n,i,o),i=n.map((t=>t.length)).reduce(((t,e)=>t+e),0)),this.drop_whitespace&&n.length>0&&""===n[n.length-1].trim()&&(i-=n[n.length-1].length,n.pop()),n){if(!(void 0===this.max_lines||r.length+10)for(let i=t;ie;i+=r)n.push(i);return n}function O(t,e=!1){let r;if(e){r=[];let e=t.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/);for(let t=0;tr&&(n=n.slice(0,r).concat([n.slice(r).join(e)])),n}function N(t,e){if(t.length!==e.length)return!1;for(let r=0;rt[0]+t[2].toUpperCase()));r!==e&&M(t.prototype,r,e)}return t}function P(t){return"default"===(t=t.replace(/\w_[a-z]/g,(t=>t[0]+t[2].toUpperCase())))&&(t="defaultValue"),"const"===t&&(t="constant"),t}function x(t){return"defaultValue"===t&&(t="default"),"constant"===t&&(t="const"),t=t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}let G=Symbol("no_default_value");function U(t,e){function r(){let t=(new Error).stack.split("\n").map((t=>t.match(/^ at (.*) \(.*\)$/))).filter(Boolean).map((t=>t[1])).map((t=>t.match(/[^ .]*$/)[0]));return t.length&&t[0]===r.name&&t.shift(),t.length&&t[0]===U.name&&t.shift(),t.length?t[0]:""}let n={},i=[],o=(t=Array.from(t)).length&&t[t.length-1];"object"!=typeof o||null===o||Array.isArray(o)||o.constructor&&"Object"!==o.constructor.name||(n=Object.assign({},t.pop()));let s=[];for(let t of Object.keys(e)){let e=P(t);e!==t&&e in n&&(t in n||(n[t]=n[e]),s.push([e,t]),delete n[e])}if(s.length){let t=r();H("camelcase_"+t,m("%s(): following options are renamed: %s",t,s.map((([t,e])=>m("%r -> %r",t,e)))))}let a=[],u=t.length;for(let[o,s]of Object.entries(e))if("*"===o[0])if(o.length>0&&"*"===o[1]){let t=[];for(let e of Object.keys(n)){let r=x(e);r!==e&&e in n&&(r in n||(n[r]=n[e]),t.push([e,r]),delete n[e])}if(t.length){let e=r();H("camelcase_"+e,m("%s(): following options are renamed: %s",e,t.map((([t,e])=>m("%r -> %r",t,e)))))}i.push(n),n={}}else i.push(t),t=[];else{if(o in n&&t.length>0)throw new TypeError(m("%s() got multiple values for argument %r",r(),o));o in n?(i.push(n[o]),delete n[o]):t.length>0?i.push(t.shift()):s!==G?i.push(s):a.push(o)}if(Object.keys(n).length)throw new TypeError(m("%s() got an unexpected keyword argument %r",r(),Object.keys(n)[0]));if(t.length){let t=Object.entries(e).filter((([t,e])=>"*"!==t[0]&&e!==G)).length,n=Object.entries(e).filter((([t])=>"*"!==t[0])).length;throw new TypeError(m("%s() takes %s positional argument%s but %s %s given",r(),t===n?m("from %s to %s",t,n):n,t===n&&1===n?"":"s",u,1===u?"was":"were"))}if(a.length){let t=a.map(v);t.length>1&&(t[t.length-1]="and "+t[t.length-1]);let e=t.join(2===t.length?"":", ");throw new TypeError(m("%s() missing %i required positional argument%s: %s",r(),t.length,1===t.length?"":"s",e))}return i}let k={};function H(t,e){k[t]=k[t]||g.deprecate((()=>{}),e),k[t]()}function F(t=Object){return class extends t{[g.inspect.custom](){let t=this.constructor.name,e=[],r={};for(let t of this._get_args())e.push(v(t));for(let[t,n]of this._get_kwargs())/^[a-z_][a-z0-9_$]*$/i.test(t)?e.push(m("%s=%r",t,n)):r[t]=n;return Object.keys(r).length&&e.push(m("**%s",v(r))),m("%s(%s)",t,e.join(", "))}toString(){return this[g.inspect.custom]()}_get_kwargs(){return Object.entries(this)}_get_args(){return[]}}}function j(t){return void 0===t?[]:t.slice(0)}const V=B(D(class{constructor(){let[t,e,r,n]=U(arguments,{prog:G,indent_increment:2,max_help_position:24,width:void 0});void 0===n&&(n=+process.env.COLUMNS||process.stdout.columns||80,n-=2),this._prog=t,this._indent_increment=e,this._max_help_position=Math.min(r,Math.max(n-20,2*e)),this._width=n,this._current_indent=0,this._level=0,this._action_max_length=0,this._root_section=this._Section(this,void 0),this._current_section=this._root_section,this._whitespace_matcher=/[ \t\n\r\f\v]+/g,this._long_break_matcher=/\n\n\n+/g}_indent(){this._current_indent+=this._indent_increment,this._level+=1}_dedent(){this._current_indent-=this._indent_increment,p(this._current_indent>=0,"Indent decreased below 0."),this._level-=1}_add_item(t,e){this._current_section.items.push([t,e])}start_section(t){this._indent();let e=this._Section(this,this._current_section,t);this._add_item(e.format_help.bind(e),[]),this._current_section=e}end_section(){this._current_section=this._current_section.parent,this._dedent()}add_text(t){t!==o&&void 0!==t&&this._add_item(this._format_text.bind(this),[t])}add_usage(t,e,r,n=void 0){if(t!==o){let i=[t,e,r,n];this._add_item(this._format_usage.bind(this),i)}}add_argument(t){if(t.help!==o){let e=[this._format_action_invocation(t)];for(let r of this._iter_indented_subactions(t))e.push(this._format_action_invocation(r));let r=Math.max(...e.map((t=>t.length)))+this._current_indent;this._action_max_length=Math.max(this._action_max_length,r),this._add_item(this._format_action.bind(this),[t])}}add_arguments(t){for(let e of t)this.add_argument(e)}format_help(){let t=this._root_section.format_help();return t&&(t=t.replace(this._long_break_matcher,"\n\n"),t=t.replace(/^\n+|\n+$/g,"")+"\n"),t}_join_parts(t){return t.filter((t=>t&&t!==o)).join("")}_format_usage(t,e,r,n){if(void 0===n&&(n="usage: "),void 0!==t)t=m(t,{prog:this._prog});else if(void 0!==t||e.length){if(void 0===t){let i=m("%(prog)s",{prog:this._prog}),o=[],s=[];for(let t of e)t.option_strings.length?o.push(t):s.push(t);t=[i,this._format_actions_usage([].concat(o).concat(s),r)].map(String).join(" ");let a=this._width-this._current_indent;if(n.length+t.length>a){let e=/\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g,u=this._format_actions_usage(o,r),l=this._format_actions_usage(s,r),c=u.match(e)||[],h=l.match(e)||[];p(c.join(" ")===u),p(h.join(" ")===l);let f,_=(t,e,r=void 0)=>{let n,i=[],o=[];n=void 0!==r?r.length-1:e.length-1;for(let r of t)n+1+r.length>a&&o&&(i.push(e+o.join(" ")),o=[],n=e.length-1),o.push(r),n+=r.length+1;return o.length&&i.push(e+o.join(" ")),void 0!==r&&(i[0]=i[0].slice(e.length)),i};if(n.length+i.length<=.75*a){let t=" ".repeat(n.length+i.length+1);c.length?(f=_([i].concat(c),t,n),f=f.concat(_(h,t))):f=h.length?_([i].concat(h),t,n):[i]}else{let t=" ".repeat(n.length);f=_([].concat(c).concat(h),t),f.length>1&&(f=[],f=f.concat(_(c,t)),f=f.concat(_(h,t))),f=[i].concat(f)}t=f.join("\n")}}}else t=m("%(prog)s",{prog:this._prog});return m("%s%s\n\n",n,t)}_format_actions_usage(t,e){let r=new Set,n={};for(let i of e){let e=t.indexOf(i._group_actions[0]);if(-1!==e){let o=e+i._group_actions.length;if(N(t.slice(e,o),i._group_actions)){for(let t of i._group_actions)r.add(t);i.required?(e in n?n[e]+=" (":n[e]="(",o in n?n[o]+=")":n[o]=")"):(e in n?n[e]+=" [":n[e]="[",o in n?n[o]+="]":n[o]="]");for(let t of L(e+1,o))n[t]="|"}}}let i=[];for(let[e,s]of Object.entries(t))if(s.help===o)i.push(void 0),"|"===n[+e]?delete n[+e]:"|"===n[+e+1]&&delete n[+e+1];else if(s.option_strings.length){let t,e=s.option_strings[0];if(0===s.nargs)t=s.format_usage();else{let r=this._get_default_metavar_for_optional(s),n=this._format_args(s,r);t=m("%s %s",e,n)}s.required||r.has(s)||(t=m("[%s]",t)),i.push(t)}else{let t=this._get_default_metavar_for_positional(s),e=this._format_args(s,t);r.has(s)&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),i.push(e)}for(let t of Object.keys(n).map(Number).sort(((t,e)=>e-t)))i.splice(+t,0,n[+t]);let s=i.filter(Boolean).join(" ");return s=s.replace(/([\[(]) /g,"$1"),s=s.replace(/ ([\])])/g,"$1"),s=s.replace(/[\[(] *[\])]/g,""),s=s.replace(/\(([^|]*)\)/g,"$1",s),s=s.trim(),s}_format_text(t){t.includes("%(prog)")&&(t=m(t,{prog:this._prog}));let e=Math.max(this._width-this._current_indent,11),r=" ".repeat(this._current_indent);return this._fill_text(t,e,r)+"\n\n"}_format_action(t){let e,r=Math.min(this._action_max_length+2,this._max_help_position),n=Math.max(this._width-r,11),i=r-this._current_indent-2,o=this._format_action_invocation(t);if(t.help)if(o.length<=i){let t=[this._current_indent,"",i,o];o=m("%*s%-*s ",...t),e=0}else{let t=[this._current_indent,"",o];o=m("%*s%s\n",...t),e=r}else{let t=[this._current_indent,"",o];o=m("%*s%s\n",...t)}let s=[o];if(t.help){let i=this._expand_help(t),o=this._split_lines(i,n);s.push(m("%*s%s\n",e,"",o[0]));for(let t of o.slice(1))s.push(m("%*s%s\n",r,"",t))}else o.endsWith("\n")||s.push("\n");for(let e of this._iter_indented_subactions(t))s.push(this._format_action(e));return this._join_parts(s)}_format_action_invocation(t){if(t.option_strings.length){let e=[];if(0===t.nargs)e=e.concat(t.option_strings);else{let r=this._get_default_metavar_for_optional(t),n=this._format_args(t,r);for(let r of t.option_strings)e.push(m("%s %s",r,n))}return e.join(", ")}{let e=this._get_default_metavar_for_positional(t);return this._metavar_formatter(t,e)(1)[0]}}_metavar_formatter(t,e){let r;if(void 0!==t.metavar)r=t.metavar;else if(void 0!==t.choices){let e=C(t.choices).map(String);r=m("{%s}",e.join(","))}else r=e;return function(t){return Array.isArray(r)?r:Array(t).fill(r)}}_format_args(t,e){let r,n=this._metavar_formatter(t,e);if(void 0===t.nargs)r=m("%s",...n(1));else if(t.nargs===s)r=m("[%s]",...n(1));else if(t.nargs===a){let t=n(1);r=2===t.length?m("[%s [%s ...]]",...t):m("[%s ...]",...t)}else if(t.nargs===u)r=m("%s [%s ...]",...n(2));else if(t.nargs===c)r="...";else if(t.nargs===l)r=m("%s ...",...n(1));else if(t.nargs===o)r="";else{let e;try{e=L(t.nargs).map((()=>"%s"))}catch(t){throw new TypeError("invalid nargs value")}r=m(e.join(" "),...n(t.nargs))}return r}_expand_help(t){let e=Object.assign({prog:this._prog},t);for(let t of Object.keys(e))e[t]===o&&delete e[t];for(let t of Object.keys(e))e[t]&&e[t].name&&(e[t]=e[t].name);if(void 0!==e.choices){let t=C(e.choices).map(String).join(", ");e.choices=t}for(let t of Object.keys(e)){let r=P(t);r!==t&&(e[r]=e[t])}return m(this._get_help_string(t),e)}*_iter_indented_subactions(t){"function"==typeof t._get_subactions&&(this._indent(),yield*t._get_subactions(),this._dedent())}_split_lines(t,e){return t=t.replace(this._whitespace_matcher," ").trim(),f().wrap(t,{width:e})}_fill_text(t,e,r){return t=t.replace(this._whitespace_matcher," ").trim(),f().fill(t,{width:e,initial_indent:r,subsequent_indent:r})}_get_help_string(t){return t.help}_get_default_metavar_for_optional(t){return t.dest.toUpperCase()}_get_default_metavar_for_positional(t){return t.dest}}));V.prototype._Section=D(class{constructor(t,e,r=void 0){this.formatter=t,this.parent=e,this.heading=r,this.items=[]}format_help(){void 0!==this.parent&&this.formatter._indent();let t,e=this.formatter._join_parts(this.items.map((([t,e])=>t.apply(null,e))));if(void 0!==this.parent&&this.formatter._dedent(),!e)return"";if(this.heading!==o&&void 0!==this.heading){let e=this.formatter._current_indent;t=m("%*s%s:\n",e,"",this.heading)}else t="";return this.formatter._join_parts(["\n",t,e,"\n"])}});const z=B(D(class extends V{_fill_text(t,e,r){return O(t,!0).map((t=>r+t)).join("")}})),W=B(D(class extends z{_split_lines(t){return O(t)}})),K=B(D(class extends V{_get_help_string(t){let e=t.help;if(!t.help.includes("%(default)")&&!t.help.includes("%(defaultValue)")&&t.default!==o){let r=[s,a];(t.option_strings.length||r.includes(t.nargs))&&(e+=" (default: %(default)s)")}return e}})),Y=B(D(class extends V{_get_default_metavar_for_optional(t){return"function"==typeof t.type?t.type.name:t.type}_get_default_metavar_for_positional(t){return"function"==typeof t.type?t.type.name:t.type}}));function X(t){return void 0===t?void 0:t.option_strings.length?t.option_strings.join("/"):[void 0,o].includes(t.metavar)?[void 0,o].includes(t.dest)?void 0:t.dest:t.metavar}const Z=D(class extends Error{constructor(t,e){super(),this.name="ArgumentError",this._argument_name=X(t),this._message=e,this.message=this.str()}str(){let t;return t=void 0===this._argument_name?"%(message)s":"argument %(argument_name)s: %(message)s",m(t,{message:this._message,argument_name:this._argument_name})}}),q=D(class extends Error{constructor(t){super(t),this.name="ArgumentTypeError"}}),$=B(D(class extends(F(Function)){constructor(){let[t,e,r,n,i,o,s,a,u,l]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),this.option_strings=t,this.dest=e,this.nargs=r,this.const=n,this.default=i,this.type=o,this.choices=s,this.required=a,this.help=u,this.metavar=l}_get_kwargs(){return["option_strings","dest","nargs","const","default","type","choices","help","metavar"].map((t=>[t,b(this,t)]))}format_usage(){return this.option_strings[0]}call(){throw new Error(".call() not defined")}})),Q=B(D(class extends ${constructor(){let[t,e,r,n,i,o,s,a]=U(arguments,{option_strings:G,dest:G,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0}),u=[];for(let e of t)u.push(e),e.startsWith("--")&&(e="--no-"+e.slice(2),u.push(e));void 0!==s&&void 0!==r&&(s+=` (default: ${r})`),super({option_strings:u,dest:e,nargs:0,default:r,type:n,choices:i,required:o,help:s,metavar:a})}call(t,e,r,n=void 0){this.option_strings.includes(n)&&T(e,this.dest,!n.startsWith("--no-"))}format_usage(){return this.option_strings.join(" | ")}})),J=D(class extends ${constructor(){let[t,e,r,n,i,o,a,u,l,c]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate");if(void 0!==n&&r!==s)throw new TypeError(m("nargs must be %r to supply const",s));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:o,choices:a,required:u,help:l,metavar:c})}call(t,e,r){T(e,this.dest,r)}}),tt=D(class extends ${constructor(){let[t,e,r,n,i,o]=U(arguments,{option_strings:G,dest:G,const:G,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:o})}call(t,e){T(e,this.dest,this.const)}}),et=D(class extends tt{constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:!1,required:!1,help:void 0});super({option_strings:t,dest:e,const:!0,default:r,required:n,help:i})}}),rt=D(class extends tt{constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:!0,required:!1,help:void 0});super({option_strings:t,dest:e,const:!1,default:r,required:n,help:i})}}),nt=D(class extends ${constructor(){let[t,e,r,n,i,o,a,u,l,c]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriate");if(void 0!==n&&r!==s)throw new TypeError(m("nargs must be %r to supply const",s));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:o,choices:a,required:u,help:l,metavar:c})}call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n.push(r),T(e,this.dest,n)}}),it=D(class extends ${constructor(){let[t,e,r,n,i,o,s]=U(arguments,{option_strings:G,dest:G,const:G,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:o,metavar:s})}call(t,e){let r=b(e,this.dest,void 0);r=j(r),r.push(this.const),T(e,this.dest,r)}}),ot=D(class extends ${constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:void 0,required:!1,help:void 0});super({option_strings:t,dest:e,nargs:0,default:r,required:n,help:i})}call(t,e){let r=b(e,this.dest,void 0);void 0===r&&(r=0),T(e,this.dest,r+1)}}),st=D(class extends ${constructor(){let[t,e,r,n]=U(arguments,{option_strings:G,dest:o,default:o,help:void 0});super({option_strings:t,dest:e,default:r,nargs:0,help:n})}call(t){t.print_help(),t.exit()}}),at=D(class extends ${constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,version:void 0,dest:o,default:o,help:"show program's version number and exit"});super({option_strings:t,dest:r,default:n,nargs:0,help:i}),this.version=e}call(t){let e=this.version;void 0===e&&(e=t.version);let r=t._get_formatter();r.add_text(e),t._print_message(r.format_help(),process.stdout),t.exit()}}),ut=B(D(class extends ${constructor(){let[t,e,r,n,i,s,a]=U(arguments,{option_strings:G,prog:G,parser_class:G,dest:o,required:!1,help:void 0,metavar:void 0}),u={};super({option_strings:t,dest:n,nargs:l,choices:u,required:i,help:s,metavar:a}),this._prog_prefix=e,this._parser_class=r,this._name_parser_map=u,this._choices_actions=[]}add_parser(){let[t,e]=U(arguments,{name:G,"**kwargs":G});void 0===e.prog&&(e.prog=m("%s %s",this._prog_prefix,t));let r=b(e,"aliases",[]);if(delete e.aliases,"help"in e){let n=e.help;delete e.help;let i=this._ChoicesPseudoAction(t,r,n);this._choices_actions.push(i)}let n=new this._parser_class(e);this._name_parser_map[t]=n;for(let t of r)this._name_parser_map[t]=n;return n}_get_subactions(){return this._choices_actions}call(t,e,r){let n,i=r[0],s=r.slice(1);if(this.dest!==o&&T(e,this.dest,i),!A(this._name_parser_map,i)){let t={parser_name:i,choices:this._name_parser_map.join(", ")},e=m("unknown parser %(parser_name)r (choices: %(choices)s)",t);throw new Z(this,e)}t=this._name_parser_map[i],[n,s]=t.parse_known_args(s,void 0);for(let[t,r]of Object.entries(n))T(e,t,r);s.length&&(R(e,_,[]),b(e,_).push(...s))}}));ut.prototype._ChoicesPseudoAction=D(class extends ${constructor(t,e,r){let n=t,i=t;e.length&&(n+=m(" (%s)",e.join(", "))),super({option_strings:[],dest:i,help:r,metavar:n})}});const lt=D(class extends nt{call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n=n.concat(r),T(e,this.dest,n)}}),ct=D(class extends Function{constructor(){let[t,e,r,n,i,o,s,a,u]=U(arguments,{flags:"r",encoding:void 0,mode:void 0,autoClose:void 0,emitClose:void 0,start:void 0,end:void 0,highWaterMark:void 0,fs:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),Object.defineProperty(this,"name",{get:()=>m("FileType(%r)",t)}),this._flags=t,this._options={},void 0!==e&&(this._options.encoding=e),void 0!==r&&(this._options.mode=r),void 0!==n&&(this._options.autoClose=n),void 0!==i&&(this._options.emitClose=i),void 0!==o&&(this._options.start=o),void 0!==s&&(this._options.end=s),void 0!==a&&(this._options.highWaterMark=a),void 0!==u&&(this._options.fs=u)}call(t){if("-"===t){if(this._flags.includes("r"))return process.stdin;if(this._flags.includes("w"))return process.stdout;{let t=m('argument "-" with mode %r',this._flags);throw new TypeError(t)}}let e;try{e=d.openSync(t,this._flags,this._options.mode)}catch(e){let r={filename:t,error:e.message};throw new q(m("can't open '%(filename)s': %(error)s",r))}let r=Object.assign({fd:e,flags:this._flags},this._options);if(this._flags.includes("r"))return d.createReadStream(void 0,r);if(this._flags.includes("w"))return d.createWriteStream(void 0,r);{let e=m('argument "%s" with mode %r',t,this._flags);throw new TypeError(e)}}[g.inspect.custom](){let t=[this._flags],e=Object.entries(this._options).map((([t,e])=>("mode"===t&&(e={value:e,[g.inspect.custom](){return"0o"+this.value.toString(8)}}),[t,e]))),r=[].concat(t.filter((t=>-1!==t)).map(v)).concat(e.filter((([,t])=>void 0!==t)).map((([t,e])=>m("%s=%r",t,e)))).join(", ");return m("%s(%s)",this.constructor.name,r)}toString(){return this[g.inspect.custom]()}}),ht=D(class extends(F()){constructor(t={}){super(),Object.assign(this,t)}});ht.prototype[Symbol.toStringTag]=void 0;const ft=B(D(class{constructor(){let[t,e,r,n]=U(arguments,{description:G,prefix_chars:G,argument_default:G,conflict_handler:G});this.description=t,this.argument_default=r,this.prefix_chars=e,this.conflict_handler=n,this._registries={},this.register("action",void 0,J),this.register("action","store",J),this.register("action","store_const",tt),this.register("action","store_true",et),this.register("action","store_false",rt),this.register("action","append",nt),this.register("action","append_const",it),this.register("action","count",ot),this.register("action","help",st),this.register("action","version",at),this.register("action","parsers",ut),this.register("action","extend",lt),["storeConst","storeTrue","storeFalse","appendConst"].forEach((t=>{let e=x(t);this.register("action",t,g.deprecate(this._registry_get("action",e),m('{action: "%s"} is renamed to {action: "%s"}',t,e)))})),this._get_handler(),this._actions=[],this._option_string_actions={},this._action_groups=[],this._mutually_exclusive_groups=[],this._defaults={},this._negative_number_matcher=/^-\d+$|^-\d*\.\d+$/,this._has_negative_number_optionals=[]}register(t,e,r){R(this._registries,t,{})[e]=r}_registry_get(t,e,r=void 0){return b(this._registries[t],e,r)}set_defaults(t){Object.assign(this._defaults,t);for(let e of this._actions)e.dest in t&&(e.default=t[e.dest])}get_default(t){for(let e of this._actions)if(e.dest===t&&void 0!==e.default)return e.default;return this._defaults[t]}add_argument(){let[t,e]=U(arguments,{"*args":G,"**kwargs":G});1===t.length&&Array.isArray(t[0])&&(t=t[0],H("argument-array",m("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })",{args:t.map(v).join(", ")})));let r=this.prefix_chars;if(!t.length||1===t.length&&!r.includes(t[0][0])){if(t.length&&"dest"in e)throw new TypeError("dest supplied twice for positional argument");e=this._get_positional_kwargs(...t,e)}else e=this._get_optional_kwargs(...t,e);if(!("default"in e)){let t=e.dest;t in this._defaults?e.default=this._defaults[t]:void 0!==this.argument_default&&(e.default=this.argument_default)}let n=this._pop_action_class(e);if("function"!=typeof n)throw new TypeError(m('unknown action "%s"',n));let i=new n(e),o=this._registry_get("type",i.type,i.type);if("function"!=typeof o)throw new TypeError(m("%r is not callable",o));if(o===ct)throw new TypeError(m("%r is a FileType class object, instance of it must be passed",o));if("_get_formatter"in this)try{this._get_formatter()._format_args(i,void 0)}catch(t){throw t instanceof TypeError&&"invalid nargs value"!==t.message?new TypeError("length of metavar tuple does not match nargs"):t}return this._add_action(i)}add_argument_group(){let t=_t(this,...arguments);return this._action_groups.push(t),t}add_mutually_exclusive_group(){let t=pt(this,...arguments);return this._mutually_exclusive_groups.push(t),t}_add_action(t){this._check_conflict(t),this._actions.push(t),t.container=this;for(let e of t.option_strings)this._option_string_actions[e]=t;for(let e of t.option_strings)this._negative_number_matcher.test(e)&&(this._has_negative_number_optionals.length||this._has_negative_number_optionals.push(!0));return t}_remove_action(t){w(this._actions,t)}_add_container_actions(t){let e={};for(let t of this._action_groups){if(t.title in e){throw new TypeError(m("cannot merge actions - two groups are named %r",t.title))}e[t.title]=t}let r=new Map;for(let n of t._action_groups){n.title in e||(e[n.title]=this.add_argument_group({title:n.title,description:n.description,conflict_handler:n.conflict_handler}));for(let t of n._group_actions)r.set(t,e[n.title])}for(let e of t._mutually_exclusive_groups){let t=this.add_mutually_exclusive_group({required:e.required});for(let n of e._group_actions)r.set(n,t)}for(let e of t._actions)r.get(e)._add_action(e)}_get_positional_kwargs(){let[t,e]=U(arguments,{dest:G,"**kwargs":G});if("required"in e){throw new TypeError("'required' is an invalid argument for positionals")}return[s,a].includes(e.nargs)||(e.required=!0),e.nargs!==a||"default"in e||(e.required=!0),Object.assign(e,{dest:t,option_strings:[]})}_get_optional_kwargs(){let t,[e,r]=U(arguments,{"*args":G,"**kwargs":G}),n=[],i=[];for(t of e){if(!this.prefix_chars.includes(t[0])){let e={option:t,prefix_chars:this.prefix_chars};throw new TypeError(m("invalid option string %(option)r: must start with a character %(prefix_chars)r",e))}n.push(t),t.length>1&&this.prefix_chars.includes(t[1])&&i.push(t)}let o=r.dest;if(delete r.dest,void 0===o){let e;if(e=i.length?i[0]:n[0],o=function(t,e){let r=0;for(;rt)).join(", ");throw new Z(t,m(r,n))}_handle_conflict_resolve(t,e){for(let[t,r]of e)w(r.option_strings,t),delete this._option_string_actions[t],r.option_strings.length||r.container._remove_action(r)}})),_t=D(class extends ft{constructor(){let[t,e,r,n]=U(arguments,{container:G,title:void 0,description:void 0,"**kwargs":G});R(n,"conflict_handler",t.conflict_handler),R(n,"prefix_chars",t.prefix_chars),R(n,"argument_default",t.argument_default),super(Object.assign({description:r},n)),this.title=e,this._group_actions=[],this._registries=t._registries,this._actions=t._actions,this._option_string_actions=t._option_string_actions,this._defaults=t._defaults,this._has_negative_number_optionals=t._has_negative_number_optionals,this._mutually_exclusive_groups=t._mutually_exclusive_groups}_add_action(t){return t=super._add_action(t),this._group_actions.push(t),t}_remove_action(t){super._remove_action(t),w(this._group_actions,t)}}),pt=D(class extends _t{constructor(){let[t,e]=U(arguments,{container:G,required:!1});super(t),this.required=e,this._container=t}_add_action(t){if(t.required){throw new TypeError("mutually exclusive arguments must be optional")}return t=this._container._add_action(t),this._group_actions.push(t),t}_remove_action(t){this._container._remove_action(t),w(this._group_actions,t)}}),gt=B(D(class extends(F(ft)){constructor(){let[t,e,r,n,i,s,a,u,l,c,h,f,_,p,d]=U(arguments,{prog:void 0,usage:void 0,description:void 0,epilog:void 0,parents:[],formatter_class:V,prefix_chars:"-",fromfile_prefix_chars:void 0,argument_default:void 0,conflict_handler:"error",add_help:!0,allow_abbrev:!0,exit_on_error:!0,debug:void 0,version:void 0});function v(t){return t}void 0!==p&&H("debug",'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'),void 0!==d&&H("version","The \"version\" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead."),super({description:r,prefix_chars:a,argument_default:l,conflict_handler:c}),void 0===t&&(t=E.basename(y()[0]||"")),this.prog=t,this.usage=e,this.epilog=n,this.formatter_class=s,this.fromfile_prefix_chars=u,this.add_help=h,this.allow_abbrev=f,this.exit_on_error=_,this.debug=p,this._positionals=this.add_argument_group("positional arguments"),this._optionals=this.add_argument_group("optional arguments"),this._subparsers=void 0,this.register("type",void 0,v),this.register("type",null,v),this.register("type","auto",v),this.register("type","int",(function(t){let e=Number(t);if(!Number.isInteger(e))throw new TypeError(m("could not convert string to int: %r",t));return e})),this.register("type","float",(function(t){let e=Number(t);if(isNaN(e))throw new TypeError(m("could not convert string to float: %r",t));return e})),this.register("type","str",String),this.register("type","string",g.deprecate(String,'use {type:"str"} or {type:String} instead of {type:"string"}'));let A=a.includes("-")?"-":a[0];this.add_help&&this.add_argument(A+"h",A.repeat(2)+"help",{action:"help",default:o,help:"show this help message and exit"}),d&&this.add_argument(A+"v",A.repeat(2)+"version",{action:"version",default:o,version:this.version,help:"show program's version number and exit"});for(let t of i)this._add_container_actions(t),Object.assign(this._defaults,t._defaults)}_get_kwargs(){return["prog","usage","description","formatter_class","conflict_handler","add_help"].map((t=>[t,b(this,t)]))}add_subparsers(){let[t]=U(arguments,{"**kwargs":G});if(void 0!==this._subparsers&&this.error("cannot have multiple subparser arguments"),R(t,"parser_class",this.constructor),"title"in t||"description"in t){let e=b(t,"title","subcommands"),r=b(t,"description",void 0);delete t.title,delete t.description,this._subparsers=this.add_argument_group(e,r)}else this._subparsers=this._positionals;if(void 0===t.prog){let e=this._get_formatter(),r=this._get_positional_actions(),n=this._mutually_exclusive_groups;e.add_usage(this.usage,r,n,""),t.prog=e.format_help().trim()}let e=new(this._pop_action_class(t,"parsers"))(Object.assign({option_strings:[]},t));return this._subparsers._add_action(e),e}_add_action(t){return t.option_strings.length?this._optionals._add_action(t):this._positionals._add_action(t),t}_get_optional_actions(){return this._actions.filter((t=>t.option_strings.length))}_get_positional_actions(){return this._actions.filter((t=>!t.option_strings.length))}parse_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_args(t,e),r&&r.length>0){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_args(t=void 0,e=void 0){void 0===t&&(t=y().slice(1)),void 0===e&&(e=new ht);for(let t of this._actions)t.dest!==o&&(A(e,t.dest)||t.default!==o&&T(e,t.dest,t.default));for(let t of Object.keys(this._defaults))A(e,t)||T(e,t,this._defaults[t]);if(this.exit_on_error)try{[e,t]=this._parse_known_args(t,e)}catch(t){if(!(t instanceof Z))throw t;this.error(t.message)}else[e,t]=this._parse_known_args(t,e);return A(e,_)&&(t=t.concat(b(e,_)),I(e,_)),[e,t]}_parse_known_args(t,e){void 0!==this.fromfile_prefix_chars&&(t=this._read_args_from_files(t));let r=new Map;for(let t of this._mutually_exclusive_groups){let e=t._group_actions;for(let[n,i]of Object.entries(t._group_actions)){let t=r.get(i)||[];t=t.concat(e.slice(0,+n)),t=t.concat(e.slice(+n+1)),r.set(i,t)}}let n={},i=[],s=Object.entries(t)[Symbol.iterator]();for(let[t,e]of s)if("--"===e)for([t,e]of(i.push("-"),s))i.push("A");else{let r,o=this._parse_optional(e);void 0===o?r="A":(n[t]=o,r="O"),i.push(r)}let a,u=i.join(""),l=new Set,c=new Set,h=(t,n,i=void 0)=>{l.add(t);let s=this._get_values(t,n);if(s!==t.default){c.add(t);for(let e of r.get(t)||[])if(c.has(e)){let r="not allowed with argument %s",n=X(e);throw new Z(t,m(r,n))}}s!==o&&t(this,e,s,i)},f=e=>{let r,i=n[e],[o,s,l]=i,c=[];for(;;){if(void 0===o)return a.push(t[e]),e+1;if(void 0===l){let n=e+1,i=u.slice(n);r=n+this._match_argument(o,i);let a=t.slice(n,r);c.push([o,a,s]);break}{let t=this._match_argument(o,"A"),n=this.prefix_chars;if(0!==t||n.includes(s[1])){if(1===t){r=e+1;let t=[l];c.push([o,t,s]);break}throw new Z(o,m("ignored explicit argument %r",l))}{c.push([o,[],s]),s=s[0]+l[0];let t=l.slice(1)||void 0,e=this._option_string_actions;if(!A(e,s)){throw new Z(o,m("ignored explicit argument %r",l))}o=e[s],l=t}}}p(c.length);for(let[t,e,r]of c)h(t,e,r);return r},_=this._get_positional_actions(),g=e=>{let r=u.slice(e),n=this._match_arguments_partial(_,r);for(let r=0;r<_.length&&rt>=d)));if(d!==e){let t=g(d);if(t>d){d=t;continue}d=t}if(!(d in n)){let r=t.slice(d,e);a=a.concat(r),d=e}d=f(d)}let v=g(d);a=a.concat(t.slice(v));let y=[];for(let t of this._actions)l.has(t)||(t.required?y.push(X(t)):void 0!==t.default&&"string"==typeof t.default&&A(e,t.dest)&&t.default===b(e,t.dest)&&T(e,t.dest,this._get_value(t,t.default)));y.length&&this.error(m("the following arguments are required: %s",y.join(", ")));for(let t of this._mutually_exclusive_groups)if(t.required){let e=!0;for(let r of t._group_actions)if(c.has(r)){e=!1;break}if(e){let e=t._group_actions.filter((t=>t.help!==o)).map((t=>X(t))),r="one of the arguments %s is required";this.error(m(r,e.join(" ")))}}return[e,a]}_read_args_from_files(t){let e=[];for(let r of t)if(r&&this.fromfile_prefix_chars.includes(r[0]))try{let t=d.readFileSync(r.slice(1),"utf8"),n=[];for(let e of O(t))for(let t of this.convert_arg_line_to_args(e))n.push(t);n=this._read_args_from_files(n),e=e.concat(n)}catch(t){this.error(t.message)}else e.push(r);return e}convert_arg_line_to_args(t){return[t]}_match_argument(t,e){let r=this._get_nargs_pattern(t),n=e.match(new RegExp("^"+r));if(null===n){let e={undefined:"expected one argument",[s]:"expected at most one argument",[u]:"expected at least one argument"}[t.nargs];throw void 0===e&&(e=m(1===t.nargs?"expected %s argument":"expected %s arguments",t.nargs)),new Z(t,e)}return n[1].length}_match_arguments_partial(t,e){let r=[];for(let n of L(t.length,0,-1)){let i=t.slice(0,n).map((t=>this._get_nargs_pattern(t))).join(""),o=e.match(new RegExp("^"+i));if(null!==o){r=r.concat(o.slice(1).map((t=>t.length)));break}}return r}_parse_optional(t){if(!t)return;if(!this.prefix_chars.includes(t[0]))return;if(t in this._option_string_actions){return[this._option_string_actions[t],t,void 0]}if(1===t.length)return;if(t.includes("=")){let[e,r]=S(t,"=",1);if(e in this._option_string_actions){return[this._option_string_actions[e],e,r]}}let e=this._get_option_tuples(t);if(e.length>1){let r={option:t,matches:e.map((([,t])=>t)).join(", ")},n="ambiguous option: %(option)s could match %(matches)s";this.error(m(n,r))}else if(1===e.length){let[t]=e;return t}return this._negative_number_matcher.test(t)&&!this._has_negative_number_optionals.length||t.includes(" ")?void 0:[void 0,t,void 0]}_get_option_tuples(t){let e=[],r=this.prefix_chars;if(r.includes(t[0])&&r.includes(t[1])){if(this.allow_abbrev){let r,n;t.includes("=")?[r,n]=S(t,"=",1):(r=t,n=void 0);for(let t of Object.keys(this._option_string_actions))if(t.startsWith(r)){let r=[this._option_string_actions[t],t,n];e.push(r)}}}else if(r.includes(t[0])&&!r.includes(t[1])){let r,n=t,i=t.slice(0,2),o=t.slice(2);for(let t of Object.keys(this._option_string_actions))if(t===i){let r=[this._option_string_actions[t],t,o];e.push(r)}else if(t.startsWith(n)){let n=[this._option_string_actions[t],t,r];e.push(n)}}else this.error(m("unexpected option string: %s",t));return e}_get_nargs_pattern(t){let e,r=t.nargs;return e=void 0===r?"(-*A-*)":r===s?"(-*A?-*)":r===a?"(-*[A-]*)":r===u?"(-*A[A-]*)":r===c?"([-AO]*)":r===l?"(-*A[-AO]*)":r===o?"(-*-*)":m("(-*%s-*)","A".repeat(r).split("").join("-*")),t.option_strings.length&&(e=e.replace(/-\*/g,""),e=e.replace(/-/g,"")),e}parse_intermixed_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_intermixed_args(t,e),r.length){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_intermixed_args(t=void 0,e=void 0){let r,n,i=this._get_positional_actions(),s=i.filter((t=>[l,c].includes(t.nargs)));if(s.length)throw new TypeError(m("parse_intermixed_args: positional arg with nargs=%s",s[0].nargs));for(let t of this._mutually_exclusive_groups)for(let e of t._group_actions)if(i.includes(e))throw new TypeError("parse_intermixed_args: positional in mutuallyExclusiveGroup");try{let s;n=this.usage;try{void 0===this.usage&&(this.usage=this.format_usage().slice(7));for(let t of i)t.save_nargs=t.nargs,t.nargs=o,t.save_default=t.default,t.default=o;[e,s]=this.parse_known_args(t,e);for(let t of i){let r=b(e,t.dest);Array.isArray(r)&&0===r.length&&(console.warn(m("Do not expect %s in %s",t.dest,e)),I(e,t.dest))}}finally{for(let t of i)t.nargs=t.save_nargs,t.default=t.save_default}let a=this._get_optional_actions();try{for(let t of a)t.save_required=t.required,t.required=!1;for(let t of this._mutually_exclusive_groups)t.save_required=t.required,t.required=!1;[e,r]=this.parse_known_args(s,e)}finally{for(let t of a)t.required=t.save_required;for(let t of this._mutually_exclusive_groups)t.required=t.save_required}}finally{this.usage=n}return[e,r]}_get_values(t,e){if(![l,c].includes(t.nargs))try{w(e,"--")}catch(t){}let r;if(e.length||t.nargs!==s)if(e.length||t.nargs!==a||t.option_strings.length)if(1===e.length&&[void 0,s].includes(t.nargs)){let n=e[0];r=this._get_value(t,n),this._check_value(t,r)}else if(t.nargs===c)r=e.map((e=>this._get_value(t,e)));else if(t.nargs===l)r=e.map((e=>this._get_value(t,e))),this._check_value(t,r[0]);else if(t.nargs===o)r=o;else{r=e.map((e=>this._get_value(t,e)));for(let e of r)this._check_value(t,e)}else r=void 0!==t.default?t.default:e,this._check_value(t,r);else r=t.option_strings.length?t.const:t.default,"string"==typeof r&&(r=this._get_value(t,r),this._check_value(t,r));return r}_get_value(t,e){let r,n=this._registry_get("type",t.type,t.type);if("function"!=typeof n){throw new Z(t,m("%r is not callable",n))}try{try{r=n(e)}catch(t){if(!(t instanceof TypeError&&/Class constructor .* cannot be invoked without 'new'/.test(t.message)))throw t;r=new n(e)}}catch(r){if(r instanceof q){let e=r.message;throw new Z(t,e)}if(r instanceof TypeError){let r=b(t.type,"name",v(t.type));throw new Z(t,m("invalid %(type)s value: %(value)r",{type:r,value:e}))}throw r}return r}_check_value(t,e){if(void 0!==t.choices&&!C(t.choices).includes(e)){let r={value:e,choices:C(t.choices).map(v).join(", ")};throw new Z(t,m("invalid choice: %(value)r (choose from %(choices)s)",r))}}format_usage(){let t=this._get_formatter();return t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.format_help()}format_help(){let t=this._get_formatter();t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.add_text(this.description);for(let e of this._action_groups)t.start_section(e.title),t.add_text(e.description),t.add_arguments(e._group_actions),t.end_section();return t.add_text(this.epilog),t.format_help()}_get_formatter(){return new this.formatter_class({prog:this.prog})}print_usage(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_usage(),t)}print_help(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_help(),t)}_print_message(t,e=void 0){t&&(void 0===e&&(e=process.stderr),e.write(t))}exit(t=0,e=void 0){e&&this._print_message(e,process.stderr),process.exit(t)}error(t){if(!0===this.debug)throw new Error(t);this.print_usage(process.stderr);let e={prog:this.prog,message:t};this.exit(2,m("%(prog)s: error: %(message)s\n",e))}}));e.exports={ArgumentParser:gt,ArgumentError:Z,ArgumentTypeError:q,BooleanOptionalAction:Q,FileType:ct,HelpFormatter:V,ArgumentDefaultsHelpFormatter:K,RawDescriptionHelpFormatter:z,RawTextHelpFormatter:W,MetavarTypeHelpFormatter:Y,Namespace:ht,Action:$,ONE_OR_MORE:u,OPTIONAL:s,PARSER:l,REMAINDER:c,SUPPRESS:o,ZERO_OR_MORE:a},Object.defineProperty(e.exports,"Const",{get(){let t={};return Object.entries({ONE_OR_MORE:u,OPTIONAL:s,PARSER:l,REMAINDER:c,SUPPRESS:o,ZERO_OR_MORE:a}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(H(e,m("use argparse.%s instead of argparse.Const.%s",e,e)),r)})})),Object.entries({_UNRECOGNIZED_ARGS_ATTR:_}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(H(e,m("argparse.Const.%s is an internal symbol and will no longer be available",e)),r)})})),t},enumerable:!1})}(a);var _=a.exports,p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},p(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var d,m,E,v=function(){return v=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(U,(function(t,r,n,i,o,s){if(r)e.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(k.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(x.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(x,(function(t,r,n,i,o,s){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var o=i.options[0];"w"===o?e=v(v({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=v(v({},e),H(o)))}else if(G.test(i.stem))e=v(v({},e),H(i.stem));else{var s=F(i.stem);s&&(e=v(v({},e),s));var a=j(i.stem);a&&(e=v(v({},e),a))}}return e}var W,K={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Y(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(K[r||""]||K[n||""]||K["".concat(n,"-001")]||K["001"])[0]}var X=new RegExp("^".concat(D.source,"*")),Z=new RegExp("".concat(D.source,"*$"));function q(t,e){return{start:t,end:e}}var $=!!String.prototype.startsWith,Q=!!String.fromCodePoint,J=!!Object.fromEntries,tt=!!String.prototype.codePointAt,et=!!String.prototype.trimStart,rt=!!String.prototype.trimEnd,nt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},it=!0;try{it="a"===(null===(W=ft("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===W?void 0:W[0])}catch(Ke){it=!1}var ot,st=$?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},at=Q?String.fromCodePoint:function(){for(var t=[],e=0;eo;){if((r=t[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},ut=J?Object.fromEntries:function(t){for(var e={},r=0,n=t;r=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},ct=et?function(t){return t.trimStart()}:function(t){return t.replace(X,"")},ht=rt?function(t){return t.trimEnd()}:function(t){return t.replace(Z,"")};function ft(t,e){return new RegExp(t,e)}if(it){var _t=ft("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ot=function(t,e){var r;return _t.lastIndex=e,null!==(r=_t.exec(t)[1])&&void 0!==r?r:""}}else ot=function(t,e){for(var r=[];;){var n=lt(t,e);if(void 0===n||dt(n)||mt(n))break;r.push(n),e+=n>=65536?2:1}return at.apply(void 0,r)};var pt=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(t,r)).err)return o;n.push(o.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(d.UNMATCHED_CLOSING_TAG,q(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&>(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:m.pound,location:q(s,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:m.literal,value:"<".concat(n,"/>"),location:q(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:m.tag,value:n,children:o,location:q(r,this.clonePosition())},err:null}:this.error(d.INVALID_TAG,q(s,this.clonePosition())))}return this.error(d.UNCLOSED_TAG,q(r,this.clonePosition()))}return this.error(d.INVALID_TAG,q(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var o=this.tryParseUnquoted(t,e);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=q(r,this.clonePosition());return{val:{type:m.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(gt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return at.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),at(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,q(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(d.EMPTY_ARGUMENT,q(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(d.MALFORMED_ARGUMENT,q(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,q(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:m.argument,value:n,location:q(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,q(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(d.MALFORMED_ARGUMENT,q(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=ot(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:q(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(d.EXPECT_ARGUMENT_TYPE,q(o,a));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(_=ht(A.val)).length)return this.error(d.EXPECT_ARGUMENT_STYLE,q(this.clonePosition(),this.clonePosition()));u={style:_,styleLocation:q(l,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var c=q(n,this.clonePosition());if(u&&st(null==u?void 0:u.style,"::",0)){var h=ct(u.style.slice(2));if("number"===s)return(A=this.parseNumberSkeletonFromString(h,u.styleLocation)).err?A:{val:{type:m.number,value:r,location:c,style:A.val},err:null};if(0===h.length)return this.error(d.EXPECT_DATE_TIME_SKELETON,c);var f=h;this.locale&&(f=function(t,e){for(var r="",n=0;n>1),u=Y(e);for("H"!=u&&"k"!=u||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=u+r}else r+="J"===i?"H":i}return r}(h,this.locale));var _={type:E.dateTime,pattern:f,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?B(f):{}};return{val:{type:"date"===s?m.date:m.time,value:r,location:c,style:_},err:null}}return{val:{type:"number"===s?m.number:"date"===s?m.date:m.time,value:r,location:c,style:null!==(i=null==u?void 0:u.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(d.EXPECT_SELECT_ARGUMENT_OPTIONS,q(p,v({},p)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),y=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,d.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),g=this.parseIdentifierIfPossible(),y=A.val}var b,T=this.tryParsePluralOrSelectOptions(t,s,e,g);if(T.err)return T;if((b=this.tryParseArgumentClose(n)).err)return b;var R=q(n,this.clonePosition());return"select"===s?{val:{type:m.select,value:r,options:ut(T.val),location:R},err:null}:{val:{type:m.plural,value:r,options:ut(T.val),offset:y,pluralType:"plural"===s?"cardinal":"ordinal",location:R},err:null};default:return this.error(d.INVALID_ARGUMENT_TYPE,q(o,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(d.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,q(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(P).filter((function(t){return t.length>0}));r=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=q(n,this.clonePosition());return i?nt(o*=r)?{val:o,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=lt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(st(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&dt(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function gt(t){return t>=97&&t<=122||t>=65&&t<=90}function dt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function mt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function Et(t){t.forEach((function(t){if(delete t.location,L(t)||O(t))for(var e in t.options)delete t.options[e].location,Et(t.options[e].value);else T(t)&&w(t.style)||(R(t)||I(t))&&C(t.style)?delete t.style.location:N(t)&&Et(t.children)}))}function vt(t,e){void 0===e&&(e={}),e=v({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new pt(t,e).parse();if(r.err){var n=SyntaxError(d[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||Et(r.val),r.val}function yt(t,e){var r=e&&e.cache?e.cache:St,n=e&&e.serializer?e.serializer:It;return(e&&e.strategy?e.strategy:Rt)(t,{cache:r,serializer:n})}function At(t,e,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=e.get(o);return void 0===s&&(s=t.call(this,n),e.set(o,s)),s}function bt(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=e.get(i);return void 0===o&&(o=t.apply(this,n),e.set(i,o)),o}function Tt(t,e,r,n,i){return r.bind(e,t,n,i)}function Rt(t,e){return Tt(t,this,1===t.length?At:bt,e.cache.create(),e.serializer)}var It=function(){return JSON.stringify(arguments)};function Lt(){this.cache=Object.create(null)}Lt.prototype.get=function(t){return this.cache[t]},Lt.prototype.set=function(t,e){this.cache[t]=e};var Ot,St={create:function(){return new Lt}},Nt={variadic:function(t,e){return Tt(t,this,bt,e.cache.create(),e.serializer)},monadic:function(t,e){return Tt(t,this,At,e.cache.create(),e.serializer)}};!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Ot||(Ot={}));var wt,Ct=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return g(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Dt=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Ot.INVALID_VALUE,i)||this}return g(e,t),e}(Ct),Mt=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Ot.INVALID_VALUE,n)||this}return g(e,t),e}(Ct),Bt=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Ot.MISSING_VALUE,r)||this}return g(e,t),e}(Ct);function Pt(t){return"function"==typeof t}function xt(t,e,r,n,i,o,s){if(1===t.length&&A(t[0]))return[{type:wt.literal,value:t[0].value}];for(var a=[],u=0,l=t;u0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=vt,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(kt||(kt={}));var Ft=function(t){function e(r,n,i){var o=this,s=i?i instanceof Error?i:new Error(String(i)):void 0;return(o=t.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,"\n").concat(s?"\n".concat(s.message,"\n").concat(s.stack):""))||this).code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o,e),o}return g(e,t),e}(Error),jt=function(t){function e(e,r){return t.call(this,kt.UNSUPPORTED_FORMATTER,e,r)||this}return g(e,t),e}(Ft),Vt=function(t){function e(e,r){return t.call(this,kt.INVALID_CONFIG,e,r)||this}return g(e,t),e}(Ft),zt=function(t){function e(e,r){return t.call(this,kt.MISSING_DATA,e,r)||this}return g(e,t),e}(Ft),Wt=function(t){function e(e,r,n){var i=t.call(this,kt.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(r,"\n"),n)||this;return i.locale=r,i}return g(e,t),e}(Ft),Kt=function(t){function e(e,r,n,i){var o=t.call(this,"".concat(e,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),r,i)||this;return o.descriptor=n,o.locale=r,o}return g(e,t),e}(Wt),Yt=function(t){function e(e,r){var n=t.call(this,kt.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(r,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return n.descriptor=e,n}return g(e,t),e}(Ft);function Xt(t,e,r){return void 0===r&&(r={}),e.reduce((function(e,n){return n in t?e[n]=t[n]:n in r&&(e[n]=r[n]),e}),{})}var Zt={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){"production"!==process.env.NODE_ENV&&console.error(t)},onWarn:function(t){"production"!==process.env.NODE_ENV&&console.warn(t)}};function qt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}function $t(t,e,r,n){var i,o=t&&t[e];if(o&&(i=o[r]),i)return i;n(new jt("No ".concat(e," format named: ").concat(r)))}function Qt(t,e){return Object.keys(t).reduce((function(r,n){return r[n]=v({timeZone:e},t[n]),r}),{})}function Jt(t,e){return Object.keys(v(v({},t),e)).reduce((function(r,n){return r[n]=v(v({},t[n]||{}),e[n]||{}),r}),{})}function te(t,e){if(!e)return t;var r=Ht.formats;return v(v(v({},r),t),{date:Jt(Qt(r.date,e),Qt(t.date||{},e)),time:Jt(Qt(r.time,e),Qt(t.time||{},e))})}var ee=function(t,e,r,n,i){var o=t.locale,s=t.formats,a=t.messages,u=t.defaultLocale,l=t.defaultFormats,c=t.fallbackOnEmptyString,h=t.onError,f=t.timeZone,_=t.defaultRichTextElements;void 0===r&&(r={id:""});var p=r.id,g=r.defaultMessage;!function(t,e,r){if(void 0===r&&(r=Error),!t)throw new r(e)}(!!p,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var d=String(p),E=a&&Object.prototype.hasOwnProperty.call(a,d)&&a[d];if(Array.isArray(E)&&1===E.length&&E[0].type===m.literal)return E[0].value;if(!n&&E&&"string"==typeof E&&!_)return E.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=v(v({},_),n||{}),s=te(s,f),l=te(l,f),!E){if(!1===c&&""===E)return E;if((!g||o&&o.toLowerCase()!==u.toLowerCase())&&h(new Yt(r,o)),g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){return h(new Kt('Error formatting default message for: "'.concat(d,'", rendering default message verbatim'),o,r,t)),"string"==typeof g?g:d}return d}try{return e.getMessageFormat(E,o,s,v({formatters:e},i||{})).format(n)}catch(t){h(new Kt('Error formatting message: "'.concat(d,'", using ').concat(g?"default message":"id"," as fallback."),o,r,t))}if(g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){h(new Kt('Error formatting the default message for: "'.concat(d,'", rendering message verbatim'),o,r,t))}return"string"==typeof E?E:"string"==typeof g?g:d},re=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function ne(t,e,r,n){var i=t.locale,o=t.formats,s=t.onError,a=t.timeZone;void 0===n&&(n={});var u=n.format,l=v(v({},a&&{timeZone:a}),u&&$t(o,e,u,s)),c=Xt(n,re,l);return"time"!==e||c.hour||c.minute||c.second||c.timeStyle||c.dateStyle||(c=v(v({},c),{hour:"numeric",minute:"numeric"})),r(i,c)}function ie(t,e){for(var r=[],n=2;n",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"}},{name:"English",locale:{APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally(Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally(Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",B_USAGE:"{used}B/{total}B",KB_USAGE:"{used, number, ::.0}KB/{total, number, ::.0}KB",BYTES:"{bytes}B",KB:"{kb, number, ::.0}KB",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error(Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function main is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error(Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable {id}",FUNCTION_NOT_FOUND:"Can't find function {id}",LABEL_NOT_FOUND:"Can't find label {id}",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id already declared",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id already declared",DUPLICATE_PARAM_ID:"PARAM's param id already declared",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"}}],Le=new Int32Array(1);function Oe(t){return Le[0]=t,Le[0]}function Se(t,e){return Oe(t+e)}function Ne(t,e){return Oe(t-e)}var we,Ce,De,Me,Be,Pe,xe,Ge,Ue;function ke(t,e){return t<0||t+4>e.length?{value:null,status:we.OUT_OF_BOUND}:{value:Oe(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24),status:we.SUCCESS}}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(we||(we={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(Ce||(Ce={})),function(t){t[t.IMM=0]="IMM",t[t.ID=1]="ID",t[t.ADDRESS_ID=2]="ADDRESS_ID",t[t.DEREF_ID=3]="DEREF_ID"}(De||(De={})),function(t){t[t.ADD=0]="ADD",t[t.SUB=1]="SUB",t[t.MUL=2]="MUL",t[t.DIV=3]="DIV"}(Me||(Me={})),function(t){t[t.EQ=0]="EQ",t[t.NE=1]="NE",t[t.LT=2]="LT",t[t.LE=3]="LE",t[t.GT=4]="GT",t[t.GE=5]="GE"}(Be||(Be={})),function(t){t[t.ID=0]="ID",t[t.DEREF_ID=1]="DEREF_ID"}(Pe||(Pe={})),function(t){t[t.SINGULAR=0]="SINGULAR",t[t.BINARY_MATH_OP=1]="BINARY_MATH_OP"}(xe||(xe={})),function(t){t[t.FUNCTION=0]="FUNCTION",t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.LABEL=4]="LABEL",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE",t[t.EMPTY=14]="EMPTY",t[t.COMMENT=15]="COMMENT",t[t.ERROR=16]="ERROR"}(Ge||(Ge={})),function(t){t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE"}(Ue||(Ue={}));const He=new Set(["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"]);class Fe{patternId=new RegExp(/^(?[a-zA-Z_]\w*)$/);patternSize=new RegExp(/^(?\d+)$/);patternSingular=new RegExp(/^(#(?-?\d+))$|^(?[a-zA-Z_]\w*)$|^(\*(?[a-zA-Z_]\w*))$|^(&(?[a-zA-Z_]\w*))$/);patternLValue=new RegExp(/^((?[a-zA-Z_]\w*))$|^(\*(?[a-zA-Z_]\w*))$/);illegalInstructionFormatError={type:Ge.ERROR,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"};purify(t){return t.trim().replaceAll(/[ \t]+/g," ")}splitWhiteSpace(t){return t.replaceAll("\t"," ").split(" ")}decodeComponentId(t){const e=t.match(this.patternId);return null===e||He.has(t)?null:e.groups.id}decodeComponentSize(t){const e=t.match(this.patternSize);if(null===e)return null;const r=parseInt(e.groups.size);return Number.isSafeInteger(r)?Oe(r):1/0}decodeComponentSingular(t){const e=t.match(this.patternSingular);if(null===e)return null;if(void 0!==e.groups.imm){const t=parseInt(e.groups.imm);return Number.isSafeInteger(t)?{type:De.IMM,imm:Oe(t)}:{type:De.IMM,imm:1/0}}return void 0!==e.groups.id?{type:De.ID,id:e.groups.id}:void 0!==e.groups.derefId?{type:De.DEREF_ID,id:e.groups.derefId}:{type:De.ADDRESS_ID,id:e.groups.addressId}}decodeComponentLValue(t){const e=t.match(this.patternLValue);return null===e?null:void 0!==e.groups.id?{type:Pe.ID,id:e.groups.id}:{type:Pe.DEREF_ID,id:e.groups.derefId}}decodeFunction(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:Ge.ERROR,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:Ge.FUNCTION,value:{id:e}}}decodeAssign(t){if(3!==t.length&&5!==t.length||":="!==t[1])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:Ge.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentSingular(t[2]);if(null===r)return{type:Ge.ERROR,messageKey:3===t.length?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(r.type===De.IMM&&!Number.isFinite(r.imm))return{type:Ge.ERROR,messageKey:3===t.length?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(3===t.length)return{type:Ge.ASSIGN,value:{lValue:e,rValue:{type:xe.SINGULAR,singular:r}}};{let n=Me.ADD;switch(t[3]){case"+":n=Me.ADD;break;case"-":n=Me.SUB;break;case"*":n=Me.MUL;break;case"/":n=Me.DIV;break;default:return{type:Ge.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const i=this.decodeComponentSingular(t[4]);return null===i?{type:Ge.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:i.type!==De.IMM||Number.isFinite(i.imm)?{type:Ge.ASSIGN,value:{lValue:e,rValue:{type:xe.BINARY_MATH_OP,singularL:r,singularR:i,binaryMathOp:n}}}:{type:Ge.ERROR,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}}}decodeDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:Ge.ERROR,messageKey:"DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:Ge.ERROR,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:Ge.ERROR,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:Ge.DEC,value:{id:e,size:r}}:{type:Ge.ERROR,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:Ge.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:Ge.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:Ge.ERROR,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:Ge.GLOBAL_DEC,value:{id:e,size:r}}:{type:Ge.ERROR,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:Ge.ERROR,messageKey:"LABEL_ILLEGAL_ID"}:{type:Ge.LABEL,value:{id:e}}}decodeGoto(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:Ge.ERROR,messageKey:"GOTO_ILLEGAL_ID"}:{type:Ge.GOTO,value:{id:e}}}decodeIf(t){if(6!==t.length||"GOTO"!==t[4])return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);if(null===e)return{type:Ge.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(e.type===De.IMM&&!Number.isFinite(e.imm))return{type:Ge.ERROR,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let r=Be.EQ;switch(t[2]){case"==":r=Be.EQ;break;case"!=":r=Be.NE;break;case"<":r=Be.LT;break;case"<=":r=Be.LE;break;case">":r=Be.GT;break;case">=":r=Be.GE;break;default:return{type:Ge.ERROR,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const n=this.decodeComponentSingular(t[3]);if(null===n)return{type:Ge.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(n.type===De.IMM&&!Number.isFinite(n.imm))return{type:Ge.ERROR,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const i=this.decodeComponentId(t[5]);return null===i?{type:Ge.ERROR,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:Ge.IF,value:{condition:{singularL:e,singularR:n,binaryRelOp:r},gotoId:i}}}decodeArg(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:Ge.ERROR,messageKey:"ARG_ILLEGAL"}:e.type!==De.IMM||Number.isFinite(e.imm)?{type:Ge.ARG,value:{value:e}}:{type:Ge.ERROR,messageKey:"ARG_IMM_TOO_LARGE"}}decodeCall(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:Ge.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:Ge.CALL,value:{id:e}}}decodeAssignCall(t){if(4!==t.length||":="!==t[1]||"CALL"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:Ge.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentId(t[3]);return null===r?{type:Ge.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:Ge.ASSIGN_CALL,value:{lValue:e,functionId:r}}}decodeParam(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:Ge.ERROR,messageKey:"PARAM_ILLEGAL_ID"}:{type:Ge.PARAM,value:{id:e}}}decodeReturn(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:Ge.ERROR,messageKey:"RETURN_ILLEGAL"}:e.type!==De.IMM||Number.isFinite(e.imm)?{type:Ge.RETURN,value:{value:e}}:{type:Ge.ERROR,messageKey:"RETURN_IMM_TOO_LARGE"}}decodeRead(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[1]);return null===e?{type:Ge.ERROR,messageKey:"READ_ILLEGAL"}:{type:Ge.READ,value:{lValue:e}}}decodeWrite(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:Ge.ERROR,messageKey:"WRITE_ILLEGAL"}:e.type!==De.IMM||Number.isFinite(e.imm)?{type:Ge.WRITE,value:{value:e}}:{type:Ge.ERROR,messageKey:"WRITE_IMM_TOO_LARGE"}}decode(t){if(t.match(/^[ \t]*$/))return{type:Ge.EMPTY};const e={type:Ge.ERROR,messageKey:"UNRECOGNIZED_INSTRUCTION"},r=this.purify(t);if(r.startsWith(";"))return{type:Ge.COMMENT};const n=this.splitWhiteSpace(r);if(n.length<1)return e;switch(n[0]){case"FUNCTION":return this.decodeFunction(n);case"DEC":return this.decodeDec(n);case"GLOBAL_DEC":return this.decodeGlobalDec(n);case"LABEL":return this.decodeLabel(n);case"GOTO":return this.decodeGoto(n);case"IF":return this.decodeIf(n);case"ARG":return this.decodeArg(n);case"CALL":return this.decodeCall(n);case"PARAM":return this.decodeParam(n);case"RETURN":return this.decodeReturn(n);case"READ":return this.decodeRead(n);case"WRITE":return this.decodeWrite(n);default:{const t=this.decodeAssign(n);if(t.type===Ge.ASSIGN)return t;const e=this.decodeAssignCall(n);return e.type===Ge.ASSIGN_CALL?e:t}}}}var je,Ve,ze={exports:{}}; +import t from"fs";import e from"readline";import r from"assert";import n from"util";import i from"path";var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};const{inspect:a}=n;var u,l,c=function(t,...e){let r=t.replace(/%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g,(function(t,r,n,i,o,s){if(r)return"%";let u,l=0;if(i){if(0===e.length)throw new TypeError("not enough arguments for format string");if(l=e.shift(),!Number.isInteger(l))throw new TypeError("* wants int")}if(void 0!==o){let t=e[0];if("object"!=typeof t||null===t)throw new TypeError("format requires a mapping");if(!(o in t))throw new TypeError(`no such key: '${o}'`);u=t[o]}else{if(0===e.length)throw new TypeError("not enough arguments for format string");u=e.shift()}switch(s){case"s":u=String(u);break;case"r":u=a(u);break;case"d":case"i":if("number"!=typeof u)throw new TypeError(`%${s} format: a number is required, not ${typeof u}`);u=String(u.toFixed(0));break;default:throw new TypeError(`unsupported format character '${s}'`)}return l>0?n?u.padEnd(l):u.padStart(l):u}));if(e.length&&(1!==e.length||"object"!=typeof e[0]||null===e[0]))throw new TypeError("not all arguments converted during string formatting");return r};function h(){if(l)return u;l=1;const t=/([\t\n\x0b\x0c\r ]+)/;class e{constructor(t={}){let{width:e=70,initial_indent:r="",subsequent_indent:n="",expand_tabs:i=!0,replace_whitespace:o=!0,fix_sentence_endings:s=!1,break_long_words:a=!0,drop_whitespace:u=!0,break_on_hyphens:l=!0,tabsize:c=8,max_lines:h,placeholder:f=" [...]"}=t;this.width=e,this.initial_indent=r,this.subsequent_indent=n,this.expand_tabs=i,this.replace_whitespace=o,this.fix_sentence_endings=s,this.break_long_words=a,this.drop_whitespace=u,this.break_on_hyphens=l,this.tabsize=c,this.max_lines=h,this.placeholder=f}_munge_whitespace(t){return this.expand_tabs&&(t=t.replace(/\t/g," ".repeat(this.tabsize))),this.replace_whitespace&&(t=t.replace(/[\t\n\x0b\x0c\r]/g," ")),t}_split(e){let r=e.split(t);return r=r.filter(Boolean),r}_handle_long_word(t,e,r,n){let i;i=n<1?1:n-r,this.break_long_words?(e.push(t[t.length-1].slice(0,i)),t[t.length-1]=t[t.length-1].slice(i)):e||e.push(...t.pop())}_wrap_chunks(t){let e,r=[];if(this.width<=0)throw Error(`invalid width ${this.width} (must be > 0)`);if(void 0!==this.max_lines&&(e=this.max_lines>1?this.subsequent_indent:this.initial_indent,e.length+this.placeholder.trimStart().length>this.width))throw Error("placeholder too large for max width");for(t=t.reverse();t.length>0;){let e,n=[],i=0;e=r?this.subsequent_indent:this.initial_indent;let o=this.width-e.length;for(this.drop_whitespace&&""===t[t.length-1].trim()&&r.length>0&&t.pop();t.length>0;){let e=t[t.length-1].length;if(!(i+e<=o))break;n.push(t.pop()),i+=e}if(t.length&&t[t.length-1].length>o&&(this._handle_long_word(t,n,i,o),i=n.map((t=>t.length)).reduce(((t,e)=>t+e),0)),this.drop_whitespace&&n.length>0&&""===n[n.length-1].trim()&&(i-=n[n.length-1].length,n.pop()),n){if(!(void 0===this.max_lines||r.length+10)for(let i=t;ie;i+=r)n.push(i);return n}function S(t,e=!1){let r;if(e){r=[];let e=t.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/);for(let t=0;tr&&(n=n.slice(0,r).concat([n.slice(r).join(e)])),n}function N(t,e){if(t.length!==e.length)return!1;for(let r=0;rt[0]+t[2].toUpperCase()));r!==e&&M(t.prototype,r,e)}return t}function P(t){return"default"===(t=t.replace(/\w_[a-z]/g,(t=>t[0]+t[2].toUpperCase())))&&(t="defaultValue"),"const"===t&&(t="constant"),t}function x(t){return"defaultValue"===t&&(t="default"),"constant"===t&&(t="const"),t=t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}let G=Symbol("no_default_value");function U(t,e){function r(){let t=(new Error).stack.split("\n").map((t=>t.match(/^ at (.*) \(.*\)$/))).filter(Boolean).map((t=>t[1])).map((t=>t.match(/[^ .]*$/)[0]));return t.length&&t[0]===r.name&&t.shift(),t.length&&t[0]===U.name&&t.shift(),t.length?t[0]:""}let n={},i=[],o=(t=Array.from(t)).length&&t[t.length-1];"object"!=typeof o||null===o||Array.isArray(o)||o.constructor&&"Object"!==o.constructor.name||(n=Object.assign({},t.pop()));let s=[];for(let t of Object.keys(e)){let e=P(t);e!==t&&e in n&&(t in n||(n[t]=n[e]),s.push([e,t]),delete n[e])}if(s.length){let t=r();H("camelcase_"+t,m("%s(): following options are renamed: %s",t,s.map((([t,e])=>m("%r -> %r",t,e)))))}let a=[],u=t.length;for(let[o,s]of Object.entries(e))if("*"===o[0])if(o.length>0&&"*"===o[1]){let t=[];for(let e of Object.keys(n)){let r=x(e);r!==e&&e in n&&(r in n||(n[r]=n[e]),t.push([e,r]),delete n[e])}if(t.length){let e=r();H("camelcase_"+e,m("%s(): following options are renamed: %s",e,t.map((([t,e])=>m("%r -> %r",t,e)))))}i.push(n),n={}}else i.push(t),t=[];else{if(o in n&&t.length>0)throw new TypeError(m("%s() got multiple values for argument %r",r(),o));o in n?(i.push(n[o]),delete n[o]):t.length>0?i.push(t.shift()):s!==G?i.push(s):a.push(o)}if(Object.keys(n).length)throw new TypeError(m("%s() got an unexpected keyword argument %r",r(),Object.keys(n)[0]));if(t.length){let t=Object.entries(e).filter((([t,e])=>"*"!==t[0]&&e!==G)).length,n=Object.entries(e).filter((([t])=>"*"!==t[0])).length;throw new TypeError(m("%s() takes %s positional argument%s but %s %s given",r(),t===n?m("from %s to %s",t,n):n,t===n&&1===n?"":"s",u,1===u?"was":"were"))}if(a.length){let t=a.map(v);t.length>1&&(t[t.length-1]="and "+t[t.length-1]);let e=t.join(2===t.length?"":", ");throw new TypeError(m("%s() missing %i required positional argument%s: %s",r(),t.length,1===t.length?"":"s",e))}return i}let k={};function H(t,e){k[t]=k[t]||g.deprecate((()=>{}),e),k[t]()}function F(t=Object){return class extends t{[g.inspect.custom](){let t=this.constructor.name,e=[],r={};for(let t of this._get_args())e.push(v(t));for(let[t,n]of this._get_kwargs())/^[a-z_][a-z0-9_$]*$/i.test(t)?e.push(m("%s=%r",t,n)):r[t]=n;return Object.keys(r).length&&e.push(m("**%s",v(r))),m("%s(%s)",t,e.join(", "))}toString(){return this[g.inspect.custom]()}_get_kwargs(){return Object.entries(this)}_get_args(){return[]}}}function j(t){return void 0===t?[]:t.slice(0)}const V=B(D(class{constructor(){let[t,e,r,n]=U(arguments,{prog:G,indent_increment:2,max_help_position:24,width:void 0});void 0===n&&(n=+process.env.COLUMNS||process.stdout.columns||80,n-=2),this._prog=t,this._indent_increment=e,this._max_help_position=Math.min(r,Math.max(n-20,2*e)),this._width=n,this._current_indent=0,this._level=0,this._action_max_length=0,this._root_section=this._Section(this,void 0),this._current_section=this._root_section,this._whitespace_matcher=/[ \t\n\r\f\v]+/g,this._long_break_matcher=/\n\n\n+/g}_indent(){this._current_indent+=this._indent_increment,this._level+=1}_dedent(){this._current_indent-=this._indent_increment,p(this._current_indent>=0,"Indent decreased below 0."),this._level-=1}_add_item(t,e){this._current_section.items.push([t,e])}start_section(t){this._indent();let e=this._Section(this,this._current_section,t);this._add_item(e.format_help.bind(e),[]),this._current_section=e}end_section(){this._current_section=this._current_section.parent,this._dedent()}add_text(t){t!==o&&void 0!==t&&this._add_item(this._format_text.bind(this),[t])}add_usage(t,e,r,n=void 0){if(t!==o){let i=[t,e,r,n];this._add_item(this._format_usage.bind(this),i)}}add_argument(t){if(t.help!==o){let e=[this._format_action_invocation(t)];for(let r of this._iter_indented_subactions(t))e.push(this._format_action_invocation(r));let r=Math.max(...e.map((t=>t.length)))+this._current_indent;this._action_max_length=Math.max(this._action_max_length,r),this._add_item(this._format_action.bind(this),[t])}}add_arguments(t){for(let e of t)this.add_argument(e)}format_help(){let t=this._root_section.format_help();return t&&(t=t.replace(this._long_break_matcher,"\n\n"),t=t.replace(/^\n+|\n+$/g,"")+"\n"),t}_join_parts(t){return t.filter((t=>t&&t!==o)).join("")}_format_usage(t,e,r,n){if(void 0===n&&(n="usage: "),void 0!==t)t=m(t,{prog:this._prog});else if(void 0!==t||e.length){if(void 0===t){let i=m("%(prog)s",{prog:this._prog}),o=[],s=[];for(let t of e)t.option_strings.length?o.push(t):s.push(t);t=[i,this._format_actions_usage([].concat(o).concat(s),r)].map(String).join(" ");let a=this._width-this._current_indent;if(n.length+t.length>a){let e=/\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g,u=this._format_actions_usage(o,r),l=this._format_actions_usage(s,r),c=u.match(e)||[],h=l.match(e)||[];p(c.join(" ")===u),p(h.join(" ")===l);let f,_=(t,e,r=void 0)=>{let n,i=[],o=[];n=void 0!==r?r.length-1:e.length-1;for(let r of t)n+1+r.length>a&&o&&(i.push(e+o.join(" ")),o=[],n=e.length-1),o.push(r),n+=r.length+1;return o.length&&i.push(e+o.join(" ")),void 0!==r&&(i[0]=i[0].slice(e.length)),i};if(n.length+i.length<=.75*a){let t=" ".repeat(n.length+i.length+1);c.length?(f=_([i].concat(c),t,n),f=f.concat(_(h,t))):f=h.length?_([i].concat(h),t,n):[i]}else{let t=" ".repeat(n.length);f=_([].concat(c).concat(h),t),f.length>1&&(f=[],f=f.concat(_(c,t)),f=f.concat(_(h,t))),f=[i].concat(f)}t=f.join("\n")}}}else t=m("%(prog)s",{prog:this._prog});return m("%s%s\n\n",n,t)}_format_actions_usage(t,e){let r=new Set,n={};for(let i of e){let e=t.indexOf(i._group_actions[0]);if(-1!==e){let o=e+i._group_actions.length;if(N(t.slice(e,o),i._group_actions)){for(let t of i._group_actions)r.add(t);i.required?(e in n?n[e]+=" (":n[e]="(",o in n?n[o]+=")":n[o]=")"):(e in n?n[e]+=" [":n[e]="[",o in n?n[o]+="]":n[o]="]");for(let t of L(e+1,o))n[t]="|"}}}let i=[];for(let[e,s]of Object.entries(t))if(s.help===o)i.push(void 0),"|"===n[+e]?delete n[+e]:"|"===n[+e+1]&&delete n[+e+1];else if(s.option_strings.length){let t,e=s.option_strings[0];if(0===s.nargs)t=s.format_usage();else{let r=this._get_default_metavar_for_optional(s),n=this._format_args(s,r);t=m("%s %s",e,n)}s.required||r.has(s)||(t=m("[%s]",t)),i.push(t)}else{let t=this._get_default_metavar_for_positional(s),e=this._format_args(s,t);r.has(s)&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),i.push(e)}for(let t of Object.keys(n).map(Number).sort(((t,e)=>e-t)))i.splice(+t,0,n[+t]);let s=i.filter(Boolean).join(" ");return s=s.replace(/([\[(]) /g,"$1"),s=s.replace(/ ([\])])/g,"$1"),s=s.replace(/[\[(] *[\])]/g,""),s=s.replace(/\(([^|]*)\)/g,"$1",s),s=s.trim(),s}_format_text(t){t.includes("%(prog)")&&(t=m(t,{prog:this._prog}));let e=Math.max(this._width-this._current_indent,11),r=" ".repeat(this._current_indent);return this._fill_text(t,e,r)+"\n\n"}_format_action(t){let e,r=Math.min(this._action_max_length+2,this._max_help_position),n=Math.max(this._width-r,11),i=r-this._current_indent-2,o=this._format_action_invocation(t);if(t.help)if(o.length<=i){let t=[this._current_indent,"",i,o];o=m("%*s%-*s ",...t),e=0}else{let t=[this._current_indent,"",o];o=m("%*s%s\n",...t),e=r}else{let t=[this._current_indent,"",o];o=m("%*s%s\n",...t)}let s=[o];if(t.help){let i=this._expand_help(t),o=this._split_lines(i,n);s.push(m("%*s%s\n",e,"",o[0]));for(let t of o.slice(1))s.push(m("%*s%s\n",r,"",t))}else o.endsWith("\n")||s.push("\n");for(let e of this._iter_indented_subactions(t))s.push(this._format_action(e));return this._join_parts(s)}_format_action_invocation(t){if(t.option_strings.length){let e=[];if(0===t.nargs)e=e.concat(t.option_strings);else{let r=this._get_default_metavar_for_optional(t),n=this._format_args(t,r);for(let r of t.option_strings)e.push(m("%s %s",r,n))}return e.join(", ")}{let e=this._get_default_metavar_for_positional(t);return this._metavar_formatter(t,e)(1)[0]}}_metavar_formatter(t,e){let r;if(void 0!==t.metavar)r=t.metavar;else if(void 0!==t.choices){let e=C(t.choices).map(String);r=m("{%s}",e.join(","))}else r=e;return function(t){return Array.isArray(r)?r:Array(t).fill(r)}}_format_args(t,e){let r,n=this._metavar_formatter(t,e);if(void 0===t.nargs)r=m("%s",...n(1));else if(t.nargs===s)r=m("[%s]",...n(1));else if(t.nargs===a){let t=n(1);r=2===t.length?m("[%s [%s ...]]",...t):m("[%s ...]",...t)}else if(t.nargs===u)r=m("%s [%s ...]",...n(2));else if(t.nargs===f)r="...";else if(t.nargs===l)r=m("%s ...",...n(1));else if(t.nargs===o)r="";else{let e;try{e=L(t.nargs).map((()=>"%s"))}catch(t){throw new TypeError("invalid nargs value")}r=m(e.join(" "),...n(t.nargs))}return r}_expand_help(t){let e=Object.assign({prog:this._prog},t);for(let t of Object.keys(e))e[t]===o&&delete e[t];for(let t of Object.keys(e))e[t]&&e[t].name&&(e[t]=e[t].name);if(void 0!==e.choices){let t=C(e.choices).map(String).join(", ");e.choices=t}for(let t of Object.keys(e)){let r=P(t);r!==t&&(e[r]=e[t])}return m(this._get_help_string(t),e)}*_iter_indented_subactions(t){"function"==typeof t._get_subactions&&(this._indent(),yield*t._get_subactions(),this._dedent())}_split_lines(t,e){return t=t.replace(this._whitespace_matcher," ").trim(),h().wrap(t,{width:e})}_fill_text(t,e,r){return t=t.replace(this._whitespace_matcher," ").trim(),h().fill(t,{width:e,initial_indent:r,subsequent_indent:r})}_get_help_string(t){return t.help}_get_default_metavar_for_optional(t){return t.dest.toUpperCase()}_get_default_metavar_for_positional(t){return t.dest}}));V.prototype._Section=D(class{constructor(t,e,r=void 0){this.formatter=t,this.parent=e,this.heading=r,this.items=[]}format_help(){void 0!==this.parent&&this.formatter._indent();let t,e=this.formatter._join_parts(this.items.map((([t,e])=>t.apply(null,e))));if(void 0!==this.parent&&this.formatter._dedent(),!e)return"";if(this.heading!==o&&void 0!==this.heading){let e=this.formatter._current_indent;t=m("%*s%s:\n",e,"",this.heading)}else t="";return this.formatter._join_parts(["\n",t,e,"\n"])}});const z=B(D(class extends V{_fill_text(t,e,r){return S(t,!0).map((t=>r+t)).join("")}})),W=B(D(class extends z{_split_lines(t){return S(t)}})),K=B(D(class extends V{_get_help_string(t){let e=t.help;if(!t.help.includes("%(default)")&&!t.help.includes("%(defaultValue)")&&t.default!==o){let r=[s,a];(t.option_strings.length||r.includes(t.nargs))&&(e+=" (default: %(default)s)")}return e}})),Y=B(D(class extends V{_get_default_metavar_for_optional(t){return"function"==typeof t.type?t.type.name:t.type}_get_default_metavar_for_positional(t){return"function"==typeof t.type?t.type.name:t.type}}));function X(t){return void 0===t?void 0:t.option_strings.length?t.option_strings.join("/"):[void 0,o].includes(t.metavar)?[void 0,o].includes(t.dest)?void 0:t.dest:t.metavar}const Z=D(class extends Error{constructor(t,e){super(),this.name="ArgumentError",this._argument_name=X(t),this._message=e,this.message=this.str()}str(){let t;return t=void 0===this._argument_name?"%(message)s":"argument %(argument_name)s: %(message)s",m(t,{message:this._message,argument_name:this._argument_name})}}),q=D(class extends Error{constructor(t){super(t),this.name="ArgumentTypeError"}}),$=B(D(class extends(F(Function)){constructor(){let[t,e,r,n,i,o,s,a,u,l]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),this.option_strings=t,this.dest=e,this.nargs=r,this.const=n,this.default=i,this.type=o,this.choices=s,this.required=a,this.help=u,this.metavar=l}_get_kwargs(){return["option_strings","dest","nargs","const","default","type","choices","help","metavar"].map((t=>[t,b(this,t)]))}format_usage(){return this.option_strings[0]}call(){throw new Error(".call() not defined")}})),Q=B(D(class extends ${constructor(){let[t,e,r,n,i,o,s,a]=U(arguments,{option_strings:G,dest:G,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0}),u=[];for(let e of t)u.push(e),e.startsWith("--")&&(e="--no-"+e.slice(2),u.push(e));void 0!==s&&void 0!==r&&(s+=` (default: ${r})`),super({option_strings:u,dest:e,nargs:0,default:r,type:n,choices:i,required:o,help:s,metavar:a})}call(t,e,r,n=void 0){this.option_strings.includes(n)&&T(e,this.dest,!n.startsWith("--no-"))}format_usage(){return this.option_strings.join(" | ")}})),J=D(class extends ${constructor(){let[t,e,r,n,i,o,a,u,l,c]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate");if(void 0!==n&&r!==s)throw new TypeError(m("nargs must be %r to supply const",s));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:o,choices:a,required:u,help:l,metavar:c})}call(t,e,r){T(e,this.dest,r)}}),tt=D(class extends ${constructor(){let[t,e,r,n,i,o]=U(arguments,{option_strings:G,dest:G,const:G,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:o})}call(t,e){T(e,this.dest,this.const)}}),et=D(class extends tt{constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:!1,required:!1,help:void 0});super({option_strings:t,dest:e,const:!0,default:r,required:n,help:i})}}),rt=D(class extends tt{constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:!0,required:!1,help:void 0});super({option_strings:t,dest:e,const:!1,default:r,required:n,help:i})}}),nt=D(class extends ${constructor(){let[t,e,r,n,i,o,a,u,l,c]=U(arguments,{option_strings:G,dest:G,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriate");if(void 0!==n&&r!==s)throw new TypeError(m("nargs must be %r to supply const",s));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:o,choices:a,required:u,help:l,metavar:c})}call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n.push(r),T(e,this.dest,n)}}),it=D(class extends ${constructor(){let[t,e,r,n,i,o,s]=U(arguments,{option_strings:G,dest:G,const:G,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:o,metavar:s})}call(t,e){let r=b(e,this.dest,void 0);r=j(r),r.push(this.const),T(e,this.dest,r)}}),ot=D(class extends ${constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,dest:G,default:void 0,required:!1,help:void 0});super({option_strings:t,dest:e,nargs:0,default:r,required:n,help:i})}call(t,e){let r=b(e,this.dest,void 0);void 0===r&&(r=0),T(e,this.dest,r+1)}}),st=D(class extends ${constructor(){let[t,e,r,n]=U(arguments,{option_strings:G,dest:o,default:o,help:void 0});super({option_strings:t,dest:e,default:r,nargs:0,help:n})}call(t){t.print_help(),t.exit()}}),at=D(class extends ${constructor(){let[t,e,r,n,i]=U(arguments,{option_strings:G,version:void 0,dest:o,default:o,help:"show program's version number and exit"});super({option_strings:t,dest:r,default:n,nargs:0,help:i}),this.version=e}call(t){let e=this.version;void 0===e&&(e=t.version);let r=t._get_formatter();r.add_text(e),t._print_message(r.format_help(),process.stdout),t.exit()}}),ut=B(D(class extends ${constructor(){let[t,e,r,n,i,s,a]=U(arguments,{option_strings:G,prog:G,parser_class:G,dest:o,required:!1,help:void 0,metavar:void 0}),u={};super({option_strings:t,dest:n,nargs:l,choices:u,required:i,help:s,metavar:a}),this._prog_prefix=e,this._parser_class=r,this._name_parser_map=u,this._choices_actions=[]}add_parser(){let[t,e]=U(arguments,{name:G,"**kwargs":G});void 0===e.prog&&(e.prog=m("%s %s",this._prog_prefix,t));let r=b(e,"aliases",[]);if(delete e.aliases,"help"in e){let n=e.help;delete e.help;let i=this._ChoicesPseudoAction(t,r,n);this._choices_actions.push(i)}let n=new this._parser_class(e);this._name_parser_map[t]=n;for(let t of r)this._name_parser_map[t]=n;return n}_get_subactions(){return this._choices_actions}call(t,e,r){let n,i=r[0],s=r.slice(1);if(this.dest!==o&&T(e,this.dest,i),!A(this._name_parser_map,i)){let t={parser_name:i,choices:this._name_parser_map.join(", ")},e=m("unknown parser %(parser_name)r (choices: %(choices)s)",t);throw new Z(this,e)}t=this._name_parser_map[i],[n,s]=t.parse_known_args(s,void 0);for(let[t,r]of Object.entries(n))T(e,t,r);s.length&&(R(e,_,[]),b(e,_).push(...s))}}));ut.prototype._ChoicesPseudoAction=D(class extends ${constructor(t,e,r){let n=t,i=t;e.length&&(n+=m(" (%s)",e.join(", "))),super({option_strings:[],dest:i,help:r,metavar:n})}});const lt=D(class extends nt{call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n=n.concat(r),T(e,this.dest,n)}}),ct=D(class extends Function{constructor(){let[t,e,r,n,i,o,s,a,u]=U(arguments,{flags:"r",encoding:void 0,mode:void 0,autoClose:void 0,emitClose:void 0,start:void 0,end:void 0,highWaterMark:void 0,fs:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),Object.defineProperty(this,"name",{get:()=>m("FileType(%r)",t)}),this._flags=t,this._options={},void 0!==e&&(this._options.encoding=e),void 0!==r&&(this._options.mode=r),void 0!==n&&(this._options.autoClose=n),void 0!==i&&(this._options.emitClose=i),void 0!==o&&(this._options.start=o),void 0!==s&&(this._options.end=s),void 0!==a&&(this._options.highWaterMark=a),void 0!==u&&(this._options.fs=u)}call(t){if("-"===t){if(this._flags.includes("r"))return process.stdin;if(this._flags.includes("w"))return process.stdout;{let t=m('argument "-" with mode %r',this._flags);throw new TypeError(t)}}let e;try{e=d.openSync(t,this._flags,this._options.mode)}catch(e){let r={filename:t,error:e.message};throw new q(m("can't open '%(filename)s': %(error)s",r))}let r=Object.assign({fd:e,flags:this._flags},this._options);if(this._flags.includes("r"))return d.createReadStream(void 0,r);if(this._flags.includes("w"))return d.createWriteStream(void 0,r);{let e=m('argument "%s" with mode %r',t,this._flags);throw new TypeError(e)}}[g.inspect.custom](){let t=[this._flags],e=Object.entries(this._options).map((([t,e])=>("mode"===t&&(e={value:e,[g.inspect.custom](){return"0o"+this.value.toString(8)}}),[t,e]))),r=[].concat(t.filter((t=>-1!==t)).map(v)).concat(e.filter((([,t])=>void 0!==t)).map((([t,e])=>m("%s=%r",t,e)))).join(", ");return m("%s(%s)",this.constructor.name,r)}toString(){return this[g.inspect.custom]()}}),ht=D(class extends(F()){constructor(t={}){super(),Object.assign(this,t)}});ht.prototype[Symbol.toStringTag]=void 0;const ft=B(D(class{constructor(){let[t,e,r,n]=U(arguments,{description:G,prefix_chars:G,argument_default:G,conflict_handler:G});this.description=t,this.argument_default=r,this.prefix_chars=e,this.conflict_handler=n,this._registries={},this.register("action",void 0,J),this.register("action","store",J),this.register("action","store_const",tt),this.register("action","store_true",et),this.register("action","store_false",rt),this.register("action","append",nt),this.register("action","append_const",it),this.register("action","count",ot),this.register("action","help",st),this.register("action","version",at),this.register("action","parsers",ut),this.register("action","extend",lt),["storeConst","storeTrue","storeFalse","appendConst"].forEach((t=>{let e=x(t);this.register("action",t,g.deprecate(this._registry_get("action",e),m('{action: "%s"} is renamed to {action: "%s"}',t,e)))})),this._get_handler(),this._actions=[],this._option_string_actions={},this._action_groups=[],this._mutually_exclusive_groups=[],this._defaults={},this._negative_number_matcher=/^-\d+$|^-\d*\.\d+$/,this._has_negative_number_optionals=[]}register(t,e,r){R(this._registries,t,{})[e]=r}_registry_get(t,e,r=void 0){return b(this._registries[t],e,r)}set_defaults(t){Object.assign(this._defaults,t);for(let e of this._actions)e.dest in t&&(e.default=t[e.dest])}get_default(t){for(let e of this._actions)if(e.dest===t&&void 0!==e.default)return e.default;return this._defaults[t]}add_argument(){let[t,e]=U(arguments,{"*args":G,"**kwargs":G});1===t.length&&Array.isArray(t[0])&&(t=t[0],H("argument-array",m("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })",{args:t.map(v).join(", ")})));let r=this.prefix_chars;if(!t.length||1===t.length&&!r.includes(t[0][0])){if(t.length&&"dest"in e)throw new TypeError("dest supplied twice for positional argument");e=this._get_positional_kwargs(...t,e)}else e=this._get_optional_kwargs(...t,e);if(!("default"in e)){let t=e.dest;t in this._defaults?e.default=this._defaults[t]:void 0!==this.argument_default&&(e.default=this.argument_default)}let n=this._pop_action_class(e);if("function"!=typeof n)throw new TypeError(m('unknown action "%s"',n));let i=new n(e),o=this._registry_get("type",i.type,i.type);if("function"!=typeof o)throw new TypeError(m("%r is not callable",o));if(o===ct)throw new TypeError(m("%r is a FileType class object, instance of it must be passed",o));if("_get_formatter"in this)try{this._get_formatter()._format_args(i,void 0)}catch(t){throw t instanceof TypeError&&"invalid nargs value"!==t.message?new TypeError("length of metavar tuple does not match nargs"):t}return this._add_action(i)}add_argument_group(){let t=_t(this,...arguments);return this._action_groups.push(t),t}add_mutually_exclusive_group(){let t=pt(this,...arguments);return this._mutually_exclusive_groups.push(t),t}_add_action(t){this._check_conflict(t),this._actions.push(t),t.container=this;for(let e of t.option_strings)this._option_string_actions[e]=t;for(let e of t.option_strings)this._negative_number_matcher.test(e)&&(this._has_negative_number_optionals.length||this._has_negative_number_optionals.push(!0));return t}_remove_action(t){w(this._actions,t)}_add_container_actions(t){let e={};for(let t of this._action_groups){if(t.title in e){throw new TypeError(m("cannot merge actions - two groups are named %r",t.title))}e[t.title]=t}let r=new Map;for(let n of t._action_groups){n.title in e||(e[n.title]=this.add_argument_group({title:n.title,description:n.description,conflict_handler:n.conflict_handler}));for(let t of n._group_actions)r.set(t,e[n.title])}for(let e of t._mutually_exclusive_groups){let t=this.add_mutually_exclusive_group({required:e.required});for(let n of e._group_actions)r.set(n,t)}for(let e of t._actions)r.get(e)._add_action(e)}_get_positional_kwargs(){let[t,e]=U(arguments,{dest:G,"**kwargs":G});if("required"in e){throw new TypeError("'required' is an invalid argument for positionals")}return[s,a].includes(e.nargs)||(e.required=!0),e.nargs!==a||"default"in e||(e.required=!0),Object.assign(e,{dest:t,option_strings:[]})}_get_optional_kwargs(){let t,[e,r]=U(arguments,{"*args":G,"**kwargs":G}),n=[],i=[];for(t of e){if(!this.prefix_chars.includes(t[0])){let e={option:t,prefix_chars:this.prefix_chars};throw new TypeError(m("invalid option string %(option)r: must start with a character %(prefix_chars)r",e))}n.push(t),t.length>1&&this.prefix_chars.includes(t[1])&&i.push(t)}let o=r.dest;if(delete r.dest,void 0===o){let e;if(e=i.length?i[0]:n[0],o=function(t,e){let r=0;for(;rt)).join(", ");throw new Z(t,m(r,n))}_handle_conflict_resolve(t,e){for(let[t,r]of e)w(r.option_strings,t),delete this._option_string_actions[t],r.option_strings.length||r.container._remove_action(r)}})),_t=D(class extends ft{constructor(){let[t,e,r,n]=U(arguments,{container:G,title:void 0,description:void 0,"**kwargs":G});R(n,"conflict_handler",t.conflict_handler),R(n,"prefix_chars",t.prefix_chars),R(n,"argument_default",t.argument_default),super(Object.assign({description:r},n)),this.title=e,this._group_actions=[],this._registries=t._registries,this._actions=t._actions,this._option_string_actions=t._option_string_actions,this._defaults=t._defaults,this._has_negative_number_optionals=t._has_negative_number_optionals,this._mutually_exclusive_groups=t._mutually_exclusive_groups}_add_action(t){return t=super._add_action(t),this._group_actions.push(t),t}_remove_action(t){super._remove_action(t),w(this._group_actions,t)}}),pt=D(class extends _t{constructor(){let[t,e]=U(arguments,{container:G,required:!1});super(t),this.required=e,this._container=t}_add_action(t){if(t.required){throw new TypeError("mutually exclusive arguments must be optional")}return t=this._container._add_action(t),this._group_actions.push(t),t}_remove_action(t){this._container._remove_action(t),w(this._group_actions,t)}}),gt=B(D(class extends(F(ft)){constructor(){let[t,e,r,n,i,s,a,u,l,c,h,f,_,p,d]=U(arguments,{prog:void 0,usage:void 0,description:void 0,epilog:void 0,parents:[],formatter_class:V,prefix_chars:"-",fromfile_prefix_chars:void 0,argument_default:void 0,conflict_handler:"error",add_help:!0,allow_abbrev:!0,exit_on_error:!0,debug:void 0,version:void 0});function v(t){return t}void 0!==p&&H("debug",'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'),void 0!==d&&H("version","The \"version\" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead."),super({description:r,prefix_chars:a,argument_default:l,conflict_handler:c}),void 0===t&&(t=E.basename(y()[0]||"")),this.prog=t,this.usage=e,this.epilog=n,this.formatter_class=s,this.fromfile_prefix_chars=u,this.add_help=h,this.allow_abbrev=f,this.exit_on_error=_,this.debug=p,this._positionals=this.add_argument_group("positional arguments"),this._optionals=this.add_argument_group("optional arguments"),this._subparsers=void 0,this.register("type",void 0,v),this.register("type",null,v),this.register("type","auto",v),this.register("type","int",(function(t){let e=Number(t);if(!Number.isInteger(e))throw new TypeError(m("could not convert string to int: %r",t));return e})),this.register("type","float",(function(t){let e=Number(t);if(isNaN(e))throw new TypeError(m("could not convert string to float: %r",t));return e})),this.register("type","str",String),this.register("type","string",g.deprecate(String,'use {type:"str"} or {type:String} instead of {type:"string"}'));let A=a.includes("-")?"-":a[0];this.add_help&&this.add_argument(A+"h",A.repeat(2)+"help",{action:"help",default:o,help:"show this help message and exit"}),d&&this.add_argument(A+"v",A.repeat(2)+"version",{action:"version",default:o,version:this.version,help:"show program's version number and exit"});for(let t of i)this._add_container_actions(t),Object.assign(this._defaults,t._defaults)}_get_kwargs(){return["prog","usage","description","formatter_class","conflict_handler","add_help"].map((t=>[t,b(this,t)]))}add_subparsers(){let[t]=U(arguments,{"**kwargs":G});if(void 0!==this._subparsers&&this.error("cannot have multiple subparser arguments"),R(t,"parser_class",this.constructor),"title"in t||"description"in t){let e=b(t,"title","subcommands"),r=b(t,"description",void 0);delete t.title,delete t.description,this._subparsers=this.add_argument_group(e,r)}else this._subparsers=this._positionals;if(void 0===t.prog){let e=this._get_formatter(),r=this._get_positional_actions(),n=this._mutually_exclusive_groups;e.add_usage(this.usage,r,n,""),t.prog=e.format_help().trim()}let e=new(this._pop_action_class(t,"parsers"))(Object.assign({option_strings:[]},t));return this._subparsers._add_action(e),e}_add_action(t){return t.option_strings.length?this._optionals._add_action(t):this._positionals._add_action(t),t}_get_optional_actions(){return this._actions.filter((t=>t.option_strings.length))}_get_positional_actions(){return this._actions.filter((t=>!t.option_strings.length))}parse_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_args(t,e),r&&r.length>0){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_args(t=void 0,e=void 0){void 0===t&&(t=y().slice(1)),void 0===e&&(e=new ht);for(let t of this._actions)t.dest!==o&&(A(e,t.dest)||t.default!==o&&T(e,t.dest,t.default));for(let t of Object.keys(this._defaults))A(e,t)||T(e,t,this._defaults[t]);if(this.exit_on_error)try{[e,t]=this._parse_known_args(t,e)}catch(t){if(!(t instanceof Z))throw t;this.error(t.message)}else[e,t]=this._parse_known_args(t,e);return A(e,_)&&(t=t.concat(b(e,_)),I(e,_)),[e,t]}_parse_known_args(t,e){void 0!==this.fromfile_prefix_chars&&(t=this._read_args_from_files(t));let r=new Map;for(let t of this._mutually_exclusive_groups){let e=t._group_actions;for(let[n,i]of Object.entries(t._group_actions)){let t=r.get(i)||[];t=t.concat(e.slice(0,+n)),t=t.concat(e.slice(+n+1)),r.set(i,t)}}let n={},i=[],s=Object.entries(t)[Symbol.iterator]();for(let[t,e]of s)if("--"===e)for([t,e]of(i.push("-"),s))i.push("A");else{let r,o=this._parse_optional(e);void 0===o?r="A":(n[t]=o,r="O"),i.push(r)}let a,u=i.join(""),l=new Set,c=new Set,h=(t,n,i=void 0)=>{l.add(t);let s=this._get_values(t,n);if(s!==t.default){c.add(t);for(let e of r.get(t)||[])if(c.has(e)){let r="not allowed with argument %s",n=X(e);throw new Z(t,m(r,n))}}s!==o&&t(this,e,s,i)},f=e=>{let r,i=n[e],[o,s,l]=i,c=[];for(;;){if(void 0===o)return a.push(t[e]),e+1;if(void 0===l){let n=e+1,i=u.slice(n);r=n+this._match_argument(o,i);let a=t.slice(n,r);c.push([o,a,s]);break}{let t=this._match_argument(o,"A"),n=this.prefix_chars;if(0!==t||n.includes(s[1])){if(1===t){r=e+1;let t=[l];c.push([o,t,s]);break}throw new Z(o,m("ignored explicit argument %r",l))}{c.push([o,[],s]),s=s[0]+l[0];let t=l.slice(1)||void 0,e=this._option_string_actions;if(!A(e,s)){throw new Z(o,m("ignored explicit argument %r",l))}o=e[s],l=t}}}p(c.length);for(let[t,e,r]of c)h(t,e,r);return r},_=this._get_positional_actions(),g=e=>{let r=u.slice(e),n=this._match_arguments_partial(_,r);for(let r=0;r<_.length&&rt>=d)));if(d!==e){let t=g(d);if(t>d){d=t;continue}d=t}if(!(d in n)){let r=t.slice(d,e);a=a.concat(r),d=e}d=f(d)}let v=g(d);a=a.concat(t.slice(v));let y=[];for(let t of this._actions)l.has(t)||(t.required?y.push(X(t)):void 0!==t.default&&"string"==typeof t.default&&A(e,t.dest)&&t.default===b(e,t.dest)&&T(e,t.dest,this._get_value(t,t.default)));y.length&&this.error(m("the following arguments are required: %s",y.join(", ")));for(let t of this._mutually_exclusive_groups)if(t.required){let e=!0;for(let r of t._group_actions)if(c.has(r)){e=!1;break}if(e){let e=t._group_actions.filter((t=>t.help!==o)).map((t=>X(t))),r="one of the arguments %s is required";this.error(m(r,e.join(" ")))}}return[e,a]}_read_args_from_files(t){let e=[];for(let r of t)if(r&&this.fromfile_prefix_chars.includes(r[0]))try{let t=d.readFileSync(r.slice(1),"utf8"),n=[];for(let e of S(t))for(let t of this.convert_arg_line_to_args(e))n.push(t);n=this._read_args_from_files(n),e=e.concat(n)}catch(t){this.error(t.message)}else e.push(r);return e}convert_arg_line_to_args(t){return[t]}_match_argument(t,e){let r=this._get_nargs_pattern(t),n=e.match(new RegExp("^"+r));if(null===n){let e={undefined:"expected one argument",[s]:"expected at most one argument",[u]:"expected at least one argument"}[t.nargs];throw void 0===e&&(e=m(1===t.nargs?"expected %s argument":"expected %s arguments",t.nargs)),new Z(t,e)}return n[1].length}_match_arguments_partial(t,e){let r=[];for(let n of L(t.length,0,-1)){let i=t.slice(0,n).map((t=>this._get_nargs_pattern(t))).join(""),o=e.match(new RegExp("^"+i));if(null!==o){r=r.concat(o.slice(1).map((t=>t.length)));break}}return r}_parse_optional(t){if(!t)return;if(!this.prefix_chars.includes(t[0]))return;if(t in this._option_string_actions){return[this._option_string_actions[t],t,void 0]}if(1===t.length)return;if(t.includes("=")){let[e,r]=O(t,"=",1);if(e in this._option_string_actions){return[this._option_string_actions[e],e,r]}}let e=this._get_option_tuples(t);if(e.length>1){let r={option:t,matches:e.map((([,t])=>t)).join(", ")},n="ambiguous option: %(option)s could match %(matches)s";this.error(m(n,r))}else if(1===e.length){let[t]=e;return t}return this._negative_number_matcher.test(t)&&!this._has_negative_number_optionals.length||t.includes(" ")?void 0:[void 0,t,void 0]}_get_option_tuples(t){let e=[],r=this.prefix_chars;if(r.includes(t[0])&&r.includes(t[1])){if(this.allow_abbrev){let r,n;t.includes("=")?[r,n]=O(t,"=",1):(r=t,n=void 0);for(let t of Object.keys(this._option_string_actions))if(t.startsWith(r)){let r=[this._option_string_actions[t],t,n];e.push(r)}}}else if(r.includes(t[0])&&!r.includes(t[1])){let r,n=t,i=t.slice(0,2),o=t.slice(2);for(let t of Object.keys(this._option_string_actions))if(t===i){let r=[this._option_string_actions[t],t,o];e.push(r)}else if(t.startsWith(n)){let n=[this._option_string_actions[t],t,r];e.push(n)}}else this.error(m("unexpected option string: %s",t));return e}_get_nargs_pattern(t){let e,r=t.nargs;return e=void 0===r?"(-*A-*)":r===s?"(-*A?-*)":r===a?"(-*[A-]*)":r===u?"(-*A[A-]*)":r===f?"([-AO]*)":r===l?"(-*A[-AO]*)":r===o?"(-*-*)":m("(-*%s-*)","A".repeat(r).split("").join("-*")),t.option_strings.length&&(e=e.replace(/-\*/g,""),e=e.replace(/-/g,"")),e}parse_intermixed_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_intermixed_args(t,e),r.length){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_intermixed_args(t=void 0,e=void 0){let r,n,i=this._get_positional_actions(),s=i.filter((t=>[l,f].includes(t.nargs)));if(s.length)throw new TypeError(m("parse_intermixed_args: positional arg with nargs=%s",s[0].nargs));for(let t of this._mutually_exclusive_groups)for(let e of t._group_actions)if(i.includes(e))throw new TypeError("parse_intermixed_args: positional in mutuallyExclusiveGroup");try{let s;n=this.usage;try{void 0===this.usage&&(this.usage=this.format_usage().slice(7));for(let t of i)t.save_nargs=t.nargs,t.nargs=o,t.save_default=t.default,t.default=o;[e,s]=this.parse_known_args(t,e);for(let t of i){let r=b(e,t.dest);Array.isArray(r)&&0===r.length&&(console.warn(m("Do not expect %s in %s",t.dest,e)),I(e,t.dest))}}finally{for(let t of i)t.nargs=t.save_nargs,t.default=t.save_default}let a=this._get_optional_actions();try{for(let t of a)t.save_required=t.required,t.required=!1;for(let t of this._mutually_exclusive_groups)t.save_required=t.required,t.required=!1;[e,r]=this.parse_known_args(s,e)}finally{for(let t of a)t.required=t.save_required;for(let t of this._mutually_exclusive_groups)t.required=t.save_required}}finally{this.usage=n}return[e,r]}_get_values(t,e){if(![l,f].includes(t.nargs))try{w(e,"--")}catch(t){}let r;if(e.length||t.nargs!==s)if(e.length||t.nargs!==a||t.option_strings.length)if(1===e.length&&[void 0,s].includes(t.nargs)){let n=e[0];r=this._get_value(t,n),this._check_value(t,r)}else if(t.nargs===f)r=e.map((e=>this._get_value(t,e)));else if(t.nargs===l)r=e.map((e=>this._get_value(t,e))),this._check_value(t,r[0]);else if(t.nargs===o)r=o;else{r=e.map((e=>this._get_value(t,e)));for(let e of r)this._check_value(t,e)}else r=void 0!==t.default?t.default:e,this._check_value(t,r);else r=t.option_strings.length?t.const:t.default,"string"==typeof r&&(r=this._get_value(t,r),this._check_value(t,r));return r}_get_value(t,e){let r,n=this._registry_get("type",t.type,t.type);if("function"!=typeof n){throw new Z(t,m("%r is not callable",n))}try{try{r=n(e)}catch(t){if(!(t instanceof TypeError&&/Class constructor .* cannot be invoked without 'new'/.test(t.message)))throw t;r=new n(e)}}catch(r){if(r instanceof q){let e=r.message;throw new Z(t,e)}if(r instanceof TypeError){let r=b(t.type,"name",v(t.type));throw new Z(t,m("invalid %(type)s value: %(value)r",{type:r,value:e}))}throw r}return r}_check_value(t,e){if(void 0!==t.choices&&!C(t.choices).includes(e)){let r={value:e,choices:C(t.choices).map(v).join(", ")};throw new Z(t,m("invalid choice: %(value)r (choose from %(choices)s)",r))}}format_usage(){let t=this._get_formatter();return t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.format_help()}format_help(){let t=this._get_formatter();t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.add_text(this.description);for(let e of this._action_groups)t.start_section(e.title),t.add_text(e.description),t.add_arguments(e._group_actions),t.end_section();return t.add_text(this.epilog),t.format_help()}_get_formatter(){return new this.formatter_class({prog:this.prog})}print_usage(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_usage(),t)}print_help(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_help(),t)}_print_message(t,e=void 0){t&&(void 0===e&&(e=process.stderr),e.write(t))}exit(t=0,e=void 0){e&&this._print_message(e,process.stderr),process.exit(t)}error(t){if(!0===this.debug)throw new Error(t);this.print_usage(process.stderr);let e={prog:this.prog,message:t};this.exit(2,m("%(prog)s: error: %(message)s\n",e))}}));e.exports={ArgumentParser:gt,ArgumentError:Z,ArgumentTypeError:q,BooleanOptionalAction:Q,FileType:ct,HelpFormatter:V,ArgumentDefaultsHelpFormatter:K,RawDescriptionHelpFormatter:z,RawTextHelpFormatter:W,MetavarTypeHelpFormatter:Y,Namespace:ht,Action:$,ONE_OR_MORE:u,OPTIONAL:s,PARSER:l,REMAINDER:f,SUPPRESS:o,ZERO_OR_MORE:a},Object.defineProperty(e.exports,"Const",{get(){let t={};return Object.entries({ONE_OR_MORE:u,OPTIONAL:s,PARSER:l,REMAINDER:f,SUPPRESS:o,ZERO_OR_MORE:a}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(H(e,m("use argparse.%s instead of argparse.Const.%s",e,e)),r)})})),Object.entries({_UNRECOGNIZED_ARGS_ATTR:_}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(H(e,m("argparse.Const.%s is an internal symbol and will no longer be available",e)),r)})})),t},enumerable:!1})}(s);var f=s.exports,_=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},_(t,e)};function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var g,d,m,E=function(){return E=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(G,(function(t,r,n,i,o,s){if(r)e.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(U.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(P.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(P,(function(t,r,n,i,o,s){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var o=i.options[0];"w"===o?e=E(E({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=E(E({},e),k(o)))}else if(x.test(i.stem))e=E(E({},e),k(i.stem));else{var s=H(i.stem);s&&(e=E(E({},e),s));var a=F(i.stem);a&&(e=E(E({},e),a))}}return e}var z,W={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function K(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(W[r||""]||W[n||""]||W["".concat(n,"-001")]||W["001"])[0]}var Y=new RegExp("^".concat(C.source,"*")),X=new RegExp("".concat(C.source,"*$"));function Z(t,e){return{start:t,end:e}}var q=!!String.prototype.startsWith,$=!!String.fromCodePoint,Q=!!Object.fromEntries,J=!!String.prototype.codePointAt,tt=!!String.prototype.trimStart,et=!!String.prototype.trimEnd,rt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},nt=!0;try{nt="a"===(null===(z=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===z?void 0:z[0])}catch(t){nt=!1}var it,ot=q?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},st=$?String.fromCodePoint:function(){for(var t=[],e=0;eo;){if((r=t[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},at=Q?Object.fromEntries:function(t){for(var e={},r=0,n=t;r=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},lt=tt?function(t){return t.trimStart()}:function(t){return t.replace(Y,"")},ct=et?function(t){return t.trimEnd()}:function(t){return t.replace(X,"")};function ht(t,e){return new RegExp(t,e)}if(nt){var ft=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");it=function(t,e){var r;return ft.lastIndex=e,null!==(r=ft.exec(t)[1])&&void 0!==r?r:""}}else it=function(t,e){for(var r=[];;){var n=ut(t,e);if(void 0===n||gt(n)||dt(n))break;r.push(n),e+=n>=65536?2:1}return st.apply(void 0,r)};var _t=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(t,r)).err)return o;n.push(o.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(g.UNMATCHED_CLOSING_TAG,Z(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&pt(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:d.pound,location:Z(s,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:d.literal,value:"<".concat(n,"/>"),location:Z(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:d.tag,value:n,children:o,location:Z(r,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,Z(s,this.clonePosition())))}return this.error(g.UNCLOSED_TAG,Z(r,this.clonePosition()))}return this.error(g.INVALID_TAG,Z(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var o=this.tryParseUnquoted(t,e);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Z(r,this.clonePosition());return{val:{type:d.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(pt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return st.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),st(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(g.EMPTY_ARGUMENT,Z(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:d.argument,value:n,location:Z(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=it(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Z(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,Z(o,a));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(_=ct(A.val)).length)return this.error(g.EXPECT_ARGUMENT_STYLE,Z(this.clonePosition(),this.clonePosition()));u={style:_,styleLocation:Z(l,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var c=Z(n,this.clonePosition());if(u&&ot(null==u?void 0:u.style,"::",0)){var h=lt(u.style.slice(2));if("number"===s)return(A=this.parseNumberSkeletonFromString(h,u.styleLocation)).err?A:{val:{type:d.number,value:r,location:c,style:A.val},err:null};if(0===h.length)return this.error(g.EXPECT_DATE_TIME_SKELETON,c);var f=h;this.locale&&(f=function(t,e){for(var r="",n=0;n>1),u=K(e);for("H"!=u&&"k"!=u||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=u+r}else r+="J"===i?"H":i}return r}(h,this.locale));var _={type:m.dateTime,pattern:f,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?M(f):{}};return{val:{type:"date"===s?d.date:d.time,value:r,location:c,style:_},err:null}}return{val:{type:"number"===s?d.number:"date"===s?d.date:d.time,value:r,location:c,style:null!==(i=null==u?void 0:u.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,Z(p,E({},p)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),y=0;if("select"!==s&&"offset"===v.value){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Z(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),v=this.parseIdentifierIfPossible(),y=A.val}var b,T=this.tryParsePluralOrSelectOptions(t,s,e,v);if(T.err)return T;if((b=this.tryParseArgumentClose(n)).err)return b;var R=Z(n,this.clonePosition());return"select"===s?{val:{type:d.select,value:r,options:at(T.val),location:R},err:null}:{val:{type:d.plural,value:r,options:at(T.val),offset:y,pluralType:"plural"===s?"cardinal":"ordinal",location:R},err:null};default:return this.error(g.INVALID_ARGUMENT_TYPE,Z(o,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Z(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(B).filter((function(t){return t.length>0}));r=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=Z(n,this.clonePosition());return i?rt(o*=r)?{val:o,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=ut(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(ot(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&>(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function pt(t){return t>=97&&t<=122||t>=65&&t<=90}function gt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function dt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function mt(t){t.forEach((function(t){if(delete t.location,I(t)||L(t))for(var e in t.options)delete t.options[e].location,mt(t.options[e].value);else b(t)&&N(t.style)||(T(t)||R(t))&&w(t.style)?delete t.style.location:O(t)&&mt(t.children)}))}function Et(t,e){void 0===e&&(e={}),e=E({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new _t(t,e).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||mt(r.val),r.val}function vt(t,e){var r=e&&e.cache?e.cache:St,n=e&&e.serializer?e.serializer:Rt;return(e&&e.strategy?e.strategy:Tt)(t,{cache:r,serializer:n})}function yt(t,e,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=e.get(o);return void 0===s&&(s=t.call(this,n),e.set(o,s)),s}function At(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=e.get(i);return void 0===o&&(o=t.apply(this,n),e.set(i,o)),o}function bt(t,e,r,n,i){return r.bind(e,t,n,i)}function Tt(t,e){return bt(t,this,1===t.length?yt:At,e.cache.create(),e.serializer)}var Rt=function(){return JSON.stringify(arguments)};function It(){this.cache=Object.create(null)}It.prototype.get=function(t){return this.cache[t]},It.prototype.set=function(t,e){this.cache[t]=e};var Lt,St={create:function(){return new It}},Ot={variadic:function(t,e){return bt(t,this,At,e.cache.create(),e.serializer)},monadic:function(t,e){return bt(t,this,yt,e.cache.create(),e.serializer)}};!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Lt||(Lt={}));var Nt,wt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return p(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Ct=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Lt.INVALID_VALUE,i)||this}return p(e,t),e}(wt),Dt=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Lt.INVALID_VALUE,n)||this}return p(e,t),e}(wt),Mt=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Lt.MISSING_VALUE,r)||this}return p(e,t),e}(wt);function Bt(t){return"function"==typeof t}function Pt(t,e,r,n,i,o,s){if(1===t.length&&y(t[0]))return[{type:Nt.literal,value:t[0].value}];for(var a=[],u=0,l=t;u0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=Et,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(Ut||(Ut={}));var Ht=function(t){function e(r,n,i){var o=this,s=i?i instanceof Error?i:new Error(String(i)):void 0;return(o=t.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,"\n").concat(s?"\n".concat(s.message,"\n").concat(s.stack):""))||this).code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o,e),o}return p(e,t),e}(Error),Ft=function(t){function e(e,r){return t.call(this,Ut.UNSUPPORTED_FORMATTER,e,r)||this}return p(e,t),e}(Ht),jt=function(t){function e(e,r){return t.call(this,Ut.INVALID_CONFIG,e,r)||this}return p(e,t),e}(Ht),Vt=function(t){function e(e,r){return t.call(this,Ut.MISSING_DATA,e,r)||this}return p(e,t),e}(Ht),zt=function(t){function e(e,r,n){var i=t.call(this,Ut.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(r,"\n"),n)||this;return i.locale=r,i}return p(e,t),e}(Ht),Wt=function(t){function e(e,r,n,i){var o=t.call(this,"".concat(e,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),r,i)||this;return o.descriptor=n,o.locale=r,o}return p(e,t),e}(zt),Kt=function(t){function e(e,r){var n=t.call(this,Ut.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(r,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return n.descriptor=e,n}return p(e,t),e}(Ht);function Yt(t,e,r){return void 0===r&&(r={}),e.reduce((function(e,n){return n in t?e[n]=t[n]:n in r&&(e[n]=r[n]),e}),{})}var Xt={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){"production"!==process.env.NODE_ENV&&console.error(t)},onWarn:function(t){"production"!==process.env.NODE_ENV&&console.warn(t)}};function Zt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}function qt(t,e,r,n){var i,o=t&&t[e];if(o&&(i=o[r]),i)return i;n(new Ft("No ".concat(e," format named: ").concat(r)))}function $t(t,e){return Object.keys(t).reduce((function(r,n){return r[n]=E({timeZone:e},t[n]),r}),{})}function Qt(t,e){return Object.keys(E(E({},t),e)).reduce((function(r,n){return r[n]=E(E({},t[n]||{}),e[n]||{}),r}),{})}function Jt(t,e){if(!e)return t;var r=kt.formats;return E(E(E({},r),t),{date:Qt($t(r.date,e),$t(t.date||{},e)),time:Qt($t(r.time,e),$t(t.time||{},e))})}var te=function(t,e,r,n,i){var o=t.locale,s=t.formats,a=t.messages,u=t.defaultLocale,l=t.defaultFormats,c=t.fallbackOnEmptyString,h=t.onError,f=t.timeZone,_=t.defaultRichTextElements;void 0===r&&(r={id:""});var p=r.id,g=r.defaultMessage;!function(t,e,r){if(void 0===r&&(r=Error),!t)throw new r(e)}(!!p,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var m=String(p),v=a&&Object.prototype.hasOwnProperty.call(a,m)&&a[m];if(Array.isArray(v)&&1===v.length&&v[0].type===d.literal)return v[0].value;if(!n&&v&&"string"==typeof v&&!_)return v.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=E(E({},_),n||{}),s=Jt(s,f),l=Jt(l,f),!v){if(!1===c&&""===v)return v;if((!g||o&&o.toLowerCase()!==u.toLowerCase())&&h(new Kt(r,o)),g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){return h(new Wt('Error formatting default message for: "'.concat(m,'", rendering default message verbatim'),o,r,t)),"string"==typeof g?g:m}return m}try{return e.getMessageFormat(v,o,s,E({formatters:e},i||{})).format(n)}catch(t){h(new Wt('Error formatting message: "'.concat(m,'", using ').concat(g?"default message":"id"," as fallback."),o,r,t))}if(g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){h(new Wt('Error formatting the default message for: "'.concat(m,'", rendering message verbatim'),o,r,t))}return"string"==typeof v?v:"string"==typeof g?g:m},ee=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function re(t,e,r,n){var i=t.locale,o=t.formats,s=t.onError,a=t.timeZone;void 0===n&&(n={});var u=n.format,l=E(E({},a&&{timeZone:a}),u&&qt(o,e,u,s)),c=Yt(n,ee,l);return"time"!==e||c.hour||c.minute||c.second||c.timeStyle||c.dateStyle||(c=E(E({},c),{hour:"numeric",minute:"numeric"})),r(i,c)}function ne(t,e){for(var r=[],n=2;n",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"}},{name:"English",locale:{APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally(Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally(Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",B_USAGE:"{used}B/{total}B",KB_USAGE:"{used, number, ::.0}KB/{total, number, ::.0}KB",BYTES:"{bytes}B",KB:"{kb, number, ::.0}KB",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error(Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function main is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error(Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable {id}",FUNCTION_NOT_FOUND:"Can't find function {id}",LABEL_NOT_FOUND:"Can't find label {id}",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id already declared",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id already declared",DUPLICATE_PARAM_ID:"PARAM's param id already declared",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"}}],Ie=new Int32Array(1);function Le(t){return Ie[0]=t,Ie[0]}function Se(t,e){return Le(t+e)}function Oe(t,e){return Le(t-e)}var Ne,we,Ce,De,Me,Be,Pe,xe,Ge;function Ue(t,e){return t<0||t+4>e.length?{value:null,status:Ne.OUT_OF_BOUND}:{value:Le(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24),status:Ne.SUCCESS}}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(Ne||(Ne={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(we||(we={})),function(t){t[t.IMM=0]="IMM",t[t.ID=1]="ID",t[t.ADDRESS_ID=2]="ADDRESS_ID",t[t.DEREF_ID=3]="DEREF_ID"}(Ce||(Ce={})),function(t){t[t.ADD=0]="ADD",t[t.SUB=1]="SUB",t[t.MUL=2]="MUL",t[t.DIV=3]="DIV"}(De||(De={})),function(t){t[t.EQ=0]="EQ",t[t.NE=1]="NE",t[t.LT=2]="LT",t[t.LE=3]="LE",t[t.GT=4]="GT",t[t.GE=5]="GE"}(Me||(Me={})),function(t){t[t.ID=0]="ID",t[t.DEREF_ID=1]="DEREF_ID"}(Be||(Be={})),function(t){t[t.SINGULAR=0]="SINGULAR",t[t.BINARY_MATH_OP=1]="BINARY_MATH_OP"}(Pe||(Pe={})),function(t){t[t.FUNCTION=0]="FUNCTION",t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.LABEL=4]="LABEL",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE",t[t.EMPTY=14]="EMPTY",t[t.COMMENT=15]="COMMENT",t[t.ERROR=16]="ERROR"}(xe||(xe={})),function(t){t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE"}(Ge||(Ge={}));const ke=new Set(["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"]);class He{patternId=new RegExp(/^(?[a-zA-Z_]\w*)$/);patternSize=new RegExp(/^(?\d+)$/);patternSingular=new RegExp(/^(#(?-?\d+))$|^(?[a-zA-Z_]\w*)$|^(\*(?[a-zA-Z_]\w*))$|^(&(?[a-zA-Z_]\w*))$/);patternLValue=new RegExp(/^((?[a-zA-Z_]\w*))$|^(\*(?[a-zA-Z_]\w*))$/);illegalInstructionFormatError={type:xe.ERROR,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"};purify(t){return t.trim().replaceAll(/[ \t]+/g," ")}splitWhiteSpace(t){return t.replaceAll("\t"," ").split(" ")}decodeComponentId(t){const e=t.match(this.patternId);return null===e||ke.has(t)?null:e.groups.id}decodeComponentSize(t){const e=t.match(this.patternSize);if(null===e)return null;const r=parseInt(e.groups.size);return Number.isSafeInteger(r)?Le(r):1/0}decodeComponentSingular(t){const e=t.match(this.patternSingular);if(null===e)return null;if(void 0!==e.groups.imm){const t=parseInt(e.groups.imm);return Number.isSafeInteger(t)?{type:Ce.IMM,imm:Le(t)}:{type:Ce.IMM,imm:1/0}}return void 0!==e.groups.id?{type:Ce.ID,id:e.groups.id}:void 0!==e.groups.derefId?{type:Ce.DEREF_ID,id:e.groups.derefId}:{type:Ce.ADDRESS_ID,id:e.groups.addressId}}decodeComponentLValue(t){const e=t.match(this.patternLValue);return null===e?null:void 0!==e.groups.id?{type:Be.ID,id:e.groups.id}:{type:Be.DEREF_ID,id:e.groups.derefId}}decodeFunction(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:xe.FUNCTION,value:{id:e}}}decodeAssign(t){if(3!==t.length&&5!==t.length||":="!==t[1])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentSingular(t[2]);if(null===r)return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(r.type===Ce.IMM&&!Number.isFinite(r.imm))return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(3===t.length)return{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.SINGULAR,singular:r}}};{let n=De.ADD;switch(t[3]){case"+":n=De.ADD;break;case"-":n=De.SUB;break;case"*":n=De.MUL;break;case"/":n=De.DIV;break;default:return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const i=this.decodeComponentSingular(t[4]);return null===i?{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:i.type!==Ce.IMM||Number.isFinite(i.imm)?{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.BINARY_MATH_OP,singularL:r,singularR:i,binaryMathOp:n}}}:{type:xe.ERROR,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}}}decodeDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.GLOBAL_DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"LABEL_ILLEGAL_ID"}:{type:xe.LABEL,value:{id:e}}}decodeGoto(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"GOTO_ILLEGAL_ID"}:{type:xe.GOTO,value:{id:e}}}decodeIf(t){if(6!==t.length||"GOTO"!==t[4])return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(e.type===Ce.IMM&&!Number.isFinite(e.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let r=Me.EQ;switch(t[2]){case"==":r=Me.EQ;break;case"!=":r=Me.NE;break;case"<":r=Me.LT;break;case"<=":r=Me.LE;break;case">":r=Me.GT;break;case">=":r=Me.GE;break;default:return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const n=this.decodeComponentSingular(t[3]);if(null===n)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(n.type===Ce.IMM&&!Number.isFinite(n.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const i=this.decodeComponentId(t[5]);return null===i?{type:xe.ERROR,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:xe.IF,value:{condition:{singularL:e,singularR:n,binaryRelOp:r},gotoId:i}}}decodeArg(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"ARG_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.ARG,value:{value:e}}:{type:xe.ERROR,messageKey:"ARG_IMM_TOO_LARGE"}}decodeCall(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.CALL,value:{id:e}}}decodeAssignCall(t){if(4!==t.length||":="!==t[1]||"CALL"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentId(t[3]);return null===r?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.ASSIGN_CALL,value:{lValue:e,functionId:r}}}decodeParam(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"PARAM_ILLEGAL_ID"}:{type:xe.PARAM,value:{id:e}}}decodeReturn(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"RETURN_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.RETURN,value:{value:e}}:{type:xe.ERROR,messageKey:"RETURN_IMM_TOO_LARGE"}}decodeRead(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[1]);return null===e?{type:xe.ERROR,messageKey:"READ_ILLEGAL"}:{type:xe.READ,value:{lValue:e}}}decodeWrite(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"WRITE_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.WRITE,value:{value:e}}:{type:xe.ERROR,messageKey:"WRITE_IMM_TOO_LARGE"}}decode(t){if(t.match(/^[ \t]*$/))return{type:xe.EMPTY};const e={type:xe.ERROR,messageKey:"UNRECOGNIZED_INSTRUCTION"},r=this.purify(t);if(r.startsWith(";"))return{type:xe.COMMENT};const n=this.splitWhiteSpace(r);if(n.length<1)return e;switch(n[0]){case"FUNCTION":return this.decodeFunction(n);case"DEC":return this.decodeDec(n);case"GLOBAL_DEC":return this.decodeGlobalDec(n);case"LABEL":return this.decodeLabel(n);case"GOTO":return this.decodeGoto(n);case"IF":return this.decodeIf(n);case"ARG":return this.decodeArg(n);case"CALL":return this.decodeCall(n);case"PARAM":return this.decodeParam(n);case"RETURN":return this.decodeReturn(n);case"READ":return this.decodeRead(n);case"WRITE":return this.decodeWrite(n);default:{const t=this.decodeAssign(n);if(t.type===xe.ASSIGN)return t;const e=this.decodeAssignCall(n);return e.type===xe.ASSIGN_CALL?e:t}}}}var Fe,je,Ve={exports:{}}; /** * @license * Lodash @@ -6,4 +6,4 @@ import t from"fs";import e from"readline";import r from"assert";import n from"ut * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */je=ze,Ve=ze.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,s=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",T="[object Number]",R="[object Object]",I="[object Promise]",L="[object RegExp]",O="[object Set]",S="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",G="[object Int32Array]",U="[object Uint8Array]",k="[object Uint8ClampedArray]",H="[object Uint16Array]",F="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Tt="\\u2700-\\u27bf",Rt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",St="['’]",Nt="["+At+"]",wt="["+Ot+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Tt+"]",Bt="["+Rt+"]",Pt="[^"+At+Ot+Dt+Tt+Rt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Gt="[^"+At+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+It+"]",Ft="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ht+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ft+"(?:"+[Gt,Ut,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Ut,kt].join("|")+")"+Xt,qt="(?:"+[Gt+Ct+"?",Ct,Ut,kt,Nt].join("|")+")",$t=RegExp(St,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ht+"?"+Bt+"+"+zt+"(?="+[wt,Ht,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ht+jt,"$"].join("|")+")",Ht+"?"+jt+"+"+zt,Ht+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ft+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["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"],ie=-1,oe={};oe[M]=oe[B]=oe[P]=oe[x]=oe[G]=oe[U]=oe[k]=oe[H]=oe[F]=!0,oe[g]=oe[d]=oe[C]=oe[m]=oe[D]=oe[E]=oe[v]=oe[y]=oe[b]=oe[T]=oe[R]=oe[L]=oe[O]=oe[S]=oe[w]=!1;var se={};se[g]=se[d]=se[C]=se[D]=se[m]=se[E]=se[M]=se[B]=se[P]=se[x]=se[G]=se[b]=se[T]=se[R]=se[L]=se[O]=se[S]=se[N]=se[U]=se[k]=se[H]=se[F]=!0,se[v]=se[y]=se[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof o&&o&&o.Object===Object&&o,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=Ve&&!Ve.nodeType&&Ve,pe=_e&&je&&!je.nodeType&&je,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Te=me&&me.isTypedArray;function Re(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&He(e,t[r],0)>-1;);return r}var nr=Ye({"À":"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"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(t){return"\\"+ae[t]}function sr(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,o=0,s=[];++r",""":'"',"'":"'"}),dr=function o(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Tt=it.Date,Rt=it.Error,It=it.Function,Lt=it.Math,Ot=it.Object,St=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=Ot.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Gt=0,Ut=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ht=Pt.call(Ot),Ft=fe._,jt=St("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(Ot.getPrototypeOf,Ot),Xt=Ot.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fo(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Tt&&Tt.now!==fe.Date.now&&Tt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ge=Ot.getOwnPropertySymbols,je=Vt?Vt.isBuffer:t,Ve=it.isFinite,Ye=Ct.join,mr=ur(Ot.keys,Ot),Er=Lt.max,vr=Lt.min,yr=Tt.now,Ar=it.parseInt,br=Lt.random,Tr=Ct.reverse,Rr=fo(it,"DataView"),Ir=fo(it,"Map"),Lr=fo(it,"Promise"),Or=fo(it,"Set"),Sr=fo(it,"WeakMap"),Nr=fo(Ot,"create"),wr=Sr&&new Sr,Cr={},Dr=ko(Rr),Mr=ko(Ir),Br=ko(Lr),Pr=ko(Or),xr=ko(Sr),Gr=zt?zt.prototype:t,Ur=Gr?Gr.valueOf:t,kr=Gr?Gr.toString:t;function Hr(t){if(ra(t)&&!Ws(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return Ho(t)}return new Vr(t)}var Fr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,o,s){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=o?n(e,i,o,s):n(e)),a!==t)return a;if(!ea(e))return e;var h=Ws(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=go(e),_=f==y||f==A;if(Zs(e))return Ri(e,u);if(f==R||f==g||_&&!o){if(a=l||_?{}:Eo(e),!u)return l?function(t,e){return Ci(t,po(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_o(t),e)}(e,on(a,e))}else{if(!se[f])return o?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case G:case U:case k:case H:case F:return Li(t,r);case b:return new i;case T:case S:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case N:return n=t,Ur?Ot(Ur.call(n)):{}}}(e,f,u)}}s||(s=new Zr);var p=s.get(e);if(p)return p;s.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,s))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,s))}));var d=h?t:(c?l?oo:io:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,s))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Ot(e);i--;){var o=n[i],s=r[o],a=e[o];if(a===t&&!(o in e)||!s(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Do((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,o=we,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(o=Ce,s=!1):e.length>=200&&(o=tr,s=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=co(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return co(this,t).get(t)},Yr.prototype.has=function(t){return co(this,t).has(t)},Yr.prototype.set=function(t,e){var r=co(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,o=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Tn(t,e){return Ne(e,(function(e){return Qs(t[e])}))}function Rn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function Sn(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in Ot(t)}function wn(e,r,n){for(var i=n?Ce:we,o=e[0].length,s=e.length,a=s,u=bt(s),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||o>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;yo(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Mo(So(t,e,iu),t+"")}function Qn(t){return $r(Fa(t))}function Jn(t,e){var r=Fa(t);return xo(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var o=-1,s=(r=yi(r,e)).length,a=s-1,u=e;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=bt(i);++n>>1,s=t[o];null!==s&&!la(s)&&(r?s<=e:s=200){var l=e?null:qi(t);if(l)return cr(l);s=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ti=he||function(t){return fe.clearTimeout(t)};function Ri(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Oi(e,r){if(e!==r){var n=e!==t,i=null===e,o=e==e,s=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!s&&e>r||s&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!o)return 1;if(!i&&!s&&!c&&e1?n[o-1]:t,a=o>2?n[2]:t;for(s=e.length>3&&"function"==typeof s?(o--,s):t,a&&Ao(n[0],n[1],a)&&(s=o<3?t:s,o=1),r=Ot(r);++i-1?o[s?r[a]:a]:t}}function Hi(r){return no((function(n){var i=n.length,o=i,s=Vr.prototype.thru;for(r&&n.reverse();o--;){var a=n[o];if("function"!=typeof a)throw new wt(e);if(s&&!u&&"wrapper"==ao(a))var u=new Vr([],!0)}for(o=u?o:i;++o1&&v.reverse(),f&&cu))return!1;var c=s.get(e),h=s.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(s.set(e,r),s.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(n),r)))}function Po(e){var r=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function xo(e,r){var n=-1,i=e.length,o=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,ss(e,n)}));function _s(t){var e=Hr(t);return e.__chain__=!0,e}function ps(t,e){return e(t)}var gs=no((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,o=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&yo(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:ps,args:[o],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(o)})),ds=Di((function(t,e,r){xt.call(t,r)?++t[r]:sn(t,r,1)})),ms=ki(zo),Es=ki(Wo);function vs(t,e){return(Ws(t)?Le:_n)(t,lo(e,3))}function ys(t,e){return(Ws(t)?Oe:pn)(t,lo(e,3))}var As=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):sn(t,r,[e])})),bs=$n((function(t,e,r){var n=-1,i="function"==typeof e,o=Ys(t)?bt(t.length):[];return _n(t,(function(t){o[++n]=i?Re(e,t,r):Cn(t,e,r)})),o})),Ts=Di((function(t,e,r){sn(t,r,e)}));function Rs(t,e){return(Ws(t)?De:Hn)(t,lo(e,3))}var Is=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Ls=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&Ao(t,e[0],e[1])?e=[]:r>2&&Ao(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),Os=_e||function(){return fe.Date.now()};function Ss(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function Ns(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var ws=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,uo(ws));n|=s}return Qi(t,n,e,r,i)})),Cs=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,uo(Cs));n|=s}return Qi(e,n,t,r,i)}));function Ds(r,n,i){var o,s,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=o,i=s;return o=s=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=Os();if(d(t))return E(t);l=Do(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&o?g(e):(o=s=t,u)}function v(){var e=Os(),r=d(e);if(o=arguments,s=this,c=e,r){if(l===t)return function(t){return h=t,l=Do(m,n),f?g(t):u}(c);if(_)return Ti(l),l=Do(m,n),g(c)}return l===t&&(l=Do(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ti(l),h=0,o=c=s=l=t},v.flush=function(){return l===t?u:E(Os())},v}var Ms=$n((function(t,e){return hn(t,1,e)})),Bs=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Ps(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,e);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ps.Cache||Yr),n}function xs(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ps.Cache=Yr;var Gs=Ai((function(t,e){var r=(e=1==e.length&&Ws(e[0])?De(e[0],Qe(lo())):De(En(e,1),Qe(lo()))).length;return $n((function(n){for(var i=-1,o=vr(n.length,r);++i=e})),zs=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Ws=bt.isArray,Ks=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Ys(t){return null!=t&&ta(t.length)&&!Qs(t)}function Xs(t){return ra(t)&&Ys(t)}var Zs=je||mu,qs=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $s(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qs(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&go(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==T}function oa(t){if(!ra(t)||Ln(t)!=R)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ht}var sa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&go(t)==O};function ua(t){return"string"==typeof t||!Ws(t)&&ra(t)&&Ln(t)==S}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Te?Qe(Te):function(t){return ra(t)&&ta(t.length)&&!!oe[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Ys(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=go(t);return(e==b?ar:e==O?cr:Fa)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Io(e)||Ys(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ta=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ra=no(an),Ia=$n((function(e,r){e=Ot(e);var n=-1,i=r.length,o=i>2?r[2]:t;for(o&&Ao(r[0],r[1],o)&&(i=1);++n1),e})),Ci(t,oo(t),r),n&&(r=ln(r,7,eo));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ga=no((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Sa(t,r)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var r=De(oo(t),(function(t){return[t]}));return e=lo(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Ha=$i(Ma);function Fa(t){return null==t?[]:Je(t,Da(t))}var ja=Gi((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Gi((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Gi((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Gi((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Gi((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Gi((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Re(e,t,r)}catch(t){return $s(t)?t:new Rt(t)}})),tu=no((function(t,e){return Le(e,(function(e){e=Uo(e),sn(t,e,ws(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Hi(),nu=Hi(!0);function iu(t){return t}function ou(t){return xn("function"==typeof t?t:ln(t,1))}var su=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Tn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Tn(e,Da(e)));var o=!(ea(r)&&"chain"in r&&!r.chain),s=Qs(t);return Le(i,(function(r){var n=e[r];t[r]=n,s&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Se),fu=zi(xe);function _u(t){return bo(t)?Ke(Uo(t)):function(t){return function(e){return Rn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Tu=Vi((function(t,e){return t*e}),1),Ru=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Hr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Hr.ary=Ss,Hr.assign=ya,Hr.assignIn=Aa,Hr.assignInWith=ba,Hr.assignWith=Ta,Hr.at=Ra,Hr.before=Ns,Hr.bind=ws,Hr.bindAll=tu,Hr.bindKey=Cs,Hr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ws(t)?t:[t]},Hr.chain=_s,Hr.chunk=function(e,r,n){r=(n?Ao(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var o=0,s=0,a=bt(de(i/r));oo?0:o+n),(i=i===t||i>o?o:ga(i))<0&&(i+=o),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!sa(r))&&!(r=ci(r))&&sr(e)?bi(_r(e),0,n):e.split(r,n):[]},Hr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Re(t,this,i)}))},Hr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Hr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Hr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Hr.takeRightWhile=function(t,e){return t&&t.length?pi(t,lo(e,3),!1,!0):[]},Hr.takeWhile=function(t,e){return t&&t.length?pi(t,lo(e,3)):[]},Hr.tap=function(t,e){return e(t),t},Hr.throttle=function(t,r,n){var i=!0,o=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ds(t,r,{leading:i,maxWait:r,trailing:o})},Hr.thru=ps,Hr.toArray=_a,Hr.toPairs=ka,Hr.toPairsIn=Ha,Hr.toPath=function(t){return Ws(t)?De(t,Uo):la(t)?[t]:wi(Go(va(t)))},Hr.toPlainObject=Ea,Hr.transform=function(t,e,r){var n=Ws(t),i=n||Zs(t)||ca(t);if(e=lo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ea(t)&&Qs(o)?Fr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Hr.unary=function(t){return Ss(t,1)},Hr.union=rs,Hr.unionBy=ns,Hr.unionWith=is,Hr.uniq=function(t){return t&&t.length?hi(t):[]},Hr.uniqBy=function(t,e){return t&&t.length?hi(t,lo(e,2)):[]},Hr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Hr.unset=function(t,e){return null==t||fi(t,e)},Hr.unzip=os,Hr.unzipWith=ss,Hr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Hr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Hr.values=Fa,Hr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Hr.without=as,Hr.words=Qa,Hr.wrap=function(t,e){return Us(vi(e),t)},Hr.xor=us,Hr.xorBy=ls,Hr.xorWith=cs,Hr.zip=hs,Hr.zipObject=function(t,e){return mi(t||[],e||[],en)},Hr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Hr.zipWith=fs,Hr.entries=ka,Hr.entriesIn=Ha,Hr.extend=Aa,Hr.extendWith=ba,uu(Hr,Hr),Hr.add=vu,Hr.attempt=Ja,Hr.camelCase=ja,Hr.capitalize=Va,Hr.ceil=yu,Hr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Hr.clone=function(t){return ln(t,4)},Hr.cloneDeep=function(t){return ln(t,5)},Hr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Hr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Hr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Hr.deburr=za,Hr.defaultTo=function(t,e){return null==t||t!=t?e:t},Hr.divide=Au,Hr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,o=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,o)==r},Hr.eq=Fs,Hr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Hr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Hr.every=function(e,r,n){var i=Ws(e)?Se:gn;return n&&Ao(e,r,n)&&(r=t),i(e,lo(r,3))},Hr.find=ms,Hr.findIndex=zo,Hr.findKey=function(t,e){return Ue(t,lo(e,3),An)},Hr.findLast=Es,Hr.findLastIndex=Wo,Hr.findLastKey=function(t,e){return Ue(t,lo(e,3),bn)},Hr.floor=bu,Hr.forEach=vs,Hr.forEachRight=ys,Hr.forIn=function(t,e){return null==t?t:vn(t,lo(e,3),Ma)},Hr.forInRight=function(t,e){return null==t?t:yn(t,lo(e,3),Ma)},Hr.forOwn=function(t,e){return t&&An(t,lo(e,3))},Hr.forOwnRight=function(t,e){return t&&bn(t,lo(e,3))},Hr.get=Oa,Hr.gt=js,Hr.gte=Vs,Hr.has=function(t,e){return null!=t&&mo(t,e,Sn)},Hr.hasIn=Sa,Hr.head=Yo,Hr.identity=iu,Hr.includes=function(t,e,r,n){t=Ys(t)?t:Fa(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&He(t,e,r)>-1},Hr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),He(t,e,i)},Hr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Hr.isSet=aa,Hr.isString=ua,Hr.isSymbol=la,Hr.isTypedArray=ca,Hr.isUndefined=function(e){return e===t},Hr.isWeakMap=function(t){return ra(t)&&go(t)==w},Hr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Hr.join=function(t,e){return null==t?"":Ye.call(t,e)},Hr.kebabCase=Wa,Hr.last=$o,Hr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==t&&(o=(o=ga(n))<0?Er(i+o,0):vr(o,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,o):ke(e,ze,o,!0)},Hr.lowerCase=Ka,Hr.lowerFirst=Ya,Hr.lt=ha,Hr.lte=fa,Hr.max=function(e){return e&&e.length?dn(e,iu,On):t},Hr.maxBy=function(e,r){return e&&e.length?dn(e,lo(r,2),On):t},Hr.mean=function(t){return We(t,iu)},Hr.meanBy=function(t,e){return We(t,lo(e,2))},Hr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Hr.minBy=function(e,r){return e&&e.length?dn(e,lo(r,2),kn):t},Hr.stubArray=du,Hr.stubFalse=mu,Hr.stubObject=function(){return{}},Hr.stubString=function(){return""},Hr.stubTrue=function(){return!0},Hr.multiply=Tu,Hr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Hr.noConflict=function(){return fe._===this&&(fe._=Ft),this},Hr.noop=lu,Hr.now=Os,Hr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Hr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var o=br();return vr(e+o*(r-e+ue("1e-"+((o+"").length-1))),r)}return Zn(e,r)},Hr.reduce=function(t,e,r){var n=Ws(t)?Be:Xe,i=arguments.length<3;return n(t,lo(e,4),r,i,_n)},Hr.reduceRight=function(t,e,r){var n=Ws(t)?Pe:Xe,i=arguments.length<3;return n(t,lo(e,4),r,i,pn)},Hr.repeat=function(e,r,n){return r=(n?Ao(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Hr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hr.result=function(e,r,n){var i=-1,o=(r=yi(r,e)).length;for(o||(o=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=lo(e),t-=_;for(var i=qe(n,e);++r=s)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(o===t)return l+i;if(a&&(u+=l.length-u),sa(o)){if(e.slice(u).search(o)){var c,h=l;for(o.global||(o=St(o.source,va(ft.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(o),u)!=u){var _=l.lastIndexOf(o);_>-1&&(l=l.slice(0,_))}return l+i},Hr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Hr.uniqueId=function(t){var e=++Gt;return va(t)+e},Hr.upperCase=qa,Hr.upperFirst=$a,Hr.each=vs,Hr.eachRight=ys,Hr.first=Yo,uu(Hr,(Eu={},An(Hr,(function(t,e){xt.call(Hr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Hr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hr[t].placeholder=Hr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xs(lo(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),o=Hr[i?"take"+("last"==r?"Right":""):r],s=i||/^find/.test(r);o&&(Hr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Ws(r),h=function(t){var e=o.apply(Hr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=s&&!f,g=u&&!_;if(!s&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:ps,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Hr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ws(i)?i:[],t)}return this[r]((function(r){return e.apply(Ws(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Hr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Fi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ws(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=Ho(n);i.__index__=0,i.__values__=t,r?o.__wrapped__=i:r=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,r},Hr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:ps,args:[es],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(es)},Hr.prototype.toJSON=Hr.prototype.valueOf=Hr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Hr.prototype.first=Hr.prototype.head,ee&&(Hr.prototype[ee]=function(){return this}),Hr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(o);var We,Ke=s(ze.exports);!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY"}(We||(We={}));const Ye={instructions:[],text:[],memory:new Uint8Array},Xe={total:0,stack:0,globalVariable:0},Ze={labelTable:{},functionTable:{},globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},qe={stepCount:0,timeElapsed:0,state:We.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var $e;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}($e||($e={}));const Qe={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:16777216},stackSize:{min:512,max:16776192}},Je={maxExecutionStepCount:1e6,memorySize:16384,stackSize:8192};const tr=new _.ArgumentParser({description:"IR Virtual Machine CLI"});tr.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),tr.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),tr.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),tr.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),tr.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),tr.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const er=tr.parse_args(),rr={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let nr;if("en"===er.locale)nr=Re({locale:"en",messages:Ie[1].locale},rr);else nr=Re({locale:"zh-cn",messages:Ie[0].locale},rr);const ir=e.createInterface({input:process.stdin});let or;try{or=t.readFileSync(er.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function sr(){ar.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case $e.OUTPUT:process.stdout.write(nr.formatMessage({id:n.key},n.values)),t=!0;break;case $e.ERROR:process.stderr.write(nr.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case $e.SUCCESS:case $e.WARNING:if(er.summary){process.stdout.write(nr.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const ar=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Je.memorySize,eip:0};decoder=new Fe;memory=Ke.cloneDeep(Ye);registers=Ke.cloneDeep(this.initialRegisters);tables=Ke.cloneDeep(Ze);executionStatus=Ke.cloneDeep(qe);peakMemoryUsage=Ke.cloneDeep(Xe);options=Ke.cloneDeep(Je);executionStartTime=new Date;writeBuffer=[];readConsole=t=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,Qe.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,Qe.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:Qe.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Oe(t.memorySize),this.registers.esp=Oe(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,Qe.stackSize),t.stackSize=e(t.stackSize,{min:Qe.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=Ke.cloneDeep(this.initialRegisters),this.tables=Ke.cloneDeep(Ze),this.executionStatus=Ke.cloneDeep(qe),this.peakMemoryUsage=Ke.cloneDeep(Xe),this.writeBuffer=[]}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){for(let e=0;er.length?Ce.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,Ce.SUCCESS)}(t,e,this.memory.memory);return r!==Ce.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Ne(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===De.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===De.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===De.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case xe.SINGULAR:return this.getSingularValue(t.singular);case xe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case Me.ADD:return Se(e,r);case Me.SUB:return Ne(e,r);case Me.MUL:return function(t,e){const r=65535&t,n=65535&e;return Oe((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case Me.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Oe(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;this.registers.esp=Ne(this.registers.esp,e),this.updatePeakMemoryUsage();const r={address:this.registers.esp,size:e};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t}}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=r,r)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Pe.DEREF_ID);if(null===e){if(t.type!==Pe.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Pe.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Be.EQ:return e===r;case Be.NE:return e!==r;case Be.LT:return er;case Be.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==We.EXITED_NORMALLY&&this.executionStatus.state!==We.EXITED_ABNORMALLY&&this.executionStatus.state!==We.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==We.FREE)return;if(this.executionStatus.state=We.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=We.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:$e.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=We.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:$e.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:$e.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ue.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Se(this.registers.ecx,4);break}case Ue.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ue.ASSIGN_CALL:case Ue.CALL:{const e=t.type===Ue.CALL?t.value.id:t.value.functionId;if(!(e in this.tables.functionTable))return void this.writeRuntimeError({key:"FUNCTION_NOT_FOUND",values:{id:e}});if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ue.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=this.tables.functionTable[e].addressBefore;break}case Ue.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ue.GOTO:{const e=t.value.id;if(!(e in this.tables.labelTable))return void this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:e}});this.registers.eip=this.tables.labelTable[e].addressBefore;break}case Ue.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;const r=t.value.gotoId;if(!(r in this.tables.labelTable))return void this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:r}});e&&(this.registers.eip=this.tables.labelTable[r].addressBefore);break}case Ue.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4},this.registers.ebx=Se(this.registers.ebx,4);break}case Ue.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Se(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const o=this.tables.assignCallLValueStack.pop();if(null!==o){const t=this.getLValueAddress(o);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ue.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Pe.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=We.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==We.WAIT_INPUT)return;this.executionStatus.state=We.BUSY;const o=parseInt(i);if(isNaN(o))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(o))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Oe(o),r))return;break}case Ue.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:$e.OUTPUT}]);break}}for(this.registers.eip=Se(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ue.GLOBAL_DEC;)this.registers.eip=Se(this.registers.eip,1);this.executionStatus.state=We.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};ar.configure({maxExecutionStepCount:0,memorySize:16777216,stackSize:15728640});const ur=[];let lr=0,cr=null;switch(ir.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));ur.push(...e),null!==cr&&lr(sr(),er.prompt&&console.log(t.reduce(((t,e)=>t+nr.formatMessage({id:e.key},e.values)),"")),lr{cr=t}))))),ar.loadNewInstructions(or.split(/\r\n|[\r\n]/)),await ar.executeContinuously(),sr(),er.stepCount&&console.log(ar.stepCount),er.timeElapsed&&console.log(ar.timeElapsed),ar.state){case We.EXITED_NORMALLY:process.exit(0);case We.EXITED_ABNORMALLY:process.exit(ar.returnValue);case We.STATIC_CHECK_FAILED:case We.RUNTIME_ERROR:process.exit(1)} + */Fe=Ve,je=Ve.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,s=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",T="[object Number]",R="[object Object]",I="[object Promise]",L="[object RegExp]",S="[object Set]",O="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",G="[object Int32Array]",U="[object Uint8Array]",k="[object Uint8ClampedArray]",H="[object Uint16Array]",F="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Tt="\\u2700-\\u27bf",Rt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Ot="['’]",Nt="["+At+"]",wt="["+St+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Tt+"]",Bt="["+Rt+"]",Pt="[^"+At+St+Dt+Tt+Rt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Gt="[^"+At+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+It+"]",Ft="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ht+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ft+"(?:"+[Gt,Ut,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Ut,kt].join("|")+")"+Xt,qt="(?:"+[Gt+Ct+"?",Ct,Ut,kt,Nt].join("|")+")",$t=RegExp(Ot,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ht+"?"+Bt+"+"+zt+"(?="+[wt,Ht,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ht+jt,"$"].join("|")+")",Ht+"?"+jt+"+"+zt,Ht+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ft+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["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"],ie=-1,oe={};oe[M]=oe[B]=oe[P]=oe[x]=oe[G]=oe[U]=oe[k]=oe[H]=oe[F]=!0,oe[g]=oe[d]=oe[C]=oe[m]=oe[D]=oe[E]=oe[v]=oe[y]=oe[b]=oe[T]=oe[R]=oe[L]=oe[S]=oe[O]=oe[w]=!1;var se={};se[g]=se[d]=se[C]=se[D]=se[m]=se[E]=se[M]=se[B]=se[P]=se[x]=se[G]=se[b]=se[T]=se[R]=se[L]=se[S]=se[O]=se[N]=se[U]=se[k]=se[H]=se[F]=!0,se[v]=se[y]=se[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof o&&o&&o.Object===Object&&o,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=je&&!je.nodeType&&je,pe=_e&&Fe&&!Fe.nodeType&&Fe,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Te=me&&me.isTypedArray;function Re(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&He(e,t[r],0)>-1;);return r}var nr=Ye({"À":"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"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(t){return"\\"+ae[t]}function sr(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,o=0,s=[];++r",""":'"',"'":"'"}),dr=function o(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Tt=it.Date,Rt=it.Error,It=it.Function,Lt=it.Math,St=it.Object,Ot=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=St.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Gt=0,Ut=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ht=Pt.call(St),Ft=fe._,jt=Ot("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(St.getPrototypeOf,St),Xt=St.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fo(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Tt&&Tt.now!==fe.Date.now&&Tt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ge=St.getOwnPropertySymbols,Fe=Vt?Vt.isBuffer:t,je=it.isFinite,Ye=Ct.join,mr=ur(St.keys,St),Er=Lt.max,vr=Lt.min,yr=Tt.now,Ar=it.parseInt,br=Lt.random,Tr=Ct.reverse,Rr=fo(it,"DataView"),Ir=fo(it,"Map"),Lr=fo(it,"Promise"),Sr=fo(it,"Set"),Or=fo(it,"WeakMap"),Nr=fo(St,"create"),wr=Or&&new Or,Cr={},Dr=ko(Rr),Mr=ko(Ir),Br=ko(Lr),Pr=ko(Sr),xr=ko(Or),Gr=zt?zt.prototype:t,Ur=Gr?Gr.valueOf:t,kr=Gr?Gr.toString:t;function Hr(t){if(ra(t)&&!Ws(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return Ho(t)}return new Vr(t)}var Fr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,o,s){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=o?n(e,i,o,s):n(e)),a!==t)return a;if(!ea(e))return e;var h=Ws(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=go(e),_=f==y||f==A;if(Zs(e))return Ri(e,u);if(f==R||f==g||_&&!o){if(a=l||_?{}:Eo(e),!u)return l?function(t,e){return Ci(t,po(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_o(t),e)}(e,on(a,e))}else{if(!se[f])return o?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case G:case U:case k:case H:case F:return Li(t,r);case b:return new i;case T:case O:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case S:return new i;case N:return n=t,Ur?St(Ur.call(n)):{}}}(e,f,u)}}s||(s=new Zr);var p=s.get(e);if(p)return p;s.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,s))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,s))}));var d=h?t:(c?l?oo:io:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,s))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=St(e);i--;){var o=n[i],s=r[o],a=e[o];if(a===t&&!(o in e)||!s(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Do((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,o=we,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(o=Ce,s=!1):e.length>=200&&(o=tr,s=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=co(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return co(this,t).get(t)},Yr.prototype.has=function(t){return co(this,t).has(t)},Yr.prototype.set=function(t,e){var r=co(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,o=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Tn(t,e){return Ne(e,(function(e){return Qs(t[e])}))}function Rn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function On(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in St(t)}function wn(e,r,n){for(var i=n?Ce:we,o=e[0].length,s=e.length,a=s,u=bt(s),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||o>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;yo(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Mo(Oo(t,e,iu),t+"")}function Qn(t){return $r(Fa(t))}function Jn(t,e){var r=Fa(t);return xo(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var o=-1,s=(r=yi(r,e)).length,a=s-1,u=e;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=bt(i);++n>>1,s=t[o];null!==s&&!la(s)&&(r?s<=e:s=200){var l=e?null:qi(t);if(l)return cr(l);s=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ti=he||function(t){return fe.clearTimeout(t)};function Ri(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Si(e,r){if(e!==r){var n=e!==t,i=null===e,o=e==e,s=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!s&&e>r||s&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!o)return 1;if(!i&&!s&&!c&&e1?n[o-1]:t,a=o>2?n[2]:t;for(s=e.length>3&&"function"==typeof s?(o--,s):t,a&&Ao(n[0],n[1],a)&&(s=o<3?t:s,o=1),r=St(r);++i-1?o[s?r[a]:a]:t}}function Hi(r){return no((function(n){var i=n.length,o=i,s=Vr.prototype.thru;for(r&&n.reverse();o--;){var a=n[o];if("function"!=typeof a)throw new wt(e);if(s&&!u&&"wrapper"==ao(a))var u=new Vr([],!0)}for(o=u?o:i;++o1&&v.reverse(),f&&cu))return!1;var c=s.get(e),h=s.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(s.set(e,r),s.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(n),r)))}function Po(e){var r=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function xo(e,r){var n=-1,i=e.length,o=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,ss(e,n)}));function _s(t){var e=Hr(t);return e.__chain__=!0,e}function ps(t,e){return e(t)}var gs=no((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,o=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&yo(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:ps,args:[o],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(o)})),ds=Di((function(t,e,r){xt.call(t,r)?++t[r]:sn(t,r,1)})),ms=ki(zo),Es=ki(Wo);function vs(t,e){return(Ws(t)?Le:_n)(t,lo(e,3))}function ys(t,e){return(Ws(t)?Se:pn)(t,lo(e,3))}var As=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):sn(t,r,[e])})),bs=$n((function(t,e,r){var n=-1,i="function"==typeof e,o=Ys(t)?bt(t.length):[];return _n(t,(function(t){o[++n]=i?Re(e,t,r):Cn(t,e,r)})),o})),Ts=Di((function(t,e,r){sn(t,r,e)}));function Rs(t,e){return(Ws(t)?De:Hn)(t,lo(e,3))}var Is=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Ls=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&Ao(t,e[0],e[1])?e=[]:r>2&&Ao(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),Ss=_e||function(){return fe.Date.now()};function Os(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function Ns(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var ws=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,uo(ws));n|=s}return Qi(t,n,e,r,i)})),Cs=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,uo(Cs));n|=s}return Qi(e,n,t,r,i)}));function Ds(r,n,i){var o,s,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=o,i=s;return o=s=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=Ss();if(d(t))return E(t);l=Do(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&o?g(e):(o=s=t,u)}function v(){var e=Ss(),r=d(e);if(o=arguments,s=this,c=e,r){if(l===t)return function(t){return h=t,l=Do(m,n),f?g(t):u}(c);if(_)return Ti(l),l=Do(m,n),g(c)}return l===t&&(l=Do(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ti(l),h=0,o=c=s=l=t},v.flush=function(){return l===t?u:E(Ss())},v}var Ms=$n((function(t,e){return hn(t,1,e)})),Bs=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Ps(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,e);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ps.Cache||Yr),n}function xs(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ps.Cache=Yr;var Gs=Ai((function(t,e){var r=(e=1==e.length&&Ws(e[0])?De(e[0],Qe(lo())):De(En(e,1),Qe(lo()))).length;return $n((function(n){for(var i=-1,o=vr(n.length,r);++i=e})),zs=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Ws=bt.isArray,Ks=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Ys(t){return null!=t&&ta(t.length)&&!Qs(t)}function Xs(t){return ra(t)&&Ys(t)}var Zs=Fe||mu,qs=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $s(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qs(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&go(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==T}function oa(t){if(!ra(t)||Ln(t)!=R)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ht}var sa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&go(t)==S};function ua(t){return"string"==typeof t||!Ws(t)&&ra(t)&&Ln(t)==O}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Te?Qe(Te):function(t){return ra(t)&&ta(t.length)&&!!oe[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Ys(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=go(t);return(e==b?ar:e==S?cr:Fa)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Io(e)||Ys(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ta=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ra=no(an),Ia=$n((function(e,r){e=St(e);var n=-1,i=r.length,o=i>2?r[2]:t;for(o&&Ao(r[0],r[1],o)&&(i=1);++n1),e})),Ci(t,oo(t),r),n&&(r=ln(r,7,eo));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ga=no((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Oa(t,r)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var r=De(oo(t),(function(t){return[t]}));return e=lo(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Ha=$i(Ma);function Fa(t){return null==t?[]:Je(t,Da(t))}var ja=Gi((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Gi((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Gi((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Gi((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Gi((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Gi((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Re(e,t,r)}catch(t){return $s(t)?t:new Rt(t)}})),tu=no((function(t,e){return Le(e,(function(e){e=Uo(e),sn(t,e,ws(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Hi(),nu=Hi(!0);function iu(t){return t}function ou(t){return xn("function"==typeof t?t:ln(t,1))}var su=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Tn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Tn(e,Da(e)));var o=!(ea(r)&&"chain"in r&&!r.chain),s=Qs(t);return Le(i,(function(r){var n=e[r];t[r]=n,s&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Oe),fu=zi(xe);function _u(t){return bo(t)?Ke(Uo(t)):function(t){return function(e){return Rn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Tu=Vi((function(t,e){return t*e}),1),Ru=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Hr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Hr.ary=Os,Hr.assign=ya,Hr.assignIn=Aa,Hr.assignInWith=ba,Hr.assignWith=Ta,Hr.at=Ra,Hr.before=Ns,Hr.bind=ws,Hr.bindAll=tu,Hr.bindKey=Cs,Hr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ws(t)?t:[t]},Hr.chain=_s,Hr.chunk=function(e,r,n){r=(n?Ao(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var o=0,s=0,a=bt(de(i/r));oo?0:o+n),(i=i===t||i>o?o:ga(i))<0&&(i+=o),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!sa(r))&&!(r=ci(r))&&sr(e)?bi(_r(e),0,n):e.split(r,n):[]},Hr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Re(t,this,i)}))},Hr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Hr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Hr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Hr.takeRightWhile=function(t,e){return t&&t.length?pi(t,lo(e,3),!1,!0):[]},Hr.takeWhile=function(t,e){return t&&t.length?pi(t,lo(e,3)):[]},Hr.tap=function(t,e){return e(t),t},Hr.throttle=function(t,r,n){var i=!0,o=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ds(t,r,{leading:i,maxWait:r,trailing:o})},Hr.thru=ps,Hr.toArray=_a,Hr.toPairs=ka,Hr.toPairsIn=Ha,Hr.toPath=function(t){return Ws(t)?De(t,Uo):la(t)?[t]:wi(Go(va(t)))},Hr.toPlainObject=Ea,Hr.transform=function(t,e,r){var n=Ws(t),i=n||Zs(t)||ca(t);if(e=lo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ea(t)&&Qs(o)?Fr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Hr.unary=function(t){return Os(t,1)},Hr.union=rs,Hr.unionBy=ns,Hr.unionWith=is,Hr.uniq=function(t){return t&&t.length?hi(t):[]},Hr.uniqBy=function(t,e){return t&&t.length?hi(t,lo(e,2)):[]},Hr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Hr.unset=function(t,e){return null==t||fi(t,e)},Hr.unzip=os,Hr.unzipWith=ss,Hr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Hr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Hr.values=Fa,Hr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Hr.without=as,Hr.words=Qa,Hr.wrap=function(t,e){return Us(vi(e),t)},Hr.xor=us,Hr.xorBy=ls,Hr.xorWith=cs,Hr.zip=hs,Hr.zipObject=function(t,e){return mi(t||[],e||[],en)},Hr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Hr.zipWith=fs,Hr.entries=ka,Hr.entriesIn=Ha,Hr.extend=Aa,Hr.extendWith=ba,uu(Hr,Hr),Hr.add=vu,Hr.attempt=Ja,Hr.camelCase=ja,Hr.capitalize=Va,Hr.ceil=yu,Hr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Hr.clone=function(t){return ln(t,4)},Hr.cloneDeep=function(t){return ln(t,5)},Hr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Hr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Hr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Hr.deburr=za,Hr.defaultTo=function(t,e){return null==t||t!=t?e:t},Hr.divide=Au,Hr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,o=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,o)==r},Hr.eq=Fs,Hr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Hr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Hr.every=function(e,r,n){var i=Ws(e)?Oe:gn;return n&&Ao(e,r,n)&&(r=t),i(e,lo(r,3))},Hr.find=ms,Hr.findIndex=zo,Hr.findKey=function(t,e){return Ue(t,lo(e,3),An)},Hr.findLast=Es,Hr.findLastIndex=Wo,Hr.findLastKey=function(t,e){return Ue(t,lo(e,3),bn)},Hr.floor=bu,Hr.forEach=vs,Hr.forEachRight=ys,Hr.forIn=function(t,e){return null==t?t:vn(t,lo(e,3),Ma)},Hr.forInRight=function(t,e){return null==t?t:yn(t,lo(e,3),Ma)},Hr.forOwn=function(t,e){return t&&An(t,lo(e,3))},Hr.forOwnRight=function(t,e){return t&&bn(t,lo(e,3))},Hr.get=Sa,Hr.gt=js,Hr.gte=Vs,Hr.has=function(t,e){return null!=t&&mo(t,e,On)},Hr.hasIn=Oa,Hr.head=Yo,Hr.identity=iu,Hr.includes=function(t,e,r,n){t=Ys(t)?t:Fa(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&He(t,e,r)>-1},Hr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),He(t,e,i)},Hr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Hr.isSet=aa,Hr.isString=ua,Hr.isSymbol=la,Hr.isTypedArray=ca,Hr.isUndefined=function(e){return e===t},Hr.isWeakMap=function(t){return ra(t)&&go(t)==w},Hr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Hr.join=function(t,e){return null==t?"":Ye.call(t,e)},Hr.kebabCase=Wa,Hr.last=$o,Hr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==t&&(o=(o=ga(n))<0?Er(i+o,0):vr(o,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,o):ke(e,ze,o,!0)},Hr.lowerCase=Ka,Hr.lowerFirst=Ya,Hr.lt=ha,Hr.lte=fa,Hr.max=function(e){return e&&e.length?dn(e,iu,Sn):t},Hr.maxBy=function(e,r){return e&&e.length?dn(e,lo(r,2),Sn):t},Hr.mean=function(t){return We(t,iu)},Hr.meanBy=function(t,e){return We(t,lo(e,2))},Hr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Hr.minBy=function(e,r){return e&&e.length?dn(e,lo(r,2),kn):t},Hr.stubArray=du,Hr.stubFalse=mu,Hr.stubObject=function(){return{}},Hr.stubString=function(){return""},Hr.stubTrue=function(){return!0},Hr.multiply=Tu,Hr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Hr.noConflict=function(){return fe._===this&&(fe._=Ft),this},Hr.noop=lu,Hr.now=Ss,Hr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Hr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var o=br();return vr(e+o*(r-e+ue("1e-"+((o+"").length-1))),r)}return Zn(e,r)},Hr.reduce=function(t,e,r){var n=Ws(t)?Be:Xe,i=arguments.length<3;return n(t,lo(e,4),r,i,_n)},Hr.reduceRight=function(t,e,r){var n=Ws(t)?Pe:Xe,i=arguments.length<3;return n(t,lo(e,4),r,i,pn)},Hr.repeat=function(e,r,n){return r=(n?Ao(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Hr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hr.result=function(e,r,n){var i=-1,o=(r=yi(r,e)).length;for(o||(o=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=lo(e),t-=_;for(var i=qe(n,e);++r=s)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(o===t)return l+i;if(a&&(u+=l.length-u),sa(o)){if(e.slice(u).search(o)){var c,h=l;for(o.global||(o=Ot(o.source,va(ft.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(o),u)!=u){var _=l.lastIndexOf(o);_>-1&&(l=l.slice(0,_))}return l+i},Hr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Hr.uniqueId=function(t){var e=++Gt;return va(t)+e},Hr.upperCase=qa,Hr.upperFirst=$a,Hr.each=vs,Hr.eachRight=ys,Hr.first=Yo,uu(Hr,(Eu={},An(Hr,(function(t,e){xt.call(Hr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Hr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hr[t].placeholder=Hr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xs(lo(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),o=Hr[i?"take"+("last"==r?"Right":""):r],s=i||/^find/.test(r);o&&(Hr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Ws(r),h=function(t){var e=o.apply(Hr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=s&&!f,g=u&&!_;if(!s&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:ps,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Hr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ws(i)?i:[],t)}return this[r]((function(r){return e.apply(Ws(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Hr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Fi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ws(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=Ho(n);i.__index__=0,i.__values__=t,r?o.__wrapped__=i:r=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,r},Hr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:ps,args:[es],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(es)},Hr.prototype.toJSON=Hr.prototype.valueOf=Hr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Hr.prototype.first=Hr.prototype.head,ee&&(Hr.prototype[ee]=function(){return this}),Hr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(o);var ze,We=Ve.exports;!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",t[t.CLOSED=9]="CLOSED"}(ze||(ze={}));const Ke={instructions:[],text:[],memory:new Uint8Array},Ye={total:0,stack:0,globalVariable:0},Xe={labelTable:{},functionTable:{},globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},Ze={stepCount:0,timeElapsed:0,state:ze.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var qe;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}(qe||(qe={}));const $e={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:16777216},stackSize:{min:512,max:16776192}},Qe={maxExecutionStepCount:1e6,memorySize:16384,stackSize:8192};const Je=new f.ArgumentParser({description:"IR Virtual Machine CLI"});Je.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),Je.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),Je.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),Je.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),Je.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),Je.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const tr=Je.parse_args(),er={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let rr;if("en"===tr.locale)rr=Te({locale:"en",messages:Re[1].locale},er);else rr=Te({locale:"zh-cn",messages:Re[0].locale},er);const nr=e.createInterface({input:process.stdin});let ir;try{ir=t.readFileSync(tr.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function or(){sr.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case qe.OUTPUT:process.stdout.write(rr.formatMessage({id:n.key},n.values)),t=!0;break;case qe.ERROR:process.stderr.write(rr.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case qe.SUCCESS:case qe.WARNING:if(tr.summary){process.stdout.write(rr.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const sr=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Qe.memorySize,eip:0};decoder=new He;memory=We.cloneDeep(Ke);registers=We.cloneDeep(this.initialRegisters);tables=We.cloneDeep(Xe);executionStatus=We.cloneDeep(Ze);peakMemoryUsage=We.cloneDeep(Ye);options=We.cloneDeep(Qe);executionStartTime=new Date;writeBuffer=[];readConsole=t=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,$e.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,$e.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:$e.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Le(t.memorySize),this.registers.esp=Le(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,$e.stackSize),t.stackSize=e(t.stackSize,{min:$e.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=We.cloneDeep(this.initialRegisters),this.tables=We.cloneDeep(Xe),this.executionStatus=We.cloneDeep(Ze),this.peakMemoryUsage=We.cloneDeep(Ye),this.writeBuffer=[]}close(){this.executionStatus.state=ze.CLOSED}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){for(let e=0;er.length?we.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,we.SUCCESS)}(t,e,this.memory.memory);return r!==we.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Oe(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===Ce.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===Ce.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===Ce.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case Pe.SINGULAR:return this.getSingularValue(t.singular);case Pe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case De.ADD:return Se(e,r);case De.SUB:return Oe(e,r);case De.MUL:return function(t,e){const r=65535&t,n=65535&e;return Le((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case De.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Le(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;this.registers.esp=Oe(this.registers.esp,e),this.updatePeakMemoryUsage();const r={address:this.registers.esp,size:e};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t}}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=r,r)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Be.DEREF_ID);if(null===e){if(t.type!==Be.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Be.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Me.EQ:return e===r;case Me.NE:return e!==r;case Me.LT:return er;case Me.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==ze.EXITED_NORMALLY&&this.executionStatus.state!==ze.EXITED_ABNORMALLY&&this.executionStatus.state!==ze.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==ze.FREE)return;if(this.executionStatus.state=ze.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=ze.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:qe.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=ze.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:qe.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:qe.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ge.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Se(this.registers.ecx,4);break}case Ge.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ge.ASSIGN_CALL:case Ge.CALL:{const e=t.type===Ge.CALL?t.value.id:t.value.functionId;if(!(e in this.tables.functionTable))return void this.writeRuntimeError({key:"FUNCTION_NOT_FOUND",values:{id:e}});if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ge.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=this.tables.functionTable[e].addressBefore;break}case Ge.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ge.GOTO:{const e=t.value.id;if(!(e in this.tables.labelTable))return void this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:e}});this.registers.eip=this.tables.labelTable[e].addressBefore;break}case Ge.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;const r=t.value.gotoId;if(!(r in this.tables.labelTable))return void this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:r}});e&&(this.registers.eip=this.tables.labelTable[r].addressBefore);break}case Ge.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4},this.registers.ebx=Se(this.registers.ebx,4);break}case Ge.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Se(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const o=this.tables.assignCallLValueStack.pop();if(null!==o){const t=this.getLValueAddress(o);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ge.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Be.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=ze.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==ze.WAIT_INPUT)return;this.executionStatus.state=ze.BUSY;const o=parseInt(i);if(isNaN(o))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(o))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Le(o),r))return;break}case Ge.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:qe.OUTPUT}]);break}}for(this.registers.eip=Se(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ge.GLOBAL_DEC;)this.registers.eip=Se(this.registers.eip,1);this.executionStatus.state=ze.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};sr.configure({maxExecutionStepCount:0,memorySize:16777216,stackSize:15728640});const ar=[];let ur=0,lr=null;nr.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));ar.push(...e),null!==lr&&ur(or(),tr.prompt&&console.log(t.reduce(((t,e)=>t+rr.formatMessage({id:e.key},e.values)),"")),ur{lr=t}))))),sr.loadNewInstructions(ir.split(/\r\n|[\r\n]/)),await sr.executeContinuously(),or(),tr.stepCount&&console.log(sr.stepCount),tr.timeElapsed&&console.log(sr.timeElapsed);const cr=sr.state;switch(sr.close(),cr){case ze.EXITED_NORMALLY:process.exit(0);case ze.EXITED_ABNORMALLY:process.exit(sr.returnValue);case ze.STATIC_CHECK_FAILED:case ze.RUNTIME_ERROR:process.exit(1)} diff --git a/docs/assets/cssMode-016766a9.js b/docs/assets/cssMode-a70b8ffe.js similarity index 99% rename from docs/assets/cssMode-016766a9.js rename to docs/assets/cssMode-a70b8ffe.js index 3815ffa..a6a8725 100644 --- a/docs/assets/cssMode-016766a9.js +++ b/docs/assets/cssMode-a70b8ffe.js @@ -1,4 +1,4 @@ -import{m as je}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as je}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/freemarker2-16cf0c28.js b/docs/assets/freemarker2-d4fc4a18.js similarity index 99% rename from docs/assets/freemarker2-16cf0c28.js rename to docs/assets/freemarker2-d4fc4a18.js index 1f2c162..9f78282 100644 --- a/docs/assets/freemarker2-16cf0c28.js +++ b/docs/assets/freemarker2-d4fc4a18.js @@ -1,4 +1,4 @@ -import{m as F}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/handlebars-8e9b88a4.js b/docs/assets/handlebars-84ede268.js similarity index 99% rename from docs/assets/handlebars-8e9b88a4.js rename to docs/assets/handlebars-84ede268.js index 8666650..c18c3ce 100644 --- a/docs/assets/handlebars-8e9b88a4.js +++ b/docs/assets/handlebars-84ede268.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/html-d0e282cb.js b/docs/assets/html-c86539dd.js similarity index 98% rename from docs/assets/html-d0e282cb.js rename to docs/assets/html-c86539dd.js index 64131af..536d5a1 100644 --- a/docs/assets/html-d0e282cb.js +++ b/docs/assets/html-c86539dd.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/htmlMode-486a6d1f.js b/docs/assets/htmlMode-f0b3914e.js similarity index 99% rename from docs/assets/htmlMode-486a6d1f.js rename to docs/assets/htmlMode-f0b3914e.js index b13cfe1..1345077 100644 --- a/docs/assets/htmlMode-486a6d1f.js +++ b/docs/assets/htmlMode-f0b3914e.js @@ -1,4 +1,4 @@ -import{m as qe}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as qe}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/index-3502a0fe.js b/docs/assets/index-7530a5d9.js similarity index 95% rename from docs/assets/index-3502a0fe.js rename to docs/assets/index-7530a5d9.js index 4515aff..c65f187 100644 --- a/docs/assets/index-3502a0fe.js +++ b/docs/assets/index-7530a5d9.js @@ -30,14 +30,14 @@ var NMe=Object.defineProperty;var RMe=(i,e,t)=>e in i?NMe(i,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Qhe=C,su=pW;function Nt(i){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+i,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mW=Object.prototype.hasOwnProperty,oPe=/^[: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]*$/,Dte={},Ite={};function sPe(i){return mW.call(Ite,i)?!0:mW.call(Dte,i)?!1:oPe.test(i)?Ite[i]=!0:(Dte[i]=!0,!1)}function aPe(i,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function lPe(i,e,t,n){if(e===null||typeof e>"u"||aPe(i,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Fl(i,e,t,n,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ia={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){Ia[i]=new Fl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];Ia[e]=new Fl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){Ia[i]=new Fl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){Ia[i]=new Fl(i,2,!1,i,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(i){Ia[i]=new Fl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){Ia[i]=new Fl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){Ia[i]=new Fl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){Ia[i]=new Fl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){Ia[i]=new Fl(i,5,!1,i.toLowerCase(),null,!1,!1)});var CG=/[\-:]([a-z])/g;function yG(i){return i[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(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){Ia[i]=new Fl(i,1,!1,i.toLowerCase(),null,!1,!1)});Ia.xlinkHref=new Fl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){Ia[i]=new Fl(i,1,!1,i.toLowerCase(),null,!0,!0)});function wG(i,e,t,n){var r=Ia.hasOwnProperty(e)?Ia[e]:null;(r!==null?r.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mW=Object.prototype.hasOwnProperty,oPe=/^[: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]*$/,Dte={},Ite={};function sPe(i){return mW.call(Ite,i)?!0:mW.call(Dte,i)?!1:oPe.test(i)?Ite[i]=!0:(Dte[i]=!0,!1)}function aPe(i,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function lPe(i,e,t,n){if(e===null||typeof e>"u"||aPe(i,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Fl(i,e,t,n,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ia={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){Ia[i]=new Fl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];Ia[e]=new Fl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){Ia[i]=new Fl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){Ia[i]=new Fl(i,2,!1,i,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(i){Ia[i]=new Fl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){Ia[i]=new Fl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){Ia[i]=new Fl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){Ia[i]=new Fl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){Ia[i]=new Fl(i,5,!1,i.toLowerCase(),null,!1,!1)});var CG=/[\-:]([a-z])/g;function yG(i){return i[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(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(CG,yG);Ia[e]=new Fl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){Ia[i]=new Fl(i,1,!1,i.toLowerCase(),null,!1,!1)});Ia.xlinkHref=new Fl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){Ia[i]=new Fl(i,1,!1,i.toLowerCase(),null,!0,!0)});function wG(i,e,t,n){var r=Ia.hasOwnProperty(e)?Ia[e]:null;(r!==null?r.type!==0:n||!(2a||r[s]!==o[a]){var l=` -`+r[s].replace(" at new "," at ");return i.displayName&&l.includes("")&&(l=l.replace("",i.displayName)),l}while(1<=s&&0<=a);break}}}finally{N8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?TL(i):""}function cPe(i){switch(i.tag){case 5:return TL(i.type);case 16:return TL("Lazy");case 13:return TL("Suspense");case 19:return TL("SuspenseList");case 0:case 2:case 15:return i=R8(i.type,!1),i;case 11:return i=R8(i.type.render,!1),i;case 1:return i=R8(i.type,!0),i;default:return""}}function CW(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case G1:return"Fragment";case K1:return"Portal";case vW:return"Profiler";case SG:return"StrictMode";case _W:return"Suspense";case bW:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case tfe:return(i.displayName||"Context")+".Consumer";case efe:return(i._context.displayName||"Context")+".Provider";case xG:var e=i.render;return i=i.displayName,i||(i=e.displayName||e.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case LG:return e=i.displayName||null,e!==null?e:CW(i.type)||"Memo";case Tm:e=i._payload,i=i._init;try{return CW(i(e))}catch{}}return null}function uPe(i){var e=i.type;switch(i.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 i=e.render,i=i.displayName||i.name||"",e.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return CW(e);case 8:return e===SG?"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 Hv(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ife(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dPe(i){var e=ife(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function jN(i){i._valueTracker||(i._valueTracker=dPe(i))}function rfe(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=ife(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function bP(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function yW(i,e){var t=e.checked;return Ro({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??i._wrapperState.initialChecked})}function Tte(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Hv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ofe(i,e){e=e.checked,e!=null&&wG(i,"checked",e,!1)}function wW(i,e){ofe(i,e);var t=Hv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?SW(i,e.type,t):e.hasOwnProperty("defaultValue")&&SW(i,e.type,Hv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function Nte(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function SW(i,e,t){(e!=="number"||bP(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}var NL=Array.isArray;function My(i,e,t,n){if(i=i.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=KN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function vD(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var hE={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},hPe=["Webkit","ms","Moz","O"];Object.keys(hE).forEach(function(i){hPe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),hE[e]=hE[i]})});function cfe(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||hE.hasOwnProperty(i)&&hE[i]?(""+e).trim():e+"px"}function ufe(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,r=cfe(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,r):i[t]=r}}var fPe=Ro({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 EW(i,e){if(e){if(fPe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Nt(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Nt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Nt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Nt(62))}}function DW(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){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 IW=null;function EG(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var kW=null,Py=null,Ay=null;function Pte(i){if(i=Bk(i)){if(typeof kW!="function")throw Error(Nt(280));var e=i.stateNode;e&&(e=AF(e),kW(i.stateNode,i.type,e))}}function dfe(i){Py?Ay?Ay.push(i):Ay=[i]:Py=i}function hfe(){if(Py){var i=Py,e=Ay;if(Ay=Py=null,Pte(i),e)for(i=0;i>>=0,i===0?32:31-(xPe(i)/LPe|0)|0}var GN=64,qN=4194304;function RL(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function SP(i,e){var t=i.pendingLanes;if(t===0)return 0;var n=0,r=i.suspendedLanes,o=i.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?n=RL(a):(o&=s,o!==0&&(n=RL(o)))}else s=t&~r,s!==0?n=RL(s):o!==0&&(n=RL(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&r)&&(r=n&-n,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(n&4&&(n|=t&16),e=i.entangledLanes,e!==0)for(i=i.entanglements,e&=n;0t;t++)e.push(i);return e}function Ok(i,e,t){i.pendingLanes|=e,e!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,e=31-Jd(e),i[e]=t}function kPe(i,e){var t=i.pendingLanes&~e;i.pendingLanes=e,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=e,i.mutableReadLanes&=e,i.entangledLanes&=e,e=i.entanglements;var n=i.eventTimes;for(i=i.expirationTimes;0=gE),zte=String.fromCharCode(32),Ute=!1;function Rfe(i,e){switch(i){case"keyup":return iAe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mfe(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var q1=!1;function oAe(i,e){switch(i){case"compositionend":return Mfe(e);case"keypress":return e.which!==32?null:(Ute=!0,zte);case"textInput":return i=e.data,i===zte&&Ute?null:i;default:return null}}function sAe(i,e){if(q1)return i==="compositionend"||!PG&&Rfe(i,e)?(i=Tfe(),lM=NG=jm=null,q1=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=qte(t)}}function Ffe(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?Ffe(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function Bfe(){for(var i=window,e=bP();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=bP(i.document)}return e}function AG(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}function pAe(i){var e=Bfe(),t=i.focusedElem,n=i.selectionRange;if(e!==t&&t&&t.ownerDocument&&Ffe(t.ownerDocument.documentElement,t)){if(n!==null&&AG(t)){if(e=n.start,i=n.end,i===void 0&&(i=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(i,t.value.length);else if(i=(e=t.ownerDocument||document)&&e.defaultView||window,i.getSelection){i=i.getSelection();var r=t.textContent.length,o=Math.min(n.start,r);n=n.end===void 0?o:Math.min(n.end,r),!i.extend&&o>n&&(r=n,n=o,o=r),r=Xte(t,o);var s=Xte(t,n);r&&s&&(i.rangeCount!==1||i.anchorNode!==r.node||i.anchorOffset!==r.offset||i.focusNode!==s.node||i.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),i.removeAllRanges(),o>n?(i.addRange(e),i.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),i.addRange(e)))}}for(e=[],i=t;i=i.parentNode;)i.nodeType===1&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,X1=null,AW=null,mE=null,OW=!1;function Yte(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;OW||X1==null||X1!==bP(n)||(n=X1,"selectionStart"in n&&AG(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),mE&&SD(mE,n)||(mE=n,n=EP(AW,"onSelect"),0Q1||(i.current=VW[Q1],VW[Q1]=null,Q1--)}function Qr(i,e){Q1++,VW[Q1]=i.current,i.current=e}var Vv={},rl=S_(Vv),hc=S_(!1),Sb=Vv;function Sw(i,e){var t=i.type.contextTypes;if(!t)return Vv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=r),r}function fc(i){return i=i.childContextTypes,i!=null}function IP(){co(hc),co(rl)}function ine(i,e,t){if(rl.current!==Vv)throw Error(Nt(168));Qr(rl,e),Qr(hc,t)}function Gfe(i,e,t){var n=i.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(Nt(108,uPe(i)||"Unknown",r));return Ro({},t,n)}function kP(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Vv,Sb=rl.current,Qr(rl,i),Qr(hc,hc.current),!0}function rne(i,e,t){var n=i.stateNode;if(!n)throw Error(Nt(169));t?(i=Gfe(i,e,Sb),n.__reactInternalMemoizedMergedChildContext=i,co(hc),co(rl),Qr(rl,i)):co(hc),Qr(hc,t)}var Og=null,OF=!1,K8=!1;function qfe(i){Og===null?Og=[i]:Og.push(i)}function DAe(i){OF=!0,qfe(i)}function x_(){if(!K8&&Og!==null){K8=!0;var i=0,e=Sr;try{var t=Og;for(Sr=1;i>=s,r-=s,Xg=1<<32-Jd(e)+r|t<k?(T=D,D=null):T=D.sibling;var M=h(v,D,y[k],S);if(M===null){D===null&&(D=T);break}i&&D&&M.alternate===null&&e(v,D),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M,D=T}if(k===y.length)return t(v,D),bo&&h0(v,k),L;if(D===null){for(;kk?(T=D,D=null):T=D.sibling;var P=h(v,D,M.value,S);if(P===null){D===null&&(D=T);break}i&&D&&P.alternate===null&&e(v,D),_=o(P,_,k),E===null?L=P:E.sibling=P,E=P,D=T}if(M.done)return t(v,D),bo&&h0(v,k),L;if(D===null){for(;!M.done;k++,M=y.next())M=d(v,M.value,S),M!==null&&(_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return bo&&h0(v,k),L}for(D=n(v,D);!M.done;k++,M=y.next())M=f(D,v,k,M.value,S),M!==null&&(i&&M.alternate!==null&&D.delete(M.key===null?k:M.key),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return i&&D.forEach(function(N){return e(v,N)}),bo&&h0(v,k),L}function m(v,_,y,S){if(typeof y=="object"&&y!==null&&y.type===G1&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case UN:e:{for(var L=y.key,E=_;E!==null;){if(E.key===L){if(L=y.type,L===G1){if(E.tag===7){t(v,E.sibling),_=r(E,y.props.children),_.return=v,v=_;break e}}else if(E.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Tm&&dne(L)===E.type){t(v,E.sibling),_=r(E,y.props),_.ref=Fx(v,E,y),_.return=v,v=_;break e}t(v,E);break}else e(v,E);E=E.sibling}y.type===G1?(_=rb(y.props.children,v.mode,S,y.key),_.return=v,v=_):(S=mM(y.type,y.key,y.props,null,v.mode,S),S.ref=Fx(v,_,y),S.return=v,v=S)}return s(v);case K1:e:{for(E=y.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===y.containerInfo&&_.stateNode.implementation===y.implementation){t(v,_.sibling),_=r(_,y.children||[]),_.return=v,v=_;break e}else{t(v,_);break}else e(v,_);_=_.sibling}_=e6(y,v.mode,S),_.return=v,v=_}return s(v);case Tm:return E=y._init,m(v,_,E(y._payload),S)}if(NL(y))return g(v,_,y,S);if(Rx(y))return p(v,_,y,S);tR(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,_!==null&&_.tag===6?(t(v,_.sibling),_=r(_,y),_.return=v,v=_):(t(v,_),_=J8(y,v.mode,S),_.return=v,v=_),s(v)):t(v,_)}return m}var Lw=nge(!0),ige=nge(!1),Wk={},Tf=S_(Wk),DD=S_(Wk),ID=S_(Wk);function W0(i){if(i===Wk)throw Error(Nt(174));return i}function UG(i,e){switch(Qr(ID,e),Qr(DD,i),Qr(Tf,Wk),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:LW(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=LW(e,i)}co(Tf),Qr(Tf,e)}function Ew(){co(Tf),co(DD),co(ID)}function rge(i){W0(ID.current);var e=W0(Tf.current),t=LW(e,i.type);e!==t&&(Qr(DD,i),Qr(Tf,t))}function jG(i){DD.current===i&&(co(Tf),co(DD))}var Lo=S_(0);function AP(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var G8=[];function KG(){for(var i=0;it?t:4,i(!0);var n=q8.transition;q8.transition={};try{i(!1),e()}finally{Sr=t,q8.transition=n}}function Cge(){return rd().memoizedState}function NAe(i,e,t){var n=_v(i);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},yge(i))wge(e,t);else if(t=Qfe(i,e,t,n),t!==null){var r=Dl();eh(t,i,n,r),Sge(t,e,n)}}function RAe(i,e,t){var n=_v(i),r={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(yge(i))wge(e,r);else{var o=i.alternate;if(i.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,ch(a,s)){var l=e.interleaved;l===null?(r.next=r,VG(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=Qfe(i,e,r,n),t!==null&&(r=Dl(),eh(t,i,n,r),Sge(t,e,n))}}function yge(i){var e=i.alternate;return i===To||e!==null&&e===To}function wge(i,e){vE=OP=!0;var t=i.pending;t===null?e.next=e:(e.next=t.next,t.next=e),i.pending=e}function Sge(i,e,t){if(t&4194240){var n=e.lanes;n&=i.pendingLanes,t|=n,e.lanes=t,IG(i,t)}}var FP={readContext:id,useCallback:za,useContext:za,useEffect:za,useImperativeHandle:za,useInsertionEffect:za,useLayoutEffect:za,useMemo:za,useReducer:za,useRef:za,useState:za,useDebugValue:za,useDeferredValue:za,useTransition:za,useMutableSource:za,useSyncExternalStore:za,useId:za,unstable_isNewReconciler:!1},MAe={readContext:id,useCallback:function(i,e){return Qh().memoizedState=[i,e===void 0?null:e],i},useContext:id,useEffect:fne,useImperativeHandle:function(i,e,t){return t=t!=null?t.concat([i]):null,hM(4194308,4,pge.bind(null,e,i),t)},useLayoutEffect:function(i,e){return hM(4194308,4,i,e)},useInsertionEffect:function(i,e){return hM(4,2,i,e)},useMemo:function(i,e){var t=Qh();return e=e===void 0?null:e,i=i(),t.memoizedState=[i,e],i},useReducer:function(i,e,t){var n=Qh();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:e},n.queue=i,i=i.dispatch=NAe.bind(null,To,i),[n.memoizedState,i]},useRef:function(i){var e=Qh();return i={current:i},e.memoizedState=i},useState:hne,useDebugValue:ZG,useDeferredValue:function(i){return Qh().memoizedState=i},useTransition:function(){var i=hne(!1),e=i[0];return i=TAe.bind(null,i[1]),Qh().memoizedState=i,[e,i]},useMutableSource:function(){},useSyncExternalStore:function(i,e,t){var n=To,r=Qh();if(bo){if(t===void 0)throw Error(Nt(407));t=t()}else{if(t=e(),Qs===null)throw Error(Nt(349));Lb&30||age(n,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,fne(cge.bind(null,n,o,i),[i]),n.flags|=2048,ND(9,lge.bind(null,n,o,t,e),void 0,null),t},useId:function(){var i=Qh(),e=Qs.identifierPrefix;if(bo){var t=Yg,n=Xg;t=(n&~(1<<32-Jd(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=kD++,0")&&(l=l.replace("",i.displayName)),l}while(1<=s&&0<=a);break}}}finally{N8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?TL(i):""}function cPe(i){switch(i.tag){case 5:return TL(i.type);case 16:return TL("Lazy");case 13:return TL("Suspense");case 19:return TL("SuspenseList");case 0:case 2:case 15:return i=R8(i.type,!1),i;case 11:return i=R8(i.type.render,!1),i;case 1:return i=R8(i.type,!0),i;default:return""}}function CW(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case G1:return"Fragment";case K1:return"Portal";case vW:return"Profiler";case SG:return"StrictMode";case _W:return"Suspense";case bW:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case tfe:return(i.displayName||"Context")+".Consumer";case efe:return(i._context.displayName||"Context")+".Provider";case xG:var e=i.render;return i=i.displayName,i||(i=e.displayName||e.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case LG:return e=i.displayName||null,e!==null?e:CW(i.type)||"Memo";case Tm:e=i._payload,i=i._init;try{return CW(i(e))}catch{}}return null}function uPe(i){var e=i.type;switch(i.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 i=e.render,i=i.displayName||i.name||"",e.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return CW(e);case 8:return e===SG?"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 Hv(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ife(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dPe(i){var e=ife(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function jN(i){i._valueTracker||(i._valueTracker=dPe(i))}function rfe(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=ife(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function bP(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function yW(i,e){var t=e.checked;return Ro({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??i._wrapperState.initialChecked})}function Tte(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Hv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ofe(i,e){e=e.checked,e!=null&&wG(i,"checked",e,!1)}function wW(i,e){ofe(i,e);var t=Hv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?SW(i,e.type,t):e.hasOwnProperty("defaultValue")&&SW(i,e.type,Hv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function Nte(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function SW(i,e,t){(e!=="number"||bP(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}var NL=Array.isArray;function My(i,e,t,n){if(i=i.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=KN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function vD(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var hE={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},hPe=["Webkit","ms","Moz","O"];Object.keys(hE).forEach(function(i){hPe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),hE[e]=hE[i]})});function cfe(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||hE.hasOwnProperty(i)&&hE[i]?(""+e).trim():e+"px"}function ufe(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,r=cfe(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,r):i[t]=r}}var fPe=Ro({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 EW(i,e){if(e){if(fPe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Nt(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Nt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Nt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Nt(62))}}function DW(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){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 IW=null;function EG(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var kW=null,Py=null,Ay=null;function Pte(i){if(i=Bk(i)){if(typeof kW!="function")throw Error(Nt(280));var e=i.stateNode;e&&(e=AF(e),kW(i.stateNode,i.type,e))}}function dfe(i){Py?Ay?Ay.push(i):Ay=[i]:Py=i}function hfe(){if(Py){var i=Py,e=Ay;if(Ay=Py=null,Pte(i),e)for(i=0;i>>=0,i===0?32:31-(xPe(i)/LPe|0)|0}var GN=64,qN=4194304;function RL(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function SP(i,e){var t=i.pendingLanes;if(t===0)return 0;var n=0,r=i.suspendedLanes,o=i.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?n=RL(a):(o&=s,o!==0&&(n=RL(o)))}else s=t&~r,s!==0?n=RL(s):o!==0&&(n=RL(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&r)&&(r=n&-n,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(n&4&&(n|=t&16),e=i.entangledLanes,e!==0)for(i=i.entanglements,e&=n;0t;t++)e.push(i);return e}function Ok(i,e,t){i.pendingLanes|=e,e!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,e=31-Jd(e),i[e]=t}function kPe(i,e){var t=i.pendingLanes&~e;i.pendingLanes=e,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=e,i.mutableReadLanes&=e,i.entangledLanes&=e,e=i.entanglements;var n=i.eventTimes;for(i=i.expirationTimes;0=gE),zte=String.fromCharCode(32),Ute=!1;function Rfe(i,e){switch(i){case"keyup":return iAe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mfe(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var q1=!1;function oAe(i,e){switch(i){case"compositionend":return Mfe(e);case"keypress":return e.which!==32?null:(Ute=!0,zte);case"textInput":return i=e.data,i===zte&&Ute?null:i;default:return null}}function sAe(i,e){if(q1)return i==="compositionend"||!PG&&Rfe(i,e)?(i=Tfe(),lM=NG=jm=null,q1=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=qte(t)}}function Ffe(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?Ffe(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function Bfe(){for(var i=window,e=bP();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=bP(i.document)}return e}function AG(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}function pAe(i){var e=Bfe(),t=i.focusedElem,n=i.selectionRange;if(e!==t&&t&&t.ownerDocument&&Ffe(t.ownerDocument.documentElement,t)){if(n!==null&&AG(t)){if(e=n.start,i=n.end,i===void 0&&(i=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(i,t.value.length);else if(i=(e=t.ownerDocument||document)&&e.defaultView||window,i.getSelection){i=i.getSelection();var r=t.textContent.length,o=Math.min(n.start,r);n=n.end===void 0?o:Math.min(n.end,r),!i.extend&&o>n&&(r=n,n=o,o=r),r=Xte(t,o);var s=Xte(t,n);r&&s&&(i.rangeCount!==1||i.anchorNode!==r.node||i.anchorOffset!==r.offset||i.focusNode!==s.node||i.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),i.removeAllRanges(),o>n?(i.addRange(e),i.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),i.addRange(e)))}}for(e=[],i=t;i=i.parentNode;)i.nodeType===1&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,X1=null,AW=null,mE=null,OW=!1;function Yte(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;OW||X1==null||X1!==bP(n)||(n=X1,"selectionStart"in n&&AG(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),mE&&SD(mE,n)||(mE=n,n=EP(AW,"onSelect"),0Q1||(i.current=VW[Q1],VW[Q1]=null,Q1--)}function Qr(i,e){Q1++,VW[Q1]=i.current,i.current=e}var Vv={},rl=x_(Vv),hc=x_(!1),xb=Vv;function Sw(i,e){var t=i.type.contextTypes;if(!t)return Vv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=r),r}function fc(i){return i=i.childContextTypes,i!=null}function IP(){co(hc),co(rl)}function ine(i,e,t){if(rl.current!==Vv)throw Error(Nt(168));Qr(rl,e),Qr(hc,t)}function Gfe(i,e,t){var n=i.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(Nt(108,uPe(i)||"Unknown",r));return Ro({},t,n)}function kP(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Vv,xb=rl.current,Qr(rl,i),Qr(hc,hc.current),!0}function rne(i,e,t){var n=i.stateNode;if(!n)throw Error(Nt(169));t?(i=Gfe(i,e,xb),n.__reactInternalMemoizedMergedChildContext=i,co(hc),co(rl),Qr(rl,i)):co(hc),Qr(hc,t)}var Og=null,OF=!1,K8=!1;function qfe(i){Og===null?Og=[i]:Og.push(i)}function DAe(i){OF=!0,qfe(i)}function L_(){if(!K8&&Og!==null){K8=!0;var i=0,e=Sr;try{var t=Og;for(Sr=1;i>=s,r-=s,Xg=1<<32-Jd(e)+r|t<k?(T=D,D=null):T=D.sibling;var M=h(v,D,y[k],S);if(M===null){D===null&&(D=T);break}i&&D&&M.alternate===null&&e(v,D),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M,D=T}if(k===y.length)return t(v,D),bo&&f0(v,k),L;if(D===null){for(;kk?(T=D,D=null):T=D.sibling;var P=h(v,D,M.value,S);if(P===null){D===null&&(D=T);break}i&&D&&P.alternate===null&&e(v,D),_=o(P,_,k),E===null?L=P:E.sibling=P,E=P,D=T}if(M.done)return t(v,D),bo&&f0(v,k),L;if(D===null){for(;!M.done;k++,M=y.next())M=d(v,M.value,S),M!==null&&(_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return bo&&f0(v,k),L}for(D=n(v,D);!M.done;k++,M=y.next())M=f(D,v,k,M.value,S),M!==null&&(i&&M.alternate!==null&&D.delete(M.key===null?k:M.key),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return i&&D.forEach(function(N){return e(v,N)}),bo&&f0(v,k),L}function m(v,_,y,S){if(typeof y=="object"&&y!==null&&y.type===G1&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case UN:e:{for(var L=y.key,E=_;E!==null;){if(E.key===L){if(L=y.type,L===G1){if(E.tag===7){t(v,E.sibling),_=r(E,y.props.children),_.return=v,v=_;break e}}else if(E.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Tm&&dne(L)===E.type){t(v,E.sibling),_=r(E,y.props),_.ref=Fx(v,E,y),_.return=v,v=_;break e}t(v,E);break}else e(v,E);E=E.sibling}y.type===G1?(_=ob(y.props.children,v.mode,S,y.key),_.return=v,v=_):(S=mM(y.type,y.key,y.props,null,v.mode,S),S.ref=Fx(v,_,y),S.return=v,v=S)}return s(v);case K1:e:{for(E=y.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===y.containerInfo&&_.stateNode.implementation===y.implementation){t(v,_.sibling),_=r(_,y.children||[]),_.return=v,v=_;break e}else{t(v,_);break}else e(v,_);_=_.sibling}_=e6(y,v.mode,S),_.return=v,v=_}return s(v);case Tm:return E=y._init,m(v,_,E(y._payload),S)}if(NL(y))return g(v,_,y,S);if(Rx(y))return p(v,_,y,S);tR(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,_!==null&&_.tag===6?(t(v,_.sibling),_=r(_,y),_.return=v,v=_):(t(v,_),_=J8(y,v.mode,S),_.return=v,v=_),s(v)):t(v,_)}return m}var Lw=nge(!0),ige=nge(!1),Wk={},Tf=x_(Wk),DD=x_(Wk),ID=x_(Wk);function $0(i){if(i===Wk)throw Error(Nt(174));return i}function UG(i,e){switch(Qr(ID,e),Qr(DD,i),Qr(Tf,Wk),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:LW(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=LW(e,i)}co(Tf),Qr(Tf,e)}function Ew(){co(Tf),co(DD),co(ID)}function rge(i){$0(ID.current);var e=$0(Tf.current),t=LW(e,i.type);e!==t&&(Qr(DD,i),Qr(Tf,t))}function jG(i){DD.current===i&&(co(Tf),co(DD))}var Lo=x_(0);function AP(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var G8=[];function KG(){for(var i=0;it?t:4,i(!0);var n=q8.transition;q8.transition={};try{i(!1),e()}finally{Sr=t,q8.transition=n}}function Cge(){return rd().memoizedState}function NAe(i,e,t){var n=_v(i);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},yge(i))wge(e,t);else if(t=Qfe(i,e,t,n),t!==null){var r=Dl();eh(t,i,n,r),Sge(t,e,n)}}function RAe(i,e,t){var n=_v(i),r={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(yge(i))wge(e,r);else{var o=i.alternate;if(i.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,ch(a,s)){var l=e.interleaved;l===null?(r.next=r,VG(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=Qfe(i,e,r,n),t!==null&&(r=Dl(),eh(t,i,n,r),Sge(t,e,n))}}function yge(i){var e=i.alternate;return i===To||e!==null&&e===To}function wge(i,e){vE=OP=!0;var t=i.pending;t===null?e.next=e:(e.next=t.next,t.next=e),i.pending=e}function Sge(i,e,t){if(t&4194240){var n=e.lanes;n&=i.pendingLanes,t|=n,e.lanes=t,IG(i,t)}}var FP={readContext:id,useCallback:za,useContext:za,useEffect:za,useImperativeHandle:za,useInsertionEffect:za,useLayoutEffect:za,useMemo:za,useReducer:za,useRef:za,useState:za,useDebugValue:za,useDeferredValue:za,useTransition:za,useMutableSource:za,useSyncExternalStore:za,useId:za,unstable_isNewReconciler:!1},MAe={readContext:id,useCallback:function(i,e){return Qh().memoizedState=[i,e===void 0?null:e],i},useContext:id,useEffect:fne,useImperativeHandle:function(i,e,t){return t=t!=null?t.concat([i]):null,hM(4194308,4,pge.bind(null,e,i),t)},useLayoutEffect:function(i,e){return hM(4194308,4,i,e)},useInsertionEffect:function(i,e){return hM(4,2,i,e)},useMemo:function(i,e){var t=Qh();return e=e===void 0?null:e,i=i(),t.memoizedState=[i,e],i},useReducer:function(i,e,t){var n=Qh();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:e},n.queue=i,i=i.dispatch=NAe.bind(null,To,i),[n.memoizedState,i]},useRef:function(i){var e=Qh();return i={current:i},e.memoizedState=i},useState:hne,useDebugValue:ZG,useDeferredValue:function(i){return Qh().memoizedState=i},useTransition:function(){var i=hne(!1),e=i[0];return i=TAe.bind(null,i[1]),Qh().memoizedState=i,[e,i]},useMutableSource:function(){},useSyncExternalStore:function(i,e,t){var n=To,r=Qh();if(bo){if(t===void 0)throw Error(Nt(407));t=t()}else{if(t=e(),Qs===null)throw Error(Nt(349));Eb&30||age(n,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,fne(cge.bind(null,n,o,i),[i]),n.flags|=2048,ND(9,lge.bind(null,n,o,t,e),void 0,null),t},useId:function(){var i=Qh(),e=Qs.identifierPrefix;if(bo){var t=Yg,n=Xg;t=(n&~(1<<32-Jd(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=kD++,0<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[hf]=e,i[ED]=n,Rge(i,e,!1,!1),e.stateNode=i;e:{switch(s=DW(t,n),t){case"dialog":io("cancel",i),io("close",i),r=n;break;case"iframe":case"object":case"embed":io("load",i),r=n;break;case"video":case"audio":for(r=0;rIw&&(e.flags|=128,n=!0,Bx(o,!1),e.lanes=4194304)}else{if(!n)if(i=AP(s),i!==null){if(e.flags|=128,n=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Bx(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!bo)return Ua(e),null}else 2*Qo()-o.renderingStartTime>Iw&&t!==1073741824&&(e.flags|=128,n=!0,Bx(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Qo(),e.sibling=null,t=Lo.current,Qr(Lo,n?t&1|2:t&1),e):(Ua(e),null);case 22:case 23:return iq(),n=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?zc&1073741824&&(Ua(e),e.subtreeFlags&6&&(e.flags|=8192)):Ua(e),null;case 24:return null;case 25:return null}throw Error(Nt(156,e.tag))}function HAe(i,e){switch(FG(e),e.tag){case 1:return fc(e.type)&&IP(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return Ew(),co(hc),co(rl),KG(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return jG(e),null;case 13:if(co(Lo),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(Nt(340));xw()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return co(Lo),null;case 4:return Ew(),null;case 10:return HG(e.type._context),null;case 22:case 23:return iq(),null;case 24:return null;default:return null}}var iR=!1,Qa=!1,VAe=typeof WeakSet=="function"?WeakSet:Set,sn=null;function ny(i,e){var t=i.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Wo(i,e,n)}else t.current=null}function e$(i,e,t){try{t()}catch(n){Wo(i,e,n)}}var wne=!1;function zAe(i,e){if(FW=xP,i=Bfe(),AG(i)){if("selectionStart"in i)var t={start:i.selectionStart,end:i.selectionEnd};else e:{t=(t=i.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=i,h=null;t:for(;;){for(var f;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===i)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===n&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(BW={focusedElem:i,selectionRange:t},xP=!1,sn=e;sn!==null;)if(e=sn,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,sn=i;else for(;sn!==null;){e=sn;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,v=e.stateNode,_=v.getSnapshotBeforeUpdate(e.elementType===e.type?p:Rd(e.type,p),m);v.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Nt(163))}}catch(S){Wo(e,e.return,S)}if(i=e.sibling,i!==null){i.return=e.return,sn=i;break}sn=e.return}return g=wne,wne=!1,g}function _E(i,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&i)===i){var o=r.destroy;r.destroy=void 0,o!==void 0&&e$(e,t,o)}r=r.next}while(r!==n)}}function WF(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&i)===i){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function t$(i){var e=i.ref;if(e!==null){var t=i.stateNode;switch(i.tag){case 5:i=t;break;default:i=t}typeof e=="function"?e(i):e.current=i}}function Age(i){var e=i.alternate;e!==null&&(i.alternate=null,Age(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[hf],delete e[ED],delete e[HW],delete e[LAe],delete e[EAe])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Oge(i){return i.tag===5||i.tag===3||i.tag===4}function Sne(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Oge(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function n$(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=DP));else if(n!==4&&(i=i.child,i!==null))for(n$(i,e,t),i=i.sibling;i!==null;)n$(i,e,t),i=i.sibling}function i$(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(i$(i,e,t),i=i.sibling;i!==null;)i$(i,e,t),i=i.sibling}var ca=null,Ad=!1;function lm(i,e,t){for(t=t.child;t!==null;)Fge(i,e,t),t=t.sibling}function Fge(i,e,t){if(kf&&typeof kf.onCommitFiberUnmount=="function")try{kf.onCommitFiberUnmount(NF,t)}catch{}switch(t.tag){case 5:Qa||ny(t,e);case 6:var n=ca,r=Ad;ca=null,lm(i,e,t),ca=n,Ad=r,ca!==null&&(Ad?(i=ca,t=t.stateNode,i.nodeType===8?i.parentNode.removeChild(t):i.removeChild(t)):ca.removeChild(t.stateNode));break;case 18:ca!==null&&(Ad?(i=ca,t=t.stateNode,i.nodeType===8?j8(i.parentNode,t):i.nodeType===1&&j8(i,t),yD(i)):j8(ca,t.stateNode));break;case 4:n=ca,r=Ad,ca=t.stateNode.containerInfo,Ad=!0,lm(i,e,t),ca=n,Ad=r;break;case 0:case 11:case 14:case 15:if(!Qa&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){r=n=n.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&e$(t,e,s),r=r.next}while(r!==n)}lm(i,e,t);break;case 1:if(!Qa&&(ny(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(a){Wo(t,e,a)}lm(i,e,t);break;case 21:lm(i,e,t);break;case 22:t.mode&1?(Qa=(n=Qa)||t.memoizedState!==null,lm(i,e,t),Qa=n):lm(i,e,t);break;default:lm(i,e,t)}}function xne(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var t=i.stateNode;t===null&&(t=i.stateNode=new VAe),e.forEach(function(n){var r=QAe.bind(null,i,n);t.has(n)||(t.add(n),n.then(r,r))})}}function wd(i,e){var t=e.deletions;if(t!==null)for(var n=0;nr&&(r=s),n&=~o}if(n=r,n=Qo()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jAe(n/1960))-n,10i?16:i,Km===null)var n=!1;else{if(i=Km,Km=null,$P=0,Ji&6)throw Error(Nt(331));var r=Ji;for(Ji|=4,sn=i.current;sn!==null;){var o=sn,s=o.child;if(sn.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lQo()-tq?ib(i,0):eq|=t),gc(i,e)}function jge(i,e){e===0&&(i.mode&1?(e=qN,qN<<=1,!(qN&130023424)&&(qN=4194304)):e=1);var t=Dl();i=Dp(i,e),i!==null&&(Ok(i,e,t),gc(i,t))}function ZAe(i){var e=i.memoizedState,t=0;e!==null&&(t=e.retryLane),jge(i,t)}function QAe(i,e){var t=0;switch(i.tag){case 13:var n=i.stateNode,r=i.memoizedState;r!==null&&(t=r.retryLane);break;case 19:n=i.stateNode;break;default:throw Error(Nt(314))}n!==null&&n.delete(e),jge(i,t)}var Kge;Kge=function(i,e,t){if(i!==null)if(i.memoizedProps!==e.pendingProps||hc.current)uc=!0;else{if(!(i.lanes&t)&&!(e.flags&128))return uc=!1,WAe(i,e,t);uc=!!(i.flags&131072)}else uc=!1,bo&&e.flags&1048576&&Xfe(e,NP,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;fM(i,e),i=e.pendingProps;var r=Sw(e,rl.current);Fy(e,t),r=qG(null,e,n,i,r,t);var o=XG();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,fc(n)?(o=!0,kP(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,zG(e),r.updater=FF,e.stateNode=r,r._reactInternals=e,GW(e,n,i,t),e=YW(null,e,n,!0,o,t)):(e.tag=0,bo&&o&&OG(e),wl(null,e,r,t),e=e.child),e;case 16:n=e.elementType;e:{switch(fM(i,e),i=e.pendingProps,r=n._init,n=r(n._payload),e.type=n,r=e.tag=eOe(n),i=Rd(n,i),r){case 0:e=XW(null,e,n,i,t);break e;case 1:e=bne(null,e,n,i,t);break e;case 11:e=vne(null,e,n,i,t);break e;case 14:e=_ne(null,e,n,Rd(n.type,i),t);break e}throw Error(Nt(306,n,""))}return e;case 0:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),XW(i,e,n,r,t);case 1:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),bne(i,e,n,r,t);case 3:e:{if(kge(e),i===null)throw Error(Nt(387));n=e.pendingProps,o=e.memoizedState,r=o.element,Jfe(i,e),PP(e,n,null,t);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=Dw(Error(Nt(423)),e),e=Cne(i,e,n,t,r);break e}else if(n!==r){r=Dw(Error(Nt(424)),e),e=Cne(i,e,n,t,r);break e}else for(Xc=pv(e.stateNode.containerInfo.firstChild),tu=e,bo=!0,$d=null,t=ige(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(xw(),n===r){e=Ip(i,e,t);break e}wl(i,e,n,t)}e=e.child}return e;case 5:return rge(e),i===null&&UW(e),n=e.type,r=e.pendingProps,o=i!==null?i.memoizedProps:null,s=r.children,WW(n,r)?s=null:o!==null&&WW(n,o)&&(e.flags|=32),Ige(i,e),wl(i,e,s,t),e.child;case 6:return i===null&&UW(e),null;case 13:return Tge(i,e,t);case 4:return UG(e,e.stateNode.containerInfo),n=e.pendingProps,i===null?e.child=Lw(e,null,n,t):wl(i,e,n,t),e.child;case 11:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),vne(i,e,n,r,t);case 7:return wl(i,e,e.pendingProps,t),e.child;case 8:return wl(i,e,e.pendingProps.children,t),e.child;case 12:return wl(i,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,Qr(RP,n._currentValue),n._currentValue=s,o!==null)if(ch(o.value,s)){if(o.children===r.children&&!hc.current){e=Ip(i,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=gp(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),jW(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Nt(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),jW(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}wl(i,e,r.children,t),e=e.child}return e;case 9:return r=e.type,n=e.pendingProps.children,Fy(e,t),r=id(r),n=n(r),e.flags|=1,wl(i,e,n,t),e.child;case 14:return n=e.type,r=Rd(n,e.pendingProps),r=Rd(n.type,r),_ne(i,e,n,r,t);case 15:return Ege(i,e,e.type,e.pendingProps,t);case 17:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),fM(i,e),e.tag=1,fc(n)?(i=!0,kP(e)):i=!1,Fy(e,t),tge(e,n,r),GW(e,n,r,t),YW(null,e,n,!0,i,t);case 19:return Nge(i,e,t);case 22:return Dge(i,e,t)}throw Error(Nt(156,e.tag))};function Gge(i,e){return bfe(i,e)}function JAe(i,e,t,n){this.tag=i,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ju(i,e,t,n){return new JAe(i,e,t,n)}function oq(i){return i=i.prototype,!(!i||!i.isReactComponent)}function eOe(i){if(typeof i=="function")return oq(i)?1:0;if(i!=null){if(i=i.$$typeof,i===xG)return 11;if(i===LG)return 14}return 2}function bv(i,e){var t=i.alternate;return t===null?(t=ju(i.tag,e,i.key,i.mode),t.elementType=i.elementType,t.type=i.type,t.stateNode=i.stateNode,t.alternate=i,i.alternate=t):(t.pendingProps=e,t.type=i.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=i.flags&14680064,t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,e=i.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=i.sibling,t.index=i.index,t.ref=i.ref,t}function mM(i,e,t,n,r,o){var s=2;if(n=i,typeof i=="function")oq(i)&&(s=1);else if(typeof i=="string")s=5;else e:switch(i){case G1:return rb(t.children,r,o,e);case SG:s=8,r|=8;break;case vW:return i=ju(12,t,e,r|2),i.elementType=vW,i.lanes=o,i;case _W:return i=ju(13,t,e,r),i.elementType=_W,i.lanes=o,i;case bW:return i=ju(19,t,e,r),i.elementType=bW,i.lanes=o,i;case nfe:return HF(t,r,o,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case efe:s=10;break e;case tfe:s=9;break e;case xG:s=11;break e;case LG:s=14;break e;case Tm:s=16,n=null;break e}throw Error(Nt(130,i==null?i:typeof i,""))}return e=ju(s,t,e,r),e.elementType=i,e.type=n,e.lanes=o,e}function rb(i,e,t,n){return i=ju(7,i,n,e),i.lanes=t,i}function HF(i,e,t,n){return i=ju(22,i,n,e),i.elementType=nfe,i.lanes=t,i.stateNode={isHidden:!1},i}function J8(i,e,t){return i=ju(6,i,null,e),i.lanes=t,i}function e6(i,e,t){return e=ju(4,i.children!==null?i.children:[],i.key,e),e.lanes=t,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function tOe(i,e,t,n,r){this.tag=e,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=P8(0),this.expirationTimes=P8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P8(0),this.identifierPrefix=n,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function sq(i,e,t,n,r,o,s,a,l){return i=new tOe(i,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=ju(3,null,null,e),i.current=o,o.stateNode=i,o.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},zG(o),i}function nOe(i,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),i.exports=hu})(iPe);const kw=Vhe(lh),aOe=Hhe({__proto__:null,default:kw},[lh]);var Rne=lh;gW.createRoot=Rne.createRoot,gW.hydrateRoot=Rne.hydrateRoot;var l$={},lOe={get exports(){return l$},set exports(i){l$=i}},Zge={};/** +`+o.stack}return{value:i,source:e,stack:r,digest:null}}function Z8(i,e,t){return{value:i,source:null,stack:t??null,digest:e??null}}function qW(i,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var OAe=typeof WeakMap=="function"?WeakMap:Map;function xge(i,e,t){t=gp(-1,t),t.tag=3,t.payload={element:null};var n=e.value;return t.callback=function(){WP||(WP=!0,r$=n),qW(i,e)},t}function Lge(i,e,t){t=gp(-1,t),t.tag=3;var n=i.type.getDerivedStateFromError;if(typeof n=="function"){var r=e.value;t.payload=function(){return n(r)},t.callback=function(){qW(i,e)}}var o=i.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){qW(i,e),typeof n!="function"&&(vv===null?vv=new Set([this]):vv.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}function gne(i,e,t){var n=i.pingCache;if(n===null){n=i.pingCache=new OAe;var r=new Set;n.set(e,r)}else r=n.get(e),r===void 0&&(r=new Set,n.set(e,r));r.has(t)||(r.add(t),i=YAe.bind(null,i,e,t),e.then(i,i))}function pne(i){do{var e;if((e=i.tag===13)&&(e=i.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return i;i=i.return}while(i!==null);return null}function mne(i,e,t,n,r){return i.mode&1?(i.flags|=65536,i.lanes=r,i):(i===e?i.flags|=65536:(i.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=gp(-1,1),e.tag=2,mv(t,e,1))),t.lanes|=1),i)}var FAe=Up.ReactCurrentOwner,uc=!1;function wl(i,e,t,n){e.child=i===null?ige(e,null,t,n):Lw(e,i.child,t,n)}function vne(i,e,t,n,r){t=t.render;var o=e.ref;return Fy(e,r),n=qG(i,e,t,n,o,r),t=XG(),i!==null&&!uc?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~r,Ip(i,e,r)):(bo&&t&&OG(e),e.flags|=1,wl(i,e,n,r),e.child)}function _ne(i,e,t,n,r){if(i===null){var o=t.type;return typeof o=="function"&&!oq(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,Ege(i,e,o,n,r)):(i=mM(t.type,null,n,e,e.mode,r),i.ref=e.ref,i.return=e,e.child=i)}if(o=i.child,!(i.lanes&r)){var s=o.memoizedProps;if(t=t.compare,t=t!==null?t:SD,t(s,n)&&i.ref===e.ref)return Ip(i,e,r)}return e.flags|=1,i=bv(o,n),i.ref=e.ref,i.return=e,e.child=i}function Ege(i,e,t,n,r){if(i!==null){var o=i.memoizedProps;if(SD(o,n)&&i.ref===e.ref)if(uc=!1,e.pendingProps=n=o,(i.lanes&r)!==0)i.flags&131072&&(uc=!0);else return e.lanes=i.lanes,Ip(i,e,r)}return XW(i,e,t,n,r)}function Dge(i,e,t){var n=e.pendingProps,r=n.children,o=i!==null?i.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qr(iy,zc),zc|=t;else{if(!(t&1073741824))return i=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:i,cachePool:null,transitions:null},e.updateQueue=null,Qr(iy,zc),zc|=i,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:t,Qr(iy,zc),zc|=n}else o!==null?(n=o.baseLanes|t,e.memoizedState=null):n=t,Qr(iy,zc),zc|=n;return wl(i,e,r,t),e.child}function Ige(i,e){var t=e.ref;(i===null&&t!==null||i!==null&&i.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function XW(i,e,t,n,r){var o=fc(t)?xb:rl.current;return o=Sw(e,o),Fy(e,r),t=qG(i,e,t,n,o,r),n=XG(),i!==null&&!uc?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~r,Ip(i,e,r)):(bo&&n&&OG(e),e.flags|=1,wl(i,e,t,r),e.child)}function bne(i,e,t,n,r){if(fc(t)){var o=!0;kP(e)}else o=!1;if(Fy(e,r),e.stateNode===null)fM(i,e),tge(e,t,n),GW(e,t,n,r),n=!0;else if(i===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=t.contextType;typeof c=="object"&&c!==null?c=id(c):(c=fc(t)?xb:rl.current,c=Sw(e,c));var u=t.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==n||l!==c)&&une(e,s,n,c),Nm=!1;var h=e.memoizedState;s.state=h,PP(e,n,s,r),l=e.memoizedState,a!==n||h!==l||hc.current||Nm?(typeof u=="function"&&(KW(e,t,u,n),l=e.memoizedState),(a=Nm||cne(e,t,a,n,h,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=c,n=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,Jfe(i,e),a=e.memoizedProps,c=e.type===e.elementType?a:Rd(e.type,a),s.props=c,d=e.pendingProps,h=s.context,l=t.contextType,typeof l=="object"&&l!==null?l=id(l):(l=fc(t)?xb:rl.current,l=Sw(e,l));var f=t.getDerivedStateFromProps;(u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&une(e,s,n,l),Nm=!1,h=e.memoizedState,s.state=h,PP(e,n,s,r);var g=e.memoizedState;a!==d||h!==g||hc.current||Nm?(typeof f=="function"&&(KW(e,t,f,n),g=e.memoizedState),(c=Nm||cne(e,t,c,n,h,g,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=g),s.props=n,s.state=g,s.context=l,n=c):(typeof s.componentDidUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=1024),n=!1)}return YW(i,e,t,n,o,r)}function YW(i,e,t,n,r,o){Ige(i,e);var s=(e.flags&128)!==0;if(!n&&!s)return r&&rne(e,t,!1),Ip(i,e,o);n=e.stateNode,FAe.current=e;var a=s&&typeof t.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,i!==null&&s?(e.child=Lw(e,i.child,null,o),e.child=Lw(e,null,a,o)):wl(i,e,a,o),e.memoizedState=n.state,r&&rne(e,t,!0),e.child}function kge(i){var e=i.stateNode;e.pendingContext?ine(i,e.pendingContext,e.pendingContext!==e.context):e.context&&ine(i,e.context,!1),UG(i,e.containerInfo)}function Cne(i,e,t,n,r){return xw(),BG(r),e.flags|=256,wl(i,e,t,n),e.child}var ZW={dehydrated:null,treeContext:null,retryLane:0};function QW(i){return{baseLanes:i,cachePool:null,transitions:null}}function Tge(i,e,t){var n=e.pendingProps,r=Lo.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=i!==null&&i.memoizedState===null?!1:(r&2)!==0),a?(o=!0,e.flags&=-129):(i===null||i.memoizedState!==null)&&(r|=1),Qr(Lo,r&1),i===null)return UW(e),i=e.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(e.mode&1?i.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,i=n.fallback,o?(n=e.mode,o=e.child,s={mode:"hidden",children:s},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=HF(s,n,0,null),i=ob(i,n,t,null),o.return=e,i.return=e,o.sibling=i,e.child=o,e.child.memoizedState=QW(t),e.memoizedState=ZW,i):QG(e,s));if(r=i.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return BAe(i,e,s,n,a,r,t);if(o){o=n.fallback,s=e.mode,r=i.child,a=r.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==r?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=bv(r,l),n.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=bv(a,o):(o=ob(o,s,t,null),o.flags|=2),o.return=e,n.return=e,n.sibling=o,e.child=n,n=o,o=e.child,s=i.child.memoizedState,s=s===null?QW(t):{baseLanes:s.baseLanes|t,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=i.childLanes&~t,e.memoizedState=ZW,n}return o=i.child,i=o.sibling,n=bv(o,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=t),n.return=e,n.sibling=null,i!==null&&(t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)),e.child=n,e.memoizedState=null,n}function QG(i,e){return e=HF({mode:"visible",children:e},i.mode,0,null),e.return=i,i.child=e}function nR(i,e,t,n){return n!==null&&BG(n),Lw(e,i.child,null,t),i=QG(e,e.pendingProps.children),i.flags|=2,e.memoizedState=null,i}function BAe(i,e,t,n,r,o,s){if(t)return e.flags&256?(e.flags&=-257,n=Z8(Error(Nt(422))),nR(i,e,s,n)):e.memoizedState!==null?(e.child=i.child,e.flags|=128,null):(o=n.fallback,r=e.mode,n=HF({mode:"visible",children:n.children},r,0,null),o=ob(o,r,s,null),o.flags|=2,n.return=e,o.return=e,n.sibling=o,e.child=n,e.mode&1&&Lw(e,i.child,null,s),e.child.memoizedState=QW(s),e.memoizedState=ZW,o);if(!(e.mode&1))return nR(i,e,s,null);if(r.data==="$!"){if(n=r.nextSibling&&r.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(Nt(419)),n=Z8(o,n,void 0),nR(i,e,s,n)}if(a=(s&i.childLanes)!==0,uc||a){if(n=Qs,n!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(n.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,Dp(i,r),eh(n,i,r,-1))}return rq(),n=Z8(Error(Nt(421))),nR(i,e,s,n)}return r.data==="$?"?(e.flags|=128,e.child=i.child,e=ZAe.bind(null,i),r._reactRetry=e,null):(i=o.treeContext,Xc=pv(r.nextSibling),tu=e,bo=!0,$d=null,i!==null&&(Hu[Vu++]=Xg,Hu[Vu++]=Yg,Hu[Vu++]=Lb,Xg=i.id,Yg=i.overflow,Lb=e),e=QG(e,n.children),e.flags|=4096,e)}function yne(i,e,t){i.lanes|=e;var n=i.alternate;n!==null&&(n.lanes|=e),jW(i.return,e,t)}function Q8(i,e,t,n,r){var o=i.memoizedState;o===null?i.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:t,tailMode:r}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=t,o.tailMode=r)}function Nge(i,e,t){var n=e.pendingProps,r=n.revealOrder,o=n.tail;if(wl(i,e,n.children,t),n=Lo.current,n&2)n=n&1|2,e.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=e.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&yne(i,t,e);else if(i.tag===19)yne(i,t,e);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}n&=1}if(Qr(Lo,n),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)i=t.alternate,i!==null&&AP(i)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),Q8(e,!1,r,t,o);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(i=r.alternate,i!==null&&AP(i)===null){e.child=r;break}i=r.sibling,r.sibling=t,t=r,r=i}Q8(e,!0,t,null,o);break;case"together":Q8(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function fM(i,e){!(e.mode&1)&&i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2)}function Ip(i,e,t){if(i!==null&&(e.dependencies=i.dependencies),Db|=e.lanes,!(t&e.childLanes))return null;if(i!==null&&e.child!==i.child)throw Error(Nt(153));if(e.child!==null){for(i=e.child,t=bv(i,i.pendingProps),e.child=t,t.return=e;i.sibling!==null;)i=i.sibling,t=t.sibling=bv(i,i.pendingProps),t.return=e;t.sibling=null}return e.child}function WAe(i,e,t){switch(e.tag){case 3:kge(e),xw();break;case 5:rge(e);break;case 1:fc(e.type)&&kP(e);break;case 4:UG(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,r=e.memoizedProps.value;Qr(RP,n._currentValue),n._currentValue=r;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Qr(Lo,Lo.current&1),e.flags|=128,null):t&e.child.childLanes?Tge(i,e,t):(Qr(Lo,Lo.current&1),i=Ip(i,e,t),i!==null?i.sibling:null);Qr(Lo,Lo.current&1);break;case 19:if(n=(t&e.childLanes)!==0,i.flags&128){if(n)return Nge(i,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Qr(Lo,Lo.current),n)break;return null;case 22:case 23:return e.lanes=0,Dge(i,e,t)}return Ip(i,e,t)}var Rge,JW,Mge,Pge;Rge=function(i,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)i.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};JW=function(){};Mge=function(i,e,t,n){var r=i.memoizedProps;if(r!==n){i=e.stateNode,$0(Tf.current);var o=null;switch(t){case"input":r=yW(i,r),n=yW(i,n),o=[];break;case"select":r=Ro({},r,{value:void 0}),n=Ro({},n,{value:void 0}),o=[];break;case"textarea":r=xW(i,r),n=xW(i,n),o=[];break;default:typeof r.onClick!="function"&&typeof n.onClick=="function"&&(i.onclick=DP)}EW(t,n);var s;t=null;for(c in r)if(!n.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(t||(t={}),t[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(mD.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=r!=null?r[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(t||(t={}),t[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(t||(t={}),t[s]=l[s])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(mD.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&io("scroll",i),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};Pge=function(i,e,t,n){t!==n&&(e.flags|=4)};function Bx(i,e){if(!bo)switch(i.tailMode){case"hidden":e=i.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?i.tail=null:t.sibling=null;break;case"collapsed":t=i.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e||i.tail===null?i.tail=null:i.tail.sibling=null:n.sibling=null}}function Ua(i){var e=i.alternate!==null&&i.alternate.child===i.child,t=0,n=0;if(e)for(var r=i.child;r!==null;)t|=r.lanes|r.childLanes,n|=r.subtreeFlags&14680064,n|=r.flags&14680064,r.return=i,r=r.sibling;else for(r=i.child;r!==null;)t|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=i,r=r.sibling;return i.subtreeFlags|=n,i.childLanes=t,e}function $Ae(i,e,t){var n=e.pendingProps;switch(FG(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ua(e),null;case 1:return fc(e.type)&&IP(),Ua(e),null;case 3:return n=e.stateNode,Ew(),co(hc),co(rl),KG(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(i===null||i.child===null)&&(eR(e)?e.flags|=4:i===null||i.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,$d!==null&&(a$($d),$d=null))),JW(i,e),Ua(e),null;case 5:jG(e);var r=$0(ID.current);if(t=e.type,i!==null&&e.stateNode!=null)Mge(i,e,t,n,r),i.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Nt(166));return Ua(e),null}if(i=$0(Tf.current),eR(e)){n=e.stateNode,t=e.type;var o=e.memoizedProps;switch(n[hf]=e,n[ED]=o,i=(e.mode&1)!==0,t){case"dialog":io("cancel",n),io("close",n);break;case"iframe":case"object":case"embed":io("load",n);break;case"video":case"audio":for(r=0;r<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[hf]=e,i[ED]=n,Rge(i,e,!1,!1),e.stateNode=i;e:{switch(s=DW(t,n),t){case"dialog":io("cancel",i),io("close",i),r=n;break;case"iframe":case"object":case"embed":io("load",i),r=n;break;case"video":case"audio":for(r=0;rIw&&(e.flags|=128,n=!0,Bx(o,!1),e.lanes=4194304)}else{if(!n)if(i=AP(s),i!==null){if(e.flags|=128,n=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Bx(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!bo)return Ua(e),null}else 2*Qo()-o.renderingStartTime>Iw&&t!==1073741824&&(e.flags|=128,n=!0,Bx(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Qo(),e.sibling=null,t=Lo.current,Qr(Lo,n?t&1|2:t&1),e):(Ua(e),null);case 22:case 23:return iq(),n=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?zc&1073741824&&(Ua(e),e.subtreeFlags&6&&(e.flags|=8192)):Ua(e),null;case 24:return null;case 25:return null}throw Error(Nt(156,e.tag))}function HAe(i,e){switch(FG(e),e.tag){case 1:return fc(e.type)&&IP(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return Ew(),co(hc),co(rl),KG(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return jG(e),null;case 13:if(co(Lo),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(Nt(340));xw()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return co(Lo),null;case 4:return Ew(),null;case 10:return HG(e.type._context),null;case 22:case 23:return iq(),null;case 24:return null;default:return null}}var iR=!1,Qa=!1,VAe=typeof WeakSet=="function"?WeakSet:Set,sn=null;function ny(i,e){var t=i.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Wo(i,e,n)}else t.current=null}function e$(i,e,t){try{t()}catch(n){Wo(i,e,n)}}var wne=!1;function zAe(i,e){if(FW=xP,i=Bfe(),AG(i)){if("selectionStart"in i)var t={start:i.selectionStart,end:i.selectionEnd};else e:{t=(t=i.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=i,h=null;t:for(;;){for(var f;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===i)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===n&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(BW={focusedElem:i,selectionRange:t},xP=!1,sn=e;sn!==null;)if(e=sn,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,sn=i;else for(;sn!==null;){e=sn;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,v=e.stateNode,_=v.getSnapshotBeforeUpdate(e.elementType===e.type?p:Rd(e.type,p),m);v.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Nt(163))}}catch(S){Wo(e,e.return,S)}if(i=e.sibling,i!==null){i.return=e.return,sn=i;break}sn=e.return}return g=wne,wne=!1,g}function _E(i,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&i)===i){var o=r.destroy;r.destroy=void 0,o!==void 0&&e$(e,t,o)}r=r.next}while(r!==n)}}function WF(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&i)===i){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function t$(i){var e=i.ref;if(e!==null){var t=i.stateNode;switch(i.tag){case 5:i=t;break;default:i=t}typeof e=="function"?e(i):e.current=i}}function Age(i){var e=i.alternate;e!==null&&(i.alternate=null,Age(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[hf],delete e[ED],delete e[HW],delete e[LAe],delete e[EAe])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Oge(i){return i.tag===5||i.tag===3||i.tag===4}function Sne(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Oge(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function n$(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=DP));else if(n!==4&&(i=i.child,i!==null))for(n$(i,e,t),i=i.sibling;i!==null;)n$(i,e,t),i=i.sibling}function i$(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(i$(i,e,t),i=i.sibling;i!==null;)i$(i,e,t),i=i.sibling}var ca=null,Ad=!1;function lm(i,e,t){for(t=t.child;t!==null;)Fge(i,e,t),t=t.sibling}function Fge(i,e,t){if(kf&&typeof kf.onCommitFiberUnmount=="function")try{kf.onCommitFiberUnmount(NF,t)}catch{}switch(t.tag){case 5:Qa||ny(t,e);case 6:var n=ca,r=Ad;ca=null,lm(i,e,t),ca=n,Ad=r,ca!==null&&(Ad?(i=ca,t=t.stateNode,i.nodeType===8?i.parentNode.removeChild(t):i.removeChild(t)):ca.removeChild(t.stateNode));break;case 18:ca!==null&&(Ad?(i=ca,t=t.stateNode,i.nodeType===8?j8(i.parentNode,t):i.nodeType===1&&j8(i,t),yD(i)):j8(ca,t.stateNode));break;case 4:n=ca,r=Ad,ca=t.stateNode.containerInfo,Ad=!0,lm(i,e,t),ca=n,Ad=r;break;case 0:case 11:case 14:case 15:if(!Qa&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){r=n=n.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&e$(t,e,s),r=r.next}while(r!==n)}lm(i,e,t);break;case 1:if(!Qa&&(ny(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(a){Wo(t,e,a)}lm(i,e,t);break;case 21:lm(i,e,t);break;case 22:t.mode&1?(Qa=(n=Qa)||t.memoizedState!==null,lm(i,e,t),Qa=n):lm(i,e,t);break;default:lm(i,e,t)}}function xne(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var t=i.stateNode;t===null&&(t=i.stateNode=new VAe),e.forEach(function(n){var r=QAe.bind(null,i,n);t.has(n)||(t.add(n),n.then(r,r))})}}function wd(i,e){var t=e.deletions;if(t!==null)for(var n=0;nr&&(r=s),n&=~o}if(n=r,n=Qo()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jAe(n/1960))-n,10i?16:i,Km===null)var n=!1;else{if(i=Km,Km=null,$P=0,er&6)throw Error(Nt(331));var r=er;for(er|=4,sn=i.current;sn!==null;){var o=sn,s=o.child;if(sn.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lQo()-tq?rb(i,0):eq|=t),gc(i,e)}function jge(i,e){e===0&&(i.mode&1?(e=qN,qN<<=1,!(qN&130023424)&&(qN=4194304)):e=1);var t=Dl();i=Dp(i,e),i!==null&&(Ok(i,e,t),gc(i,t))}function ZAe(i){var e=i.memoizedState,t=0;e!==null&&(t=e.retryLane),jge(i,t)}function QAe(i,e){var t=0;switch(i.tag){case 13:var n=i.stateNode,r=i.memoizedState;r!==null&&(t=r.retryLane);break;case 19:n=i.stateNode;break;default:throw Error(Nt(314))}n!==null&&n.delete(e),jge(i,t)}var Kge;Kge=function(i,e,t){if(i!==null)if(i.memoizedProps!==e.pendingProps||hc.current)uc=!0;else{if(!(i.lanes&t)&&!(e.flags&128))return uc=!1,WAe(i,e,t);uc=!!(i.flags&131072)}else uc=!1,bo&&e.flags&1048576&&Xfe(e,NP,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;fM(i,e),i=e.pendingProps;var r=Sw(e,rl.current);Fy(e,t),r=qG(null,e,n,i,r,t);var o=XG();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,fc(n)?(o=!0,kP(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,zG(e),r.updater=FF,e.stateNode=r,r._reactInternals=e,GW(e,n,i,t),e=YW(null,e,n,!0,o,t)):(e.tag=0,bo&&o&&OG(e),wl(null,e,r,t),e=e.child),e;case 16:n=e.elementType;e:{switch(fM(i,e),i=e.pendingProps,r=n._init,n=r(n._payload),e.type=n,r=e.tag=eOe(n),i=Rd(n,i),r){case 0:e=XW(null,e,n,i,t);break e;case 1:e=bne(null,e,n,i,t);break e;case 11:e=vne(null,e,n,i,t);break e;case 14:e=_ne(null,e,n,Rd(n.type,i),t);break e}throw Error(Nt(306,n,""))}return e;case 0:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),XW(i,e,n,r,t);case 1:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),bne(i,e,n,r,t);case 3:e:{if(kge(e),i===null)throw Error(Nt(387));n=e.pendingProps,o=e.memoizedState,r=o.element,Jfe(i,e),PP(e,n,null,t);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=Dw(Error(Nt(423)),e),e=Cne(i,e,n,t,r);break e}else if(n!==r){r=Dw(Error(Nt(424)),e),e=Cne(i,e,n,t,r);break e}else for(Xc=pv(e.stateNode.containerInfo.firstChild),tu=e,bo=!0,$d=null,t=ige(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(xw(),n===r){e=Ip(i,e,t);break e}wl(i,e,n,t)}e=e.child}return e;case 5:return rge(e),i===null&&UW(e),n=e.type,r=e.pendingProps,o=i!==null?i.memoizedProps:null,s=r.children,WW(n,r)?s=null:o!==null&&WW(n,o)&&(e.flags|=32),Ige(i,e),wl(i,e,s,t),e.child;case 6:return i===null&&UW(e),null;case 13:return Tge(i,e,t);case 4:return UG(e,e.stateNode.containerInfo),n=e.pendingProps,i===null?e.child=Lw(e,null,n,t):wl(i,e,n,t),e.child;case 11:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),vne(i,e,n,r,t);case 7:return wl(i,e,e.pendingProps,t),e.child;case 8:return wl(i,e,e.pendingProps.children,t),e.child;case 12:return wl(i,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,Qr(RP,n._currentValue),n._currentValue=s,o!==null)if(ch(o.value,s)){if(o.children===r.children&&!hc.current){e=Ip(i,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=gp(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),jW(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Nt(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),jW(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}wl(i,e,r.children,t),e=e.child}return e;case 9:return r=e.type,n=e.pendingProps.children,Fy(e,t),r=id(r),n=n(r),e.flags|=1,wl(i,e,n,t),e.child;case 14:return n=e.type,r=Rd(n,e.pendingProps),r=Rd(n.type,r),_ne(i,e,n,r,t);case 15:return Ege(i,e,e.type,e.pendingProps,t);case 17:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:Rd(n,r),fM(i,e),e.tag=1,fc(n)?(i=!0,kP(e)):i=!1,Fy(e,t),tge(e,n,r),GW(e,n,r,t),YW(null,e,n,!0,i,t);case 19:return Nge(i,e,t);case 22:return Dge(i,e,t)}throw Error(Nt(156,e.tag))};function Gge(i,e){return bfe(i,e)}function JAe(i,e,t,n){this.tag=i,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ju(i,e,t,n){return new JAe(i,e,t,n)}function oq(i){return i=i.prototype,!(!i||!i.isReactComponent)}function eOe(i){if(typeof i=="function")return oq(i)?1:0;if(i!=null){if(i=i.$$typeof,i===xG)return 11;if(i===LG)return 14}return 2}function bv(i,e){var t=i.alternate;return t===null?(t=ju(i.tag,e,i.key,i.mode),t.elementType=i.elementType,t.type=i.type,t.stateNode=i.stateNode,t.alternate=i,i.alternate=t):(t.pendingProps=e,t.type=i.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=i.flags&14680064,t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,e=i.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=i.sibling,t.index=i.index,t.ref=i.ref,t}function mM(i,e,t,n,r,o){var s=2;if(n=i,typeof i=="function")oq(i)&&(s=1);else if(typeof i=="string")s=5;else e:switch(i){case G1:return ob(t.children,r,o,e);case SG:s=8,r|=8;break;case vW:return i=ju(12,t,e,r|2),i.elementType=vW,i.lanes=o,i;case _W:return i=ju(13,t,e,r),i.elementType=_W,i.lanes=o,i;case bW:return i=ju(19,t,e,r),i.elementType=bW,i.lanes=o,i;case nfe:return HF(t,r,o,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case efe:s=10;break e;case tfe:s=9;break e;case xG:s=11;break e;case LG:s=14;break e;case Tm:s=16,n=null;break e}throw Error(Nt(130,i==null?i:typeof i,""))}return e=ju(s,t,e,r),e.elementType=i,e.type=n,e.lanes=o,e}function ob(i,e,t,n){return i=ju(7,i,n,e),i.lanes=t,i}function HF(i,e,t,n){return i=ju(22,i,n,e),i.elementType=nfe,i.lanes=t,i.stateNode={isHidden:!1},i}function J8(i,e,t){return i=ju(6,i,null,e),i.lanes=t,i}function e6(i,e,t){return e=ju(4,i.children!==null?i.children:[],i.key,e),e.lanes=t,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function tOe(i,e,t,n,r){this.tag=e,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=P8(0),this.expirationTimes=P8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P8(0),this.identifierPrefix=n,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function sq(i,e,t,n,r,o,s,a,l){return i=new tOe(i,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=ju(3,null,null,e),i.current=o,o.stateNode=i,o.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},zG(o),i}function nOe(i,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),i.exports=hu})(iPe);const kw=Vhe(lh),aOe=Hhe({__proto__:null,default:kw},[lh]);var Rne=lh;gW.createRoot=Rne.createRoot,gW.hydrateRoot=Rne.hydrateRoot;var l$={},lOe={get exports(){return l$},set exports(i){l$=i}},Zge={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -77,7 +77,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function zi(){return zi=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u")throw new Error(e)}function Nw(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function nFe(){return Math.random().toString(36).substr(2,8)}function One(i,e){return{usr:i.state,key:i.key,idx:e}}function PD(i,e,t,n){return t===void 0&&(t=null),zi({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof e=="string"?jp(e):e,{state:t,key:e&&e.key||n||nFe()})}function Ib(i){let{pathname:e="/",search:t="",hash:n=""}=i;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jp(i){let e={};if(i){let t=i.indexOf("#");t>=0&&(e.hash=i.substr(t),i=i.substr(0,t));let n=i.indexOf("?");n>=0&&(e.search=i.substr(n),i=i.substr(0,n)),i&&(e.pathname=i)}return e}function iFe(i,e,t,n){n===void 0&&(n={});let{window:r=document.defaultView,v5Compat:o=!1}=n,s=r.history,a=ss.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(zi({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=ss.Pop;let m=u(),v=m==null?null:m-c;c=m,l&&l({action:a,location:p.location,delta:v})}function h(m,v){a=ss.Push;let _=PD(p.location,m,v);t&&t(_,m),c=u()+1;let y=One(_,c),S=p.createHref(_);try{s.pushState(y,"",S)}catch{r.location.assign(S)}o&&l&&l({action:a,location:p.location,delta:1})}function f(m,v){a=ss.Replace;let _=PD(p.location,m,v);t&&t(_,m),c=u();let y=One(_,c),S=p.createHref(_);s.replaceState(y,"",S),o&&l&&l({action:a,location:p.location,delta:0})}function g(m){let v=r.location.origin!=="null"?r.location.origin:r.location.href,_=typeof m=="string"?m:Ib(m);return Ci(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let p={get action(){return a},get location(){return i(r,s)},listen(m){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Ane,d),l=m,()=>{r.removeEventListener(Ane,d),l=null}},createHref(m){return e(r,m)},createURL:g,encodeLocation(m){let v=g(m);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(m){return s.go(m)}};return p}var Ds;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(Ds||(Ds={}));const rFe=new Set(["lazy","caseSensitive","path","id","index","children"]);function oFe(i){return i.index===!0}function ape(i,e,t,n){return t===void 0&&(t=[]),n===void 0&&(n={}),i.map((r,o)=>{let s=[...t,o],a=typeof r.id=="string"?r.id:s.join("-");if(Ci(r.index!==!0||!r.children,"Cannot specify children on an index route"),Ci(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),oFe(r)){let l=zi({},r,{hasErrorBoundary:e(r),id:a});return n[a]=l,l}else{let l=zi({},r,{id:a,hasErrorBoundary:e(r),children:void 0});return n[a]=l,r.children&&(l.children=ape(r.children,e,s,n)),l}})}function ry(i,e,t){t===void 0&&(t="/");let n=typeof e=="string"?jp(e):e,r=f4(n.pathname||"/",t);if(r==null)return null;let o=lpe(i);sFe(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Ci(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=ob([n,l.relativePath]),u=t.concat(l);o.children&&o.children.length>0&&(Ci(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),lpe(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:fFe(c,o.index),routesMeta:u})};return i.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of cpe(o.path))r(o,s,l)}),e}function cpe(i){let e=i.split("/");if(e.length===0)return[];let[t,...n]=e,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(n.length===0)return r?[o,""]:[o];let s=cpe(n.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>i.startsWith("/")&&l===""?"/":l)}function sFe(i){i.sort((e,t)=>e.score!==t.score?t.score-e.score:gFe(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const aFe=/^:\w+$/,lFe=3,cFe=2,uFe=1,dFe=10,hFe=-2,Fne=i=>i==="*";function fFe(i,e){let t=i.split("/"),n=t.length;return t.some(Fne)&&(n+=hFe),e&&(n+=cFe),t.filter(r=>!Fne(r)).reduce((r,o)=>r+(aFe.test(o)?lFe:o===""?uFe:dFe),n)}function gFe(i,e){return i.length===e.length&&i.slice(0,-1).every((n,r)=>n===e[r])?i[i.length-1]-e[e.length-1]:0}function pFe(i,e){let{routesMeta:t}=i,n={},r="/",o=[];for(let s=0;s{if(u==="*"){let h=a[d]||"";s=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}return c[u]=bFe(a[d]||"",u),c},{}),pathname:o,pathnameBase:s,pattern:i}}function vFe(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Nw(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let n=[],r="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(n.push(a),"/([^\\/]+)"));return i.endsWith("*")?(n.push("*"),r+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":i!==""&&i!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}function _Fe(i){try{return decodeURI(i)}catch(e){return Nw(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),i}}function bFe(i,e){try{return decodeURIComponent(i)}catch(t){return Nw(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+i+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),i}}function f4(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=i.charAt(t);return n&&n!=="/"?null:i.slice(t)||"/"}function CFe(i,e){e===void 0&&(e="/");let{pathname:t,search:n="",hash:r=""}=typeof i=="string"?jp(i):i;return{pathname:t?t.startsWith("/")?t:yFe(t,e):e,search:xFe(n),hash:LFe(r)}}function yFe(i,e){let t=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function n6(i,e,t,n){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function upe(i){return i.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function wFe(i,e,t,n){n===void 0&&(n=!1);let r;typeof i=="string"?r=jp(i):(r=zi({},i),Ci(!r.pathname||!r.pathname.includes("?"),n6("?","pathname","search",r)),Ci(!r.pathname||!r.pathname.includes("#"),n6("#","pathname","hash",r)),Ci(!r.search||!r.search.includes("#"),n6("#","search","hash",r)));let o=i===""||r.pathname==="",s=o?"/":r.pathname,a;if(n||s==null)a=t;else{let d=e.length-1;if(s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;r.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=CFe(r,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const ob=i=>i.join("/").replace(/\/\/+/g,"/"),SFe=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),xFe=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,LFe=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;class pq{constructor(e,t,n,r){r===void 0&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function dpe(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const hpe=["post","put","patch","delete"],EFe=new Set(hpe),DFe=["get",...hpe],IFe=new Set(DFe),kFe=new Set([301,302,303,307,308]),TFe=new Set([307,308]),i6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},NFe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Bne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fpe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gpe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RFe=!gpe,MFe=i=>!!i.hasErrorBoundary;function PFe(i){Ci(i.routes.length>0,"You must provide a non-empty routes array to createRouter");let e=i.detectErrorBoundary||MFe,t={},n=ape(i.routes,e,void 0,t),r,o=zi({v7_normalizeFormMethod:!1},i.future),s=null,a=new Set,l=null,c=null,u=null,d=i.hydrationData!=null,h=ry(n,i.history.location,i.basename),f=null;if(h==null){let oe=Jh(404,{pathname:i.history.location.pathname}),{matches:ce,route:fe}=jne(n);h=ce,f={[fe.id]:oe}}let g=!h.some(oe=>oe.route.lazy)&&(!h.some(oe=>oe.route.loader)||i.hydrationData!=null),p,m={historyAction:i.history.action,location:i.history.location,matches:h,initialized:g,navigation:i6,restoreScrollPosition:i.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:i.hydrationData&&i.hydrationData.loaderData||{},actionData:i.hydrationData&&i.hydrationData.actionData||null,errors:i.hydrationData&&i.hydrationData.errors||f,fetchers:new Map,blockers:new Map},v=ss.Pop,_=!1,y,S=!1,L=!1,E=[],D=[],k=new Map,T=0,M=-1,P=new Map,N=new Set,R=new Map,O=new Map,B=new Map,$=!1;function G(){return s=i.history.listen(oe=>{let{action:ce,location:fe,delta:Ie}=oe;if($){$=!1;return}Nw(B.size===0||Ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Te=z({currentLocation:m.location,nextLocation:fe,historyAction:ce});if(Te&&Ie!=null){$=!0,i.history.go(Ie*-1),de(Te,{state:"blocked",location:fe,proceed(){de(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),i.history.go(Ie)},reset(){ue(Te),ie({blockers:new Map(p.state.blockers)})}});return}return he(ce,fe)}),m.initialized||he(ss.Pop,m.location),p}function U(){s&&s(),a.clear(),y&&y.abort(),m.fetchers.forEach((oe,ce)=>Be(ce)),m.blockers.forEach((oe,ce)=>ue(ce))}function j(oe){return a.add(oe),()=>a.delete(oe)}function ie(oe){m=zi({},m,oe),a.forEach(ce=>ce(m))}function Y(oe,ce){var fe,Ie;let Te=m.actionData!=null&&m.navigation.formMethod!=null&&Tg(m.navigation.formMethod)&&m.navigation.state==="loading"&&((fe=oe.state)==null?void 0:fe._isRedirect)!==!0,He;ce.actionData?Object.keys(ce.actionData).length>0?He=ce.actionData:He=null:Te?He=m.actionData:He=null;let Me=ce.loaderData?Une(m.loaderData,ce.loaderData,ce.matches||[],ce.errors):m.loaderData;for(let[rt]of B)ue(rt);let bt=_===!0||m.navigation.formMethod!=null&&Tg(m.navigation.formMethod)&&((Ie=oe.state)==null?void 0:Ie._isRedirect)!==!0;r&&(n=r,r=void 0),ie(zi({},ce,{actionData:He,loaderData:Me,historyAction:v,location:oe,initialized:!0,navigation:i6,revalidation:"idle",restoreScrollPosition:pe(oe,ce.matches||m.matches),preventScrollReset:bt,blockers:new Map(m.blockers)})),S||v===ss.Pop||(v===ss.Push?i.history.push(oe,oe.state):v===ss.Replace&&i.history.replace(oe,oe.state)),v=ss.Pop,_=!1,S=!1,L=!1,E=[],D=[]}async function J(oe,ce){if(typeof oe=="number"){i.history.go(oe);return}let{path:fe,submission:Ie,error:Te}=Wne(oe,o,ce),He=m.location,Me=PD(m.location,fe,ce&&ce.state);Me=zi({},Me,i.history.encodeLocation(Me));let bt=ce&&ce.replace!=null?ce.replace:void 0,rt=ss.Push;bt===!0?rt=ss.Replace:bt===!1||Ie!=null&&Tg(Ie.formMethod)&&Ie.formAction===m.location.pathname+m.location.search&&(rt=ss.Replace);let Ht=ce&&"preventScrollReset"in ce?ce.preventScrollReset===!0:void 0,Ue=z({currentLocation:He,nextLocation:Me,historyAction:rt});if(Ue){de(Ue,{state:"blocked",location:Me,proceed(){de(Ue,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),J(oe,ce)},reset(){ue(Ue),ie({blockers:new Map(m.blockers)})}});return}return await he(rt,Me,{submission:Ie,pendingError:Te,preventScrollReset:Ht,replace:ce&&ce.replace})}function Q(){if(Le(),ie({revalidation:"loading"}),m.navigation.state!=="submitting"){if(m.navigation.state==="idle"){he(m.historyAction,m.location,{startUninterruptedRevalidation:!0});return}he(v||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation})}}async function he(oe,ce,fe){y&&y.abort(),y=null,v=oe,S=(fe&&fe.startUninterruptedRevalidation)===!0,ne(m.location,m.matches),_=(fe&&fe.preventScrollReset)===!0;let Ie=r||n,Te=fe&&fe.overrideNavigation,He=ry(Ie,ce,i.basename);if(!He){let Dt=Jh(404,{pathname:ce.pathname}),{matches:St,route:Kt}=jne(Ie);q(),Y(ce,{matches:St,loaderData:{},errors:{[Kt.id]:Dt}});return}if(WFe(m.location,ce)&&!(fe&&fe.submission&&Tg(fe.submission.formMethod))){Y(ce,{matches:He});return}y=new AbortController;let Me=Hx(i.history,ce,y.signal,fe&&fe.submission),bt,rt;if(fe&&fe.pendingError)rt={[oy(He).route.id]:fe.pendingError};else if(fe&&fe.submission&&Tg(fe.submission.formMethod)){let Dt=await ge(Me,ce,fe.submission,He,{replace:fe.replace});if(Dt.shortCircuited)return;bt=Dt.pendingActionData,rt=Dt.pendingActionError,Te=zi({state:"loading",location:ce},fe.submission),Me=new Request(Me.url,{signal:Me.signal})}let{shortCircuited:Ht,loaderData:Ue,errors:Ct}=await ye(Me,ce,He,Te,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,bt,rt);Ht||(y=null,Y(ce,zi({matches:He},bt?{actionData:bt}:{},{loaderData:Ue,errors:Ct})))}async function ge(oe,ce,fe,Ie,Te){Le();let He=zi({state:"submitting",location:ce},fe);ie({navigation:He});let Me,bt=u$(Ie,ce);if(!bt.route.action&&!bt.route.lazy)Me={type:Ds.error,error:Jh(405,{method:oe.method,pathname:ce.pathname,routeId:bt.route.id})};else if(Me=await $x("action",oe,bt,Ie,t,e,p.basename),oe.signal.aborted)return{shortCircuited:!0};if(Wy(Me)){let rt;return Te&&Te.replace!=null?rt=Te.replace:rt=Me.location===m.location.pathname+m.location.search,await _e(m,Me,{submission:fe,replace:rt}),{shortCircuited:!0}}if(yE(Me)){let rt=oy(Ie,bt.route.id);return(Te&&Te.replace)!==!0&&(v=ss.Push),{pendingActionData:{},pendingActionError:{[rt.route.id]:Me.error}}}if($0(Me))throw Jh(400,{type:"defer-action"});return{pendingActionData:{[bt.route.id]:Me.data}}}async function ye(oe,ce,fe,Ie,Te,He,Me,bt,rt){let Ht=Ie;Ht||(Ht=zi({state:"loading",location:ce,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Te));let Ue=Te||He?Te||He:Ht.formMethod&&Ht.formAction&&Ht.formData&&Ht.formEncType?{formMethod:Ht.formMethod,formAction:Ht.formAction,formData:Ht.formData,formEncType:Ht.formEncType}:void 0,Ct=r||n,[Dt,St]=$ne(i.history,m,fe,Ue,ce,L,E,D,R,Ct,i.basename,bt,rt);if(q(Lt=>!(fe&&fe.some(At=>At.route.id===Lt))||Dt&&Dt.some(At=>At.route.id===Lt)),Dt.length===0&&St.length===0)return Y(ce,zi({matches:fe,loaderData:{},errors:rt||null},bt?{actionData:bt}:{})),{shortCircuited:!0};if(!S){St.forEach(At=>{let ln=m.fetchers.get(At.key),Si={state:"loading",data:ln&&ln.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(At.key,Si)});let Lt=bt||m.actionData;ie(zi({navigation:Ht},Lt?Object.keys(Lt).length===0?{actionData:null}:{actionData:Lt}:{},St.length>0?{fetchers:new Map(m.fetchers)}:{}))}M=++T,St.forEach(Lt=>k.set(Lt.key,y));let{results:Kt,loaderResults:_n,fetcherResults:zt}=await Ve(m.matches,fe,Dt,St,oe);if(oe.signal.aborted)return{shortCircuited:!0};St.forEach(Lt=>k.delete(Lt.key));let Yt=Kne(Kt);if(Yt)return await _e(m,Yt,{replace:Me}),{shortCircuited:!0};let{loaderData:at,errors:ut}=zne(m,fe,Dt,_n,rt,St,zt,O);O.forEach((Lt,At)=>{Lt.subscribe(ln=>{(ln||Lt.done)&&O.delete(At)})}),We();let ht=dt(M);return zi({loaderData:at,errors:ut},ht||St.length>0?{fetchers:new Map(m.fetchers)}:{})}function be(oe){return m.fetchers.get(oe)||NFe}function Ge(oe,ce,fe,Ie){if(RFe)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");k.has(oe)&&Qe(oe);let He=ry(r||n,fe,i.basename);if(!He){Pe(oe,ce,Jh(404,{pathname:fe}));return}let{path:Me,submission:bt}=Wne(fe,o,Ie,!0),rt=u$(He,Me);if(_=(Ie&&Ie.preventScrollReset)===!0,bt&&Tg(bt.formMethod)){nt(oe,ce,Me,rt,He,bt);return}R.set(oe,{routeId:ce,path:Me}),je(oe,ce,Me,rt,He,bt)}async function nt(oe,ce,fe,Ie,Te,He){if(Le(),R.delete(oe),!Ie.route.action&&!Ie.route.lazy){let En=Jh(405,{method:He.formMethod,pathname:fe,routeId:ce});Pe(oe,ce,En);return}let Me=m.fetchers.get(oe),bt=zi({state:"submitting"},He,{data:Me&&Me.data," _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,bt),ie({fetchers:new Map(m.fetchers)});let rt=new AbortController,Ht=Hx(i.history,fe,rt.signal,He);k.set(oe,rt);let Ue=await $x("action",Ht,Ie,Te,t,e,p.basename);if(Ht.signal.aborted){k.get(oe)===rt&&k.delete(oe);return}if(Wy(Ue)){k.delete(oe),N.add(oe);let En=zi({state:"loading"},He,{data:void 0," _hasFetcherDoneAnything ":!0});return m.fetchers.set(oe,En),ie({fetchers:new Map(m.fetchers)}),_e(m,Ue,{submission:He,isFetchActionRedirect:!0})}if(yE(Ue)){Pe(oe,ce,Ue.error);return}if($0(Ue))throw Jh(400,{type:"defer-action"});let Ct=m.navigation.location||m.location,Dt=Hx(i.history,Ct,rt.signal),St=r||n,Kt=m.navigation.state!=="idle"?ry(St,m.navigation.location,i.basename):m.matches;Ci(Kt,"Didn't find any matches after fetcher action");let _n=++T;P.set(oe,_n);let zt=zi({state:"loading",data:Ue.data},He,{" _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,zt);let[Yt,at]=$ne(i.history,m,Kt,He,Ct,L,E,D,R,St,i.basename,{[Ie.route.id]:Ue.data},void 0);at.filter(En=>En.key!==oe).forEach(En=>{let fi=En.key,Ur=m.fetchers.get(fi),go={state:"loading",data:Ur&&Ur.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(fi,go),k.set(fi,rt)}),ie({fetchers:new Map(m.fetchers)});let{results:ut,loaderResults:ht,fetcherResults:Lt}=await Ve(m.matches,Kt,Yt,at,Dt);if(rt.signal.aborted)return;P.delete(oe),k.delete(oe),at.forEach(En=>k.delete(En.key));let At=Kne(ut);if(At)return _e(m,At);let{loaderData:ln,errors:Si}=zne(m,m.matches,Yt,ht,void 0,at,Lt,O),Xi={state:"idle",data:Ue.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(oe,Xi);let Ir=dt(_n);m.navigation.state==="loading"&&_n>M?(Ci(v,"Expected pending action"),y&&y.abort(),Y(m.navigation.location,{matches:Kt,loaderData:ln,errors:Si,fetchers:new Map(m.fetchers)})):(ie(zi({errors:Si,loaderData:Une(m.loaderData,ln,Kt,Si)},Ir?{fetchers:new Map(m.fetchers)}:{})),L=!1)}async function je(oe,ce,fe,Ie,Te,He){let Me=m.fetchers.get(oe),bt=zi({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},He,{data:Me&&Me.data," _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,bt),ie({fetchers:new Map(m.fetchers)});let rt=new AbortController,Ht=Hx(i.history,fe,rt.signal);k.set(oe,rt);let Ue=await $x("loader",Ht,Ie,Te,t,e,p.basename);if($0(Ue)&&(Ue=await _pe(Ue,Ht.signal,!0)||Ue),k.get(oe)===rt&&k.delete(oe),Ht.signal.aborted)return;if(Wy(Ue)){await _e(m,Ue);return}if(yE(Ue)){let Dt=oy(m.matches,ce);m.fetchers.delete(oe),ie({fetchers:new Map(m.fetchers),errors:{[Dt.route.id]:Ue.error}});return}Ci(!$0(Ue),"Unhandled fetcher deferred data");let Ct={state:"idle",data:Ue.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(oe,Ct),ie({fetchers:new Map(m.fetchers)})}async function _e(oe,ce,fe){var Ie;let{submission:Te,replace:He,isFetchActionRedirect:Me}=fe===void 0?{}:fe;ce.revalidate&&(L=!0);let bt=PD(oe.location,ce.location,zi({_isRedirect:!0},Me?{_isFetchActionRedirect:!0}:{}));if(Ci(bt,"Expected a location on the redirect navigation"),fpe.test(ce.location)&&gpe&&typeof((Ie=window)==null?void 0:Ie.location)<"u"){let St=i.history.createURL(ce.location),Kt=f4(St.pathname,i.basename||"/")==null;if(window.location.origin!==St.origin||Kt){He?window.location.replace(ce.location):window.location.assign(ce.location);return}}y=null;let rt=He===!0?ss.Replace:ss.Push,{formMethod:Ht,formAction:Ue,formEncType:Ct,formData:Dt}=oe.navigation;!Te&&Ht&&Ue&&Dt&&Ct&&(Te={formMethod:Ht,formAction:Ue,formEncType:Ct,formData:Dt}),TFe.has(ce.status)&&Te&&Tg(Te.formMethod)?await he(rt,bt,{submission:zi({},Te,{formAction:ce.location}),preventScrollReset:_}):Me?await he(rt,bt,{overrideNavigation:{state:"loading",location:bt,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:Te,preventScrollReset:_}):await he(rt,bt,{overrideNavigation:{state:"loading",location:bt,formMethod:Te?Te.formMethod:void 0,formAction:Te?Te.formAction:void 0,formEncType:Te?Te.formEncType:void 0,formData:Te?Te.formData:void 0},preventScrollReset:_})}async function Ve(oe,ce,fe,Ie,Te){let He=await Promise.all([...fe.map(rt=>$x("loader",Te,rt,ce,t,e,p.basename)),...Ie.map(rt=>rt.matches&&rt.match?$x("loader",Hx(i.history,rt.path,Te.signal),rt.match,rt.matches,t,e,p.basename):{type:Ds.error,error:Jh(404,{pathname:rt.path})})]),Me=He.slice(0,fe.length),bt=He.slice(fe.length);return await Promise.all([Gne(oe,fe,Me,Te.signal,!1,m.loaderData),Gne(oe,Ie.map(rt=>rt.match),bt,Te.signal,!0)]),{results:He,loaderResults:Me,fetcherResults:bt}}function Le(){L=!0,E.push(...q()),R.forEach((oe,ce)=>{k.has(ce)&&(D.push(ce),Qe(ce))})}function Pe(oe,ce,fe){let Ie=oy(m.matches,ce);Be(oe),ie({errors:{[Ie.route.id]:fe},fetchers:new Map(m.fetchers)})}function Be(oe){k.has(oe)&&Qe(oe),R.delete(oe),P.delete(oe),N.delete(oe),m.fetchers.delete(oe)}function Qe(oe){let ce=k.get(oe);Ci(ce,"Expected fetch controller: "+oe),ce.abort(),k.delete(oe)}function Ye(oe){for(let ce of oe){let Ie={state:"idle",data:be(ce).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(ce,Ie)}}function We(){let oe=[];for(let ce of N){let fe=m.fetchers.get(ce);Ci(fe,"Expected fetcher: "+ce),fe.state==="loading"&&(N.delete(ce),oe.push(ce))}Ye(oe)}function dt(oe){let ce=[];for(let[fe,Ie]of P)if(Ie0}function re(oe,ce){let fe=m.blockers.get(oe)||Bne;return B.get(oe)!==ce&&B.set(oe,ce),fe}function ue(oe){m.blockers.delete(oe),B.delete(oe)}function de(oe,ce){let fe=m.blockers.get(oe)||Bne;Ci(fe.state==="unblocked"&&ce.state==="blocked"||fe.state==="blocked"&&ce.state==="blocked"||fe.state==="blocked"&&ce.state==="proceeding"||fe.state==="blocked"&&ce.state==="unblocked"||fe.state==="proceeding"&&ce.state==="unblocked","Invalid blocker state transition: "+fe.state+" -> "+ce.state),m.blockers.set(oe,ce),ie({blockers:new Map(m.blockers)})}function z(oe){let{currentLocation:ce,nextLocation:fe,historyAction:Ie}=oe;if(B.size===0)return;B.size>1&&Nw(!1,"A router only supports one blocker at a time");let Te=Array.from(B.entries()),[He,Me]=Te[Te.length-1],bt=m.blockers.get(He);if(!(bt&&bt.state==="proceeding")&&Me({currentLocation:ce,nextLocation:fe,historyAction:Ie}))return He}function q(oe){let ce=[];return O.forEach((fe,Ie)=>{(!oe||oe(Ie))&&(fe.cancel(),ce.push(Ie),O.delete(Ie))}),ce}function se(oe,ce,fe){if(l=oe,u=ce,c=fe||(Ie=>Ie.key),!d&&m.navigation===i6){d=!0;let Ie=pe(m.location,m.matches);Ie!=null&&ie({restoreScrollPosition:Ie})}return()=>{l=null,u=null,c=null}}function ne(oe,ce){if(l&&c&&u){let fe=ce.map(Te=>qne(Te,m.loaderData)),Ie=c(oe,fe)||oe.key;l[Ie]=u()}}function pe(oe,ce){if(l&&c&&u){let fe=ce.map(He=>qne(He,m.loaderData)),Ie=c(oe,fe)||oe.key,Te=l[Ie];if(typeof Te=="number")return Te}return null}function ke(oe){r=oe}return p={get basename(){return i.basename},get state(){return m},get routes(){return n},initialize:G,subscribe:j,enableScrollRestoration:se,navigate:J,fetch:Ge,revalidate:Q,createHref:oe=>i.history.createHref(oe),encodeLocation:oe=>i.history.encodeLocation(oe),getFetcher:be,deleteFetcher:Be,dispose:U,getBlocker:re,deleteBlocker:ue,_internalFetchControllers:k,_internalActiveDeferreds:O,_internalSetRoutes:ke},p}function AFe(i){return i!=null&&"formData"in i}function Wne(i,e,t,n){n===void 0&&(n=!1);let r=typeof i=="string"?i:Ib(i);if(!t||!AFe(t))return{path:r};if(t.formMethod&&!VFe(t.formMethod))return{path:r,error:Jh(405,{method:t.formMethod})};let o;if(t.formData){let l=t.formMethod||"get";if(o={formMethod:e.v7_normalizeFormMethod?l.toUpperCase():l.toLowerCase(),formAction:vpe(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},Tg(o.formMethod))return{path:r,submission:o}}let s=jp(r),a=mpe(t.formData);return n&&s.search&&bpe(s.search)&&a.append("index",""),s.search="?"+a,{path:Ib(s),submission:o}}function OFe(i,e){let t=i;if(e){let n=i.findIndex(r=>r.route.id===e);n>=0&&(t=i.slice(0,n))}return t}function $ne(i,e,t,n,r,o,s,a,l,c,u,d,h){let f=h?Object.values(h)[0]:d?Object.values(d)[0]:void 0,g=i.createURL(e.location),p=i.createURL(r),m=o||g.toString()===p.toString()||g.search!==p.search,v=h?Object.keys(h)[0]:void 0,y=OFe(t,v).filter((L,E)=>{if(L.route.lazy)return!0;if(L.route.loader==null)return!1;if(FFe(e.loaderData,e.matches[E],L)||s.some(T=>T===L.route.id))return!0;let D=e.matches[E],k=L;return Hne(L,zi({currentUrl:g,currentParams:D.params,nextUrl:p,nextParams:k.params},n,{actionResult:f,defaultShouldRevalidate:m||ppe(D,k)}))}),S=[];return l.forEach((L,E)=>{if(!t.some(M=>M.route.id===L.routeId))return;let D=ry(c,L.path,u);if(!D){S.push(zi({key:E},L,{matches:null,match:null}));return}let k=u$(D,L.path);if(a.includes(E)){S.push(zi({key:E,matches:D,match:k},L));return}Hne(k,zi({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:p,nextParams:t[t.length-1].params},n,{actionResult:f,defaultShouldRevalidate:m}))&&S.push(zi({key:E,matches:D,match:k},L))}),[y,S]}function FFe(i,e,t){let n=!e||t.route.id!==e.route.id,r=i[t.route.id]===void 0;return n||r}function ppe(i,e){let t=i.route.path;return i.pathname!==e.pathname||t!=null&&t.endsWith("*")&&i.params["*"]!==e.params["*"]}function Hne(i,e){if(i.route.shouldRevalidate){let t=i.route.shouldRevalidate(e);if(typeof t=="boolean")return t}return e.defaultShouldRevalidate}async function Vne(i,e,t){if(!i.lazy)return;let n=await i.lazy();if(!i.lazy)return;let r=t[i.id];Ci(r,"No route found in manifest");let o={};for(let s in n){let l=r[s]!==void 0&&s!=="hasErrorBoundary";Nw(!l,'Route "'+r.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!rFe.has(s)&&(o[s]=n[s])}Object.assign(r,o),Object.assign(r,{hasErrorBoundary:e(zi({},r)),lazy:void 0})}async function $x(i,e,t,n,r,o,s,a,l,c){s===void 0&&(s="/"),a===void 0&&(a=!1),l===void 0&&(l=!1);let u,d,h,f=m=>{let v,_=new Promise((y,S)=>v=S);return h=()=>v(),e.signal.addEventListener("abort",h),Promise.race([m({request:e,params:t.params,context:c}),_])};try{let m=t.route[i];if(t.route.lazy)if(m)d=(await Promise.all([f(m),Vne(t.route,o,r)]))[0];else if(await Vne(t.route,o,r),m=t.route[i],m)d=await f(m);else{if(i==="action")throw Jh(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:t.route.id});return{type:Ds.data,data:void 0}}else Ci(m,"Could not find the "+i+' to run on the "'+t.route.id+'" route'),d=await f(m);Ci(d!==void 0,"You defined "+(i==="action"?"an action":"a loader")+" for route "+('"'+t.route.id+"\" but didn't return anything from your `"+i+"` ")+"function. Please return a value or `null`.")}catch(m){u=Ds.error,d=m}finally{h&&e.signal.removeEventListener("abort",h)}if(HFe(d)){let m=d.status;if(kFe.has(m)){let y=d.headers.get("Location");if(Ci(y,"Redirects returned/thrown from loaders/actions must have a Location header"),fpe.test(y)){if(!a){let S=new URL(e.url),L=y.startsWith("//")?new URL(S.protocol+y):new URL(y),E=f4(L.pathname,s)!=null;L.origin===S.origin&&E&&(y=L.pathname+L.search+L.hash)}}else{let S=n.slice(0,n.indexOf(t)+1),L=upe(S).map(D=>D.pathnameBase),E=wFe(y,L,new URL(e.url).pathname);if(Ci(Ib(E),"Unable to resolve redirect location: "+y),s){let D=E.pathname;E.pathname=D==="/"?s:ob([s,D])}y=Ib(E)}if(a)throw d.headers.set("Location",y),d;return{type:Ds.redirect,status:m,location:y,revalidate:d.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:u||Ds.data,response:d};let v,_=d.headers.get("Content-Type");return _&&/\bapplication\/json\b/.test(_)?v=await d.json():v=await d.text(),u===Ds.error?{type:u,error:new pq(m,d.statusText,v),headers:d.headers}:{type:Ds.data,data:v,statusCode:d.status,headers:d.headers}}if(u===Ds.error)return{type:u,error:d};if($Fe(d)){var g,p;return{type:Ds.deferred,deferredData:d,statusCode:(g=d.init)==null?void 0:g.status,headers:((p=d.init)==null?void 0:p.headers)&&new Headers(d.init.headers)}}return{type:Ds.data,data:d}}function Hx(i,e,t,n){let r=i.createURL(vpe(e)).toString(),o={signal:t};if(n&&Tg(n.formMethod)){let{formMethod:s,formEncType:a,formData:l}=n;o.method=s.toUpperCase(),o.body=a==="application/x-www-form-urlencoded"?mpe(l):l}return new Request(r,o)}function mpe(i){let e=new URLSearchParams;for(let[t,n]of i.entries())e.append(t,n instanceof File?n.name:n);return e}function BFe(i,e,t,n,r){let o={},s=null,a,l=!1,c={};return t.forEach((u,d)=>{let h=e[d].route.id;if(Ci(!Wy(u),"Cannot handle redirect results in processLoaderData"),yE(u)){let f=oy(i,h),g=u.error;n&&(g=Object.values(n)[0],n=void 0),s=s||{},s[f.route.id]==null&&(s[f.route.id]=g),o[h]=void 0,l||(l=!0,a=dpe(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else $0(u)?(r.set(h,u.deferredData),o[h]=u.deferredData.data):o[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(c[h]=u.headers)}),n&&(s=n,o[Object.keys(n)[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}function zne(i,e,t,n,r,o,s,a){let{loaderData:l,errors:c}=BFe(e,t,n,r,a);for(let u=0;un.route.id===e)+1):[...i]).reverse().find(n=>n.route.hasErrorBoundary===!0)||i[0]}function jne(i){let e=i.find(t=>t.index||!t.path||t.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Jh(i,e){let{pathname:t,routeId:n,method:r,type:o}=e===void 0?{}:e,s="Unknown Server Error",a="Unknown @remix-run/router error";return i===400?(s="Bad Request",r&&t&&n?a="You made a "+r+' request to "'+t+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"&&(a="defer() is not supported in actions")):i===403?(s="Forbidden",a='Route "'+n+'" does not match URL "'+t+'"'):i===404?(s="Not Found",a='No route matches URL "'+t+'"'):i===405&&(s="Method Not Allowed",r&&t&&n?a="You made a "+r.toUpperCase()+' request to "'+t+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":r&&(a='Invalid request method "'+r.toUpperCase()+'"')),new pq(i||500,s,new Error(a),!0)}function Kne(i){for(let e=i.length-1;e>=0;e--){let t=i[e];if(Wy(t))return t}}function vpe(i){let e=typeof i=="string"?jp(i):i;return Ib(zi({},e,{hash:""}))}function WFe(i,e){return i.pathname===e.pathname&&i.search===e.search&&i.hash!==e.hash}function $0(i){return i.type===Ds.deferred}function yE(i){return i.type===Ds.error}function Wy(i){return(i&&i.type)===Ds.redirect}function $Fe(i){let e=i;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function HFe(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.headers=="object"&&typeof i.body<"u"}function VFe(i){return IFe.has(i.toLowerCase())}function Tg(i){return EFe.has(i.toLowerCase())}async function Gne(i,e,t,n,r,o){for(let s=0;sd.route.id===l.route.id),u=c!=null&&!ppe(c,l)&&(o&&o[l.route.id])!==void 0;$0(a)&&(r||u)&&await _pe(a,n,r).then(d=>{d&&(t[s]=d||t[s])})}}async function _pe(i,e,t){if(t===void 0&&(t=!1),!await i.deferredData.resolveData(e)){if(t)try{return{type:Ds.data,data:i.deferredData.unwrappedData}}catch(r){return{type:Ds.error,error:r}}return{type:Ds.data,data:i.deferredData.data}}}function bpe(i){return new URLSearchParams(i).getAll("index").some(e=>e==="")}function qne(i,e){let{route:t,pathname:n,params:r}=i;return{id:t.id,pathname:n,params:r,data:e[t.id],handle:t.handle}}function u$(i,e){let t=typeof e=="string"?jp(e).search:e.search;if(i[i.length-1].route.index&&bpe(t||""))return i[i.length-1];let n=upe(i);return n[n.length-1]}/** + */function zi(){return zi=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u")throw new Error(e)}function Nw(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function nFe(){return Math.random().toString(36).substr(2,8)}function One(i,e){return{usr:i.state,key:i.key,idx:e}}function PD(i,e,t,n){return t===void 0&&(t=null),zi({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof e=="string"?jp(e):e,{state:t,key:e&&e.key||n||nFe()})}function kb(i){let{pathname:e="/",search:t="",hash:n=""}=i;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jp(i){let e={};if(i){let t=i.indexOf("#");t>=0&&(e.hash=i.substr(t),i=i.substr(0,t));let n=i.indexOf("?");n>=0&&(e.search=i.substr(n),i=i.substr(0,n)),i&&(e.pathname=i)}return e}function iFe(i,e,t,n){n===void 0&&(n={});let{window:r=document.defaultView,v5Compat:o=!1}=n,s=r.history,a=ss.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(zi({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=ss.Pop;let m=u(),v=m==null?null:m-c;c=m,l&&l({action:a,location:p.location,delta:v})}function h(m,v){a=ss.Push;let _=PD(p.location,m,v);t&&t(_,m),c=u()+1;let y=One(_,c),S=p.createHref(_);try{s.pushState(y,"",S)}catch{r.location.assign(S)}o&&l&&l({action:a,location:p.location,delta:1})}function f(m,v){a=ss.Replace;let _=PD(p.location,m,v);t&&t(_,m),c=u();let y=One(_,c),S=p.createHref(_);s.replaceState(y,"",S),o&&l&&l({action:a,location:p.location,delta:0})}function g(m){let v=r.location.origin!=="null"?r.location.origin:r.location.href,_=typeof m=="string"?m:kb(m);return Ci(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let p={get action(){return a},get location(){return i(r,s)},listen(m){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Ane,d),l=m,()=>{r.removeEventListener(Ane,d),l=null}},createHref(m){return e(r,m)},createURL:g,encodeLocation(m){let v=g(m);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(m){return s.go(m)}};return p}var Ds;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(Ds||(Ds={}));const rFe=new Set(["lazy","caseSensitive","path","id","index","children"]);function oFe(i){return i.index===!0}function ape(i,e,t,n){return t===void 0&&(t=[]),n===void 0&&(n={}),i.map((r,o)=>{let s=[...t,o],a=typeof r.id=="string"?r.id:s.join("-");if(Ci(r.index!==!0||!r.children,"Cannot specify children on an index route"),Ci(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),oFe(r)){let l=zi({},r,{hasErrorBoundary:e(r),id:a});return n[a]=l,l}else{let l=zi({},r,{id:a,hasErrorBoundary:e(r),children:void 0});return n[a]=l,r.children&&(l.children=ape(r.children,e,s,n)),l}})}function ry(i,e,t){t===void 0&&(t="/");let n=typeof e=="string"?jp(e):e,r=f4(n.pathname||"/",t);if(r==null)return null;let o=lpe(i);sFe(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Ci(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=sb([n,l.relativePath]),u=t.concat(l);o.children&&o.children.length>0&&(Ci(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),lpe(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:fFe(c,o.index),routesMeta:u})};return i.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of cpe(o.path))r(o,s,l)}),e}function cpe(i){let e=i.split("/");if(e.length===0)return[];let[t,...n]=e,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(n.length===0)return r?[o,""]:[o];let s=cpe(n.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>i.startsWith("/")&&l===""?"/":l)}function sFe(i){i.sort((e,t)=>e.score!==t.score?t.score-e.score:gFe(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const aFe=/^:\w+$/,lFe=3,cFe=2,uFe=1,dFe=10,hFe=-2,Fne=i=>i==="*";function fFe(i,e){let t=i.split("/"),n=t.length;return t.some(Fne)&&(n+=hFe),e&&(n+=cFe),t.filter(r=>!Fne(r)).reduce((r,o)=>r+(aFe.test(o)?lFe:o===""?uFe:dFe),n)}function gFe(i,e){return i.length===e.length&&i.slice(0,-1).every((n,r)=>n===e[r])?i[i.length-1]-e[e.length-1]:0}function pFe(i,e){let{routesMeta:t}=i,n={},r="/",o=[];for(let s=0;s{if(u==="*"){let h=a[d]||"";s=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}return c[u]=bFe(a[d]||"",u),c},{}),pathname:o,pathnameBase:s,pattern:i}}function vFe(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Nw(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let n=[],r="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(n.push(a),"/([^\\/]+)"));return i.endsWith("*")?(n.push("*"),r+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":i!==""&&i!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}function _Fe(i){try{return decodeURI(i)}catch(e){return Nw(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),i}}function bFe(i,e){try{return decodeURIComponent(i)}catch(t){return Nw(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+i+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),i}}function f4(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=i.charAt(t);return n&&n!=="/"?null:i.slice(t)||"/"}function CFe(i,e){e===void 0&&(e="/");let{pathname:t,search:n="",hash:r=""}=typeof i=="string"?jp(i):i;return{pathname:t?t.startsWith("/")?t:yFe(t,e):e,search:xFe(n),hash:LFe(r)}}function yFe(i,e){let t=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function n6(i,e,t,n){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function upe(i){return i.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function wFe(i,e,t,n){n===void 0&&(n=!1);let r;typeof i=="string"?r=jp(i):(r=zi({},i),Ci(!r.pathname||!r.pathname.includes("?"),n6("?","pathname","search",r)),Ci(!r.pathname||!r.pathname.includes("#"),n6("#","pathname","hash",r)),Ci(!r.search||!r.search.includes("#"),n6("#","search","hash",r)));let o=i===""||r.pathname==="",s=o?"/":r.pathname,a;if(n||s==null)a=t;else{let d=e.length-1;if(s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;r.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=CFe(r,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const sb=i=>i.join("/").replace(/\/\/+/g,"/"),SFe=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),xFe=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,LFe=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;class pq{constructor(e,t,n,r){r===void 0&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function dpe(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const hpe=["post","put","patch","delete"],EFe=new Set(hpe),DFe=["get",...hpe],IFe=new Set(DFe),kFe=new Set([301,302,303,307,308]),TFe=new Set([307,308]),i6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},NFe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Bne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fpe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gpe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RFe=!gpe,MFe=i=>!!i.hasErrorBoundary;function PFe(i){Ci(i.routes.length>0,"You must provide a non-empty routes array to createRouter");let e=i.detectErrorBoundary||MFe,t={},n=ape(i.routes,e,void 0,t),r,o=zi({v7_normalizeFormMethod:!1},i.future),s=null,a=new Set,l=null,c=null,u=null,d=i.hydrationData!=null,h=ry(n,i.history.location,i.basename),f=null;if(h==null){let oe=Jh(404,{pathname:i.history.location.pathname}),{matches:ce,route:fe}=jne(n);h=ce,f={[fe.id]:oe}}let g=!h.some(oe=>oe.route.lazy)&&(!h.some(oe=>oe.route.loader)||i.hydrationData!=null),p,m={historyAction:i.history.action,location:i.history.location,matches:h,initialized:g,navigation:i6,restoreScrollPosition:i.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:i.hydrationData&&i.hydrationData.loaderData||{},actionData:i.hydrationData&&i.hydrationData.actionData||null,errors:i.hydrationData&&i.hydrationData.errors||f,fetchers:new Map,blockers:new Map},v=ss.Pop,_=!1,y,S=!1,L=!1,E=[],D=[],k=new Map,T=0,M=-1,P=new Map,N=new Set,R=new Map,O=new Map,B=new Map,$=!1;function G(){return s=i.history.listen(oe=>{let{action:ce,location:fe,delta:Ie}=oe;if($){$=!1;return}Nw(B.size===0||Ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Te=z({currentLocation:m.location,nextLocation:fe,historyAction:ce});if(Te&&Ie!=null){$=!0,i.history.go(Ie*-1),de(Te,{state:"blocked",location:fe,proceed(){de(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),i.history.go(Ie)},reset(){ue(Te),ie({blockers:new Map(p.state.blockers)})}});return}return he(ce,fe)}),m.initialized||he(ss.Pop,m.location),p}function U(){s&&s(),a.clear(),y&&y.abort(),m.fetchers.forEach((oe,ce)=>Be(ce)),m.blockers.forEach((oe,ce)=>ue(ce))}function j(oe){return a.add(oe),()=>a.delete(oe)}function ie(oe){m=zi({},m,oe),a.forEach(ce=>ce(m))}function Y(oe,ce){var fe,Ie;let Te=m.actionData!=null&&m.navigation.formMethod!=null&&Tg(m.navigation.formMethod)&&m.navigation.state==="loading"&&((fe=oe.state)==null?void 0:fe._isRedirect)!==!0,He;ce.actionData?Object.keys(ce.actionData).length>0?He=ce.actionData:He=null:Te?He=m.actionData:He=null;let Me=ce.loaderData?Une(m.loaderData,ce.loaderData,ce.matches||[],ce.errors):m.loaderData;for(let[rt]of B)ue(rt);let bt=_===!0||m.navigation.formMethod!=null&&Tg(m.navigation.formMethod)&&((Ie=oe.state)==null?void 0:Ie._isRedirect)!==!0;r&&(n=r,r=void 0),ie(zi({},ce,{actionData:He,loaderData:Me,historyAction:v,location:oe,initialized:!0,navigation:i6,revalidation:"idle",restoreScrollPosition:pe(oe,ce.matches||m.matches),preventScrollReset:bt,blockers:new Map(m.blockers)})),S||v===ss.Pop||(v===ss.Push?i.history.push(oe,oe.state):v===ss.Replace&&i.history.replace(oe,oe.state)),v=ss.Pop,_=!1,S=!1,L=!1,E=[],D=[]}async function J(oe,ce){if(typeof oe=="number"){i.history.go(oe);return}let{path:fe,submission:Ie,error:Te}=Wne(oe,o,ce),He=m.location,Me=PD(m.location,fe,ce&&ce.state);Me=zi({},Me,i.history.encodeLocation(Me));let bt=ce&&ce.replace!=null?ce.replace:void 0,rt=ss.Push;bt===!0?rt=ss.Replace:bt===!1||Ie!=null&&Tg(Ie.formMethod)&&Ie.formAction===m.location.pathname+m.location.search&&(rt=ss.Replace);let Ht=ce&&"preventScrollReset"in ce?ce.preventScrollReset===!0:void 0,Ue=z({currentLocation:He,nextLocation:Me,historyAction:rt});if(Ue){de(Ue,{state:"blocked",location:Me,proceed(){de(Ue,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),J(oe,ce)},reset(){ue(Ue),ie({blockers:new Map(m.blockers)})}});return}return await he(rt,Me,{submission:Ie,pendingError:Te,preventScrollReset:Ht,replace:ce&&ce.replace})}function Q(){if(Le(),ie({revalidation:"loading"}),m.navigation.state!=="submitting"){if(m.navigation.state==="idle"){he(m.historyAction,m.location,{startUninterruptedRevalidation:!0});return}he(v||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation})}}async function he(oe,ce,fe){y&&y.abort(),y=null,v=oe,S=(fe&&fe.startUninterruptedRevalidation)===!0,ne(m.location,m.matches),_=(fe&&fe.preventScrollReset)===!0;let Ie=r||n,Te=fe&&fe.overrideNavigation,He=ry(Ie,ce,i.basename);if(!He){let Dt=Jh(404,{pathname:ce.pathname}),{matches:St,route:Kt}=jne(Ie);q(),Y(ce,{matches:St,loaderData:{},errors:{[Kt.id]:Dt}});return}if(WFe(m.location,ce)&&!(fe&&fe.submission&&Tg(fe.submission.formMethod))){Y(ce,{matches:He});return}y=new AbortController;let Me=Hx(i.history,ce,y.signal,fe&&fe.submission),bt,rt;if(fe&&fe.pendingError)rt={[oy(He).route.id]:fe.pendingError};else if(fe&&fe.submission&&Tg(fe.submission.formMethod)){let Dt=await ge(Me,ce,fe.submission,He,{replace:fe.replace});if(Dt.shortCircuited)return;bt=Dt.pendingActionData,rt=Dt.pendingActionError,Te=zi({state:"loading",location:ce},fe.submission),Me=new Request(Me.url,{signal:Me.signal})}let{shortCircuited:Ht,loaderData:Ue,errors:Ct}=await ye(Me,ce,He,Te,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,bt,rt);Ht||(y=null,Y(ce,zi({matches:He},bt?{actionData:bt}:{},{loaderData:Ue,errors:Ct})))}async function ge(oe,ce,fe,Ie,Te){Le();let He=zi({state:"submitting",location:ce},fe);ie({navigation:He});let Me,bt=u$(Ie,ce);if(!bt.route.action&&!bt.route.lazy)Me={type:Ds.error,error:Jh(405,{method:oe.method,pathname:ce.pathname,routeId:bt.route.id})};else if(Me=await $x("action",oe,bt,Ie,t,e,p.basename),oe.signal.aborted)return{shortCircuited:!0};if(Wy(Me)){let rt;return Te&&Te.replace!=null?rt=Te.replace:rt=Me.location===m.location.pathname+m.location.search,await _e(m,Me,{submission:fe,replace:rt}),{shortCircuited:!0}}if(yE(Me)){let rt=oy(Ie,bt.route.id);return(Te&&Te.replace)!==!0&&(v=ss.Push),{pendingActionData:{},pendingActionError:{[rt.route.id]:Me.error}}}if(H0(Me))throw Jh(400,{type:"defer-action"});return{pendingActionData:{[bt.route.id]:Me.data}}}async function ye(oe,ce,fe,Ie,Te,He,Me,bt,rt){let Ht=Ie;Ht||(Ht=zi({state:"loading",location:ce,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Te));let Ue=Te||He?Te||He:Ht.formMethod&&Ht.formAction&&Ht.formData&&Ht.formEncType?{formMethod:Ht.formMethod,formAction:Ht.formAction,formData:Ht.formData,formEncType:Ht.formEncType}:void 0,Ct=r||n,[Dt,St]=$ne(i.history,m,fe,Ue,ce,L,E,D,R,Ct,i.basename,bt,rt);if(q(Lt=>!(fe&&fe.some(At=>At.route.id===Lt))||Dt&&Dt.some(At=>At.route.id===Lt)),Dt.length===0&&St.length===0)return Y(ce,zi({matches:fe,loaderData:{},errors:rt||null},bt?{actionData:bt}:{})),{shortCircuited:!0};if(!S){St.forEach(At=>{let ln=m.fetchers.get(At.key),Si={state:"loading",data:ln&&ln.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(At.key,Si)});let Lt=bt||m.actionData;ie(zi({navigation:Ht},Lt?Object.keys(Lt).length===0?{actionData:null}:{actionData:Lt}:{},St.length>0?{fetchers:new Map(m.fetchers)}:{}))}M=++T,St.forEach(Lt=>k.set(Lt.key,y));let{results:Kt,loaderResults:_n,fetcherResults:zt}=await Ve(m.matches,fe,Dt,St,oe);if(oe.signal.aborted)return{shortCircuited:!0};St.forEach(Lt=>k.delete(Lt.key));let Yt=Kne(Kt);if(Yt)return await _e(m,Yt,{replace:Me}),{shortCircuited:!0};let{loaderData:at,errors:ut}=zne(m,fe,Dt,_n,rt,St,zt,O);O.forEach((Lt,At)=>{Lt.subscribe(ln=>{(ln||Lt.done)&&O.delete(At)})}),We();let ht=dt(M);return zi({loaderData:at,errors:ut},ht||St.length>0?{fetchers:new Map(m.fetchers)}:{})}function be(oe){return m.fetchers.get(oe)||NFe}function Ge(oe,ce,fe,Ie){if(RFe)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");k.has(oe)&&Qe(oe);let He=ry(r||n,fe,i.basename);if(!He){Pe(oe,ce,Jh(404,{pathname:fe}));return}let{path:Me,submission:bt}=Wne(fe,o,Ie,!0),rt=u$(He,Me);if(_=(Ie&&Ie.preventScrollReset)===!0,bt&&Tg(bt.formMethod)){nt(oe,ce,Me,rt,He,bt);return}R.set(oe,{routeId:ce,path:Me}),je(oe,ce,Me,rt,He,bt)}async function nt(oe,ce,fe,Ie,Te,He){if(Le(),R.delete(oe),!Ie.route.action&&!Ie.route.lazy){let En=Jh(405,{method:He.formMethod,pathname:fe,routeId:ce});Pe(oe,ce,En);return}let Me=m.fetchers.get(oe),bt=zi({state:"submitting"},He,{data:Me&&Me.data," _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,bt),ie({fetchers:new Map(m.fetchers)});let rt=new AbortController,Ht=Hx(i.history,fe,rt.signal,He);k.set(oe,rt);let Ue=await $x("action",Ht,Ie,Te,t,e,p.basename);if(Ht.signal.aborted){k.get(oe)===rt&&k.delete(oe);return}if(Wy(Ue)){k.delete(oe),N.add(oe);let En=zi({state:"loading"},He,{data:void 0," _hasFetcherDoneAnything ":!0});return m.fetchers.set(oe,En),ie({fetchers:new Map(m.fetchers)}),_e(m,Ue,{submission:He,isFetchActionRedirect:!0})}if(yE(Ue)){Pe(oe,ce,Ue.error);return}if(H0(Ue))throw Jh(400,{type:"defer-action"});let Ct=m.navigation.location||m.location,Dt=Hx(i.history,Ct,rt.signal),St=r||n,Kt=m.navigation.state!=="idle"?ry(St,m.navigation.location,i.basename):m.matches;Ci(Kt,"Didn't find any matches after fetcher action");let _n=++T;P.set(oe,_n);let zt=zi({state:"loading",data:Ue.data},He,{" _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,zt);let[Yt,at]=$ne(i.history,m,Kt,He,Ct,L,E,D,R,St,i.basename,{[Ie.route.id]:Ue.data},void 0);at.filter(En=>En.key!==oe).forEach(En=>{let fi=En.key,Ur=m.fetchers.get(fi),go={state:"loading",data:Ur&&Ur.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(fi,go),k.set(fi,rt)}),ie({fetchers:new Map(m.fetchers)});let{results:ut,loaderResults:ht,fetcherResults:Lt}=await Ve(m.matches,Kt,Yt,at,Dt);if(rt.signal.aborted)return;P.delete(oe),k.delete(oe),at.forEach(En=>k.delete(En.key));let At=Kne(ut);if(At)return _e(m,At);let{loaderData:ln,errors:Si}=zne(m,m.matches,Yt,ht,void 0,at,Lt,O),Xi={state:"idle",data:Ue.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(oe,Xi);let Ir=dt(_n);m.navigation.state==="loading"&&_n>M?(Ci(v,"Expected pending action"),y&&y.abort(),Y(m.navigation.location,{matches:Kt,loaderData:ln,errors:Si,fetchers:new Map(m.fetchers)})):(ie(zi({errors:Si,loaderData:Une(m.loaderData,ln,Kt,Si)},Ir?{fetchers:new Map(m.fetchers)}:{})),L=!1)}async function je(oe,ce,fe,Ie,Te,He){let Me=m.fetchers.get(oe),bt=zi({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},He,{data:Me&&Me.data," _hasFetcherDoneAnything ":!0});m.fetchers.set(oe,bt),ie({fetchers:new Map(m.fetchers)});let rt=new AbortController,Ht=Hx(i.history,fe,rt.signal);k.set(oe,rt);let Ue=await $x("loader",Ht,Ie,Te,t,e,p.basename);if(H0(Ue)&&(Ue=await _pe(Ue,Ht.signal,!0)||Ue),k.get(oe)===rt&&k.delete(oe),Ht.signal.aborted)return;if(Wy(Ue)){await _e(m,Ue);return}if(yE(Ue)){let Dt=oy(m.matches,ce);m.fetchers.delete(oe),ie({fetchers:new Map(m.fetchers),errors:{[Dt.route.id]:Ue.error}});return}Ci(!H0(Ue),"Unhandled fetcher deferred data");let Ct={state:"idle",data:Ue.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(oe,Ct),ie({fetchers:new Map(m.fetchers)})}async function _e(oe,ce,fe){var Ie;let{submission:Te,replace:He,isFetchActionRedirect:Me}=fe===void 0?{}:fe;ce.revalidate&&(L=!0);let bt=PD(oe.location,ce.location,zi({_isRedirect:!0},Me?{_isFetchActionRedirect:!0}:{}));if(Ci(bt,"Expected a location on the redirect navigation"),fpe.test(ce.location)&&gpe&&typeof((Ie=window)==null?void 0:Ie.location)<"u"){let St=i.history.createURL(ce.location),Kt=f4(St.pathname,i.basename||"/")==null;if(window.location.origin!==St.origin||Kt){He?window.location.replace(ce.location):window.location.assign(ce.location);return}}y=null;let rt=He===!0?ss.Replace:ss.Push,{formMethod:Ht,formAction:Ue,formEncType:Ct,formData:Dt}=oe.navigation;!Te&&Ht&&Ue&&Dt&&Ct&&(Te={formMethod:Ht,formAction:Ue,formEncType:Ct,formData:Dt}),TFe.has(ce.status)&&Te&&Tg(Te.formMethod)?await he(rt,bt,{submission:zi({},Te,{formAction:ce.location}),preventScrollReset:_}):Me?await he(rt,bt,{overrideNavigation:{state:"loading",location:bt,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:Te,preventScrollReset:_}):await he(rt,bt,{overrideNavigation:{state:"loading",location:bt,formMethod:Te?Te.formMethod:void 0,formAction:Te?Te.formAction:void 0,formEncType:Te?Te.formEncType:void 0,formData:Te?Te.formData:void 0},preventScrollReset:_})}async function Ve(oe,ce,fe,Ie,Te){let He=await Promise.all([...fe.map(rt=>$x("loader",Te,rt,ce,t,e,p.basename)),...Ie.map(rt=>rt.matches&&rt.match?$x("loader",Hx(i.history,rt.path,Te.signal),rt.match,rt.matches,t,e,p.basename):{type:Ds.error,error:Jh(404,{pathname:rt.path})})]),Me=He.slice(0,fe.length),bt=He.slice(fe.length);return await Promise.all([Gne(oe,fe,Me,Te.signal,!1,m.loaderData),Gne(oe,Ie.map(rt=>rt.match),bt,Te.signal,!0)]),{results:He,loaderResults:Me,fetcherResults:bt}}function Le(){L=!0,E.push(...q()),R.forEach((oe,ce)=>{k.has(ce)&&(D.push(ce),Qe(ce))})}function Pe(oe,ce,fe){let Ie=oy(m.matches,ce);Be(oe),ie({errors:{[Ie.route.id]:fe},fetchers:new Map(m.fetchers)})}function Be(oe){k.has(oe)&&Qe(oe),R.delete(oe),P.delete(oe),N.delete(oe),m.fetchers.delete(oe)}function Qe(oe){let ce=k.get(oe);Ci(ce,"Expected fetch controller: "+oe),ce.abort(),k.delete(oe)}function Ye(oe){for(let ce of oe){let Ie={state:"idle",data:be(ce).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};m.fetchers.set(ce,Ie)}}function We(){let oe=[];for(let ce of N){let fe=m.fetchers.get(ce);Ci(fe,"Expected fetcher: "+ce),fe.state==="loading"&&(N.delete(ce),oe.push(ce))}Ye(oe)}function dt(oe){let ce=[];for(let[fe,Ie]of P)if(Ie0}function re(oe,ce){let fe=m.blockers.get(oe)||Bne;return B.get(oe)!==ce&&B.set(oe,ce),fe}function ue(oe){m.blockers.delete(oe),B.delete(oe)}function de(oe,ce){let fe=m.blockers.get(oe)||Bne;Ci(fe.state==="unblocked"&&ce.state==="blocked"||fe.state==="blocked"&&ce.state==="blocked"||fe.state==="blocked"&&ce.state==="proceeding"||fe.state==="blocked"&&ce.state==="unblocked"||fe.state==="proceeding"&&ce.state==="unblocked","Invalid blocker state transition: "+fe.state+" -> "+ce.state),m.blockers.set(oe,ce),ie({blockers:new Map(m.blockers)})}function z(oe){let{currentLocation:ce,nextLocation:fe,historyAction:Ie}=oe;if(B.size===0)return;B.size>1&&Nw(!1,"A router only supports one blocker at a time");let Te=Array.from(B.entries()),[He,Me]=Te[Te.length-1],bt=m.blockers.get(He);if(!(bt&&bt.state==="proceeding")&&Me({currentLocation:ce,nextLocation:fe,historyAction:Ie}))return He}function q(oe){let ce=[];return O.forEach((fe,Ie)=>{(!oe||oe(Ie))&&(fe.cancel(),ce.push(Ie),O.delete(Ie))}),ce}function se(oe,ce,fe){if(l=oe,u=ce,c=fe||(Ie=>Ie.key),!d&&m.navigation===i6){d=!0;let Ie=pe(m.location,m.matches);Ie!=null&&ie({restoreScrollPosition:Ie})}return()=>{l=null,u=null,c=null}}function ne(oe,ce){if(l&&c&&u){let fe=ce.map(Te=>qne(Te,m.loaderData)),Ie=c(oe,fe)||oe.key;l[Ie]=u()}}function pe(oe,ce){if(l&&c&&u){let fe=ce.map(He=>qne(He,m.loaderData)),Ie=c(oe,fe)||oe.key,Te=l[Ie];if(typeof Te=="number")return Te}return null}function ke(oe){r=oe}return p={get basename(){return i.basename},get state(){return m},get routes(){return n},initialize:G,subscribe:j,enableScrollRestoration:se,navigate:J,fetch:Ge,revalidate:Q,createHref:oe=>i.history.createHref(oe),encodeLocation:oe=>i.history.encodeLocation(oe),getFetcher:be,deleteFetcher:Be,dispose:U,getBlocker:re,deleteBlocker:ue,_internalFetchControllers:k,_internalActiveDeferreds:O,_internalSetRoutes:ke},p}function AFe(i){return i!=null&&"formData"in i}function Wne(i,e,t,n){n===void 0&&(n=!1);let r=typeof i=="string"?i:kb(i);if(!t||!AFe(t))return{path:r};if(t.formMethod&&!VFe(t.formMethod))return{path:r,error:Jh(405,{method:t.formMethod})};let o;if(t.formData){let l=t.formMethod||"get";if(o={formMethod:e.v7_normalizeFormMethod?l.toUpperCase():l.toLowerCase(),formAction:vpe(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},Tg(o.formMethod))return{path:r,submission:o}}let s=jp(r),a=mpe(t.formData);return n&&s.search&&bpe(s.search)&&a.append("index",""),s.search="?"+a,{path:kb(s),submission:o}}function OFe(i,e){let t=i;if(e){let n=i.findIndex(r=>r.route.id===e);n>=0&&(t=i.slice(0,n))}return t}function $ne(i,e,t,n,r,o,s,a,l,c,u,d,h){let f=h?Object.values(h)[0]:d?Object.values(d)[0]:void 0,g=i.createURL(e.location),p=i.createURL(r),m=o||g.toString()===p.toString()||g.search!==p.search,v=h?Object.keys(h)[0]:void 0,y=OFe(t,v).filter((L,E)=>{if(L.route.lazy)return!0;if(L.route.loader==null)return!1;if(FFe(e.loaderData,e.matches[E],L)||s.some(T=>T===L.route.id))return!0;let D=e.matches[E],k=L;return Hne(L,zi({currentUrl:g,currentParams:D.params,nextUrl:p,nextParams:k.params},n,{actionResult:f,defaultShouldRevalidate:m||ppe(D,k)}))}),S=[];return l.forEach((L,E)=>{if(!t.some(M=>M.route.id===L.routeId))return;let D=ry(c,L.path,u);if(!D){S.push(zi({key:E},L,{matches:null,match:null}));return}let k=u$(D,L.path);if(a.includes(E)){S.push(zi({key:E,matches:D,match:k},L));return}Hne(k,zi({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:p,nextParams:t[t.length-1].params},n,{actionResult:f,defaultShouldRevalidate:m}))&&S.push(zi({key:E,matches:D,match:k},L))}),[y,S]}function FFe(i,e,t){let n=!e||t.route.id!==e.route.id,r=i[t.route.id]===void 0;return n||r}function ppe(i,e){let t=i.route.path;return i.pathname!==e.pathname||t!=null&&t.endsWith("*")&&i.params["*"]!==e.params["*"]}function Hne(i,e){if(i.route.shouldRevalidate){let t=i.route.shouldRevalidate(e);if(typeof t=="boolean")return t}return e.defaultShouldRevalidate}async function Vne(i,e,t){if(!i.lazy)return;let n=await i.lazy();if(!i.lazy)return;let r=t[i.id];Ci(r,"No route found in manifest");let o={};for(let s in n){let l=r[s]!==void 0&&s!=="hasErrorBoundary";Nw(!l,'Route "'+r.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!rFe.has(s)&&(o[s]=n[s])}Object.assign(r,o),Object.assign(r,{hasErrorBoundary:e(zi({},r)),lazy:void 0})}async function $x(i,e,t,n,r,o,s,a,l,c){s===void 0&&(s="/"),a===void 0&&(a=!1),l===void 0&&(l=!1);let u,d,h,f=m=>{let v,_=new Promise((y,S)=>v=S);return h=()=>v(),e.signal.addEventListener("abort",h),Promise.race([m({request:e,params:t.params,context:c}),_])};try{let m=t.route[i];if(t.route.lazy)if(m)d=(await Promise.all([f(m),Vne(t.route,o,r)]))[0];else if(await Vne(t.route,o,r),m=t.route[i],m)d=await f(m);else{if(i==="action")throw Jh(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:t.route.id});return{type:Ds.data,data:void 0}}else Ci(m,"Could not find the "+i+' to run on the "'+t.route.id+'" route'),d=await f(m);Ci(d!==void 0,"You defined "+(i==="action"?"an action":"a loader")+" for route "+('"'+t.route.id+"\" but didn't return anything from your `"+i+"` ")+"function. Please return a value or `null`.")}catch(m){u=Ds.error,d=m}finally{h&&e.signal.removeEventListener("abort",h)}if(HFe(d)){let m=d.status;if(kFe.has(m)){let y=d.headers.get("Location");if(Ci(y,"Redirects returned/thrown from loaders/actions must have a Location header"),fpe.test(y)){if(!a){let S=new URL(e.url),L=y.startsWith("//")?new URL(S.protocol+y):new URL(y),E=f4(L.pathname,s)!=null;L.origin===S.origin&&E&&(y=L.pathname+L.search+L.hash)}}else{let S=n.slice(0,n.indexOf(t)+1),L=upe(S).map(D=>D.pathnameBase),E=wFe(y,L,new URL(e.url).pathname);if(Ci(kb(E),"Unable to resolve redirect location: "+y),s){let D=E.pathname;E.pathname=D==="/"?s:sb([s,D])}y=kb(E)}if(a)throw d.headers.set("Location",y),d;return{type:Ds.redirect,status:m,location:y,revalidate:d.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:u||Ds.data,response:d};let v,_=d.headers.get("Content-Type");return _&&/\bapplication\/json\b/.test(_)?v=await d.json():v=await d.text(),u===Ds.error?{type:u,error:new pq(m,d.statusText,v),headers:d.headers}:{type:Ds.data,data:v,statusCode:d.status,headers:d.headers}}if(u===Ds.error)return{type:u,error:d};if($Fe(d)){var g,p;return{type:Ds.deferred,deferredData:d,statusCode:(g=d.init)==null?void 0:g.status,headers:((p=d.init)==null?void 0:p.headers)&&new Headers(d.init.headers)}}return{type:Ds.data,data:d}}function Hx(i,e,t,n){let r=i.createURL(vpe(e)).toString(),o={signal:t};if(n&&Tg(n.formMethod)){let{formMethod:s,formEncType:a,formData:l}=n;o.method=s.toUpperCase(),o.body=a==="application/x-www-form-urlencoded"?mpe(l):l}return new Request(r,o)}function mpe(i){let e=new URLSearchParams;for(let[t,n]of i.entries())e.append(t,n instanceof File?n.name:n);return e}function BFe(i,e,t,n,r){let o={},s=null,a,l=!1,c={};return t.forEach((u,d)=>{let h=e[d].route.id;if(Ci(!Wy(u),"Cannot handle redirect results in processLoaderData"),yE(u)){let f=oy(i,h),g=u.error;n&&(g=Object.values(n)[0],n=void 0),s=s||{},s[f.route.id]==null&&(s[f.route.id]=g),o[h]=void 0,l||(l=!0,a=dpe(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else H0(u)?(r.set(h,u.deferredData),o[h]=u.deferredData.data):o[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(c[h]=u.headers)}),n&&(s=n,o[Object.keys(n)[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}function zne(i,e,t,n,r,o,s,a){let{loaderData:l,errors:c}=BFe(e,t,n,r,a);for(let u=0;un.route.id===e)+1):[...i]).reverse().find(n=>n.route.hasErrorBoundary===!0)||i[0]}function jne(i){let e=i.find(t=>t.index||!t.path||t.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Jh(i,e){let{pathname:t,routeId:n,method:r,type:o}=e===void 0?{}:e,s="Unknown Server Error",a="Unknown @remix-run/router error";return i===400?(s="Bad Request",r&&t&&n?a="You made a "+r+' request to "'+t+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"&&(a="defer() is not supported in actions")):i===403?(s="Forbidden",a='Route "'+n+'" does not match URL "'+t+'"'):i===404?(s="Not Found",a='No route matches URL "'+t+'"'):i===405&&(s="Method Not Allowed",r&&t&&n?a="You made a "+r.toUpperCase()+' request to "'+t+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":r&&(a='Invalid request method "'+r.toUpperCase()+'"')),new pq(i||500,s,new Error(a),!0)}function Kne(i){for(let e=i.length-1;e>=0;e--){let t=i[e];if(Wy(t))return t}}function vpe(i){let e=typeof i=="string"?jp(i):i;return kb(zi({},e,{hash:""}))}function WFe(i,e){return i.pathname===e.pathname&&i.search===e.search&&i.hash!==e.hash}function H0(i){return i.type===Ds.deferred}function yE(i){return i.type===Ds.error}function Wy(i){return(i&&i.type)===Ds.redirect}function $Fe(i){let e=i;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function HFe(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.headers=="object"&&typeof i.body<"u"}function VFe(i){return IFe.has(i.toLowerCase())}function Tg(i){return EFe.has(i.toLowerCase())}async function Gne(i,e,t,n,r,o){for(let s=0;sd.route.id===l.route.id),u=c!=null&&!ppe(c,l)&&(o&&o[l.route.id])!==void 0;H0(a)&&(r||u)&&await _pe(a,n,r).then(d=>{d&&(t[s]=d||t[s])})}}async function _pe(i,e,t){if(t===void 0&&(t=!1),!await i.deferredData.resolveData(e)){if(t)try{return{type:Ds.data,data:i.deferredData.unwrappedData}}catch(r){return{type:Ds.error,error:r}}return{type:Ds.data,data:i.deferredData.data}}}function bpe(i){return new URLSearchParams(i).getAll("index").some(e=>e==="")}function qne(i,e){let{route:t,pathname:n,params:r}=i;return{id:t.id,pathname:n,params:r,data:e[t.id],handle:t.handle}}function u$(i,e){let t=typeof e=="string"?jp(e).search:e.search;if(i[i.length-1].route.index&&bpe(t||""))return i[i.length-1];let n=upe(i);return n[n.length-1]}/** * React Router v6.10.0 * * Copyright (c) Remix Software Inc. @@ -86,7 +86,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function zFe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}const UFe=typeof Object.is=="function"?Object.is:zFe,{useState:jFe,useEffect:KFe,useLayoutEffect:GFe,useDebugValue:qFe}=pD;function XFe(i,e,t){const n=e(),[{inst:r},o]=jFe({inst:{value:n,getSnapshot:e}});return GFe(()=>{r.value=n,r.getSnapshot=e,r6(r)&&o({inst:r})},[i,n,e]),KFe(()=>(r6(r)&&o({inst:r}),i(()=>{r6(r)&&o({inst:r})})),[i]),qFe(n),n}function r6(i){const e=i.getSnapshot,t=i.value;try{const n=e();return!UFe(t,n)}catch{return!0}}function YFe(i,e,t){return e()}const ZFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QFe=!ZFe,JFe=QFe?YFe:XFe,e4e="useSyncExternalStore"in pD?(i=>i.useSyncExternalStore)(pD):JFe,mq=C.createContext(null),vq=C.createContext(null),Cpe=C.createContext(null),g4=C.createContext(null),p4=C.createContext({outlet:null,matches:[]}),ype=C.createContext(null);function d$(){return d$=Object.assign?Object.assign.bind():function(i){for(var e=1;eObject.assign({},p,{params:Object.assign({},s,p.params),pathname:ob([a,t.encodeLocation?t.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?a:ob([a,t.encodeLocation?t.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),r,n||void 0);return e&&g?C.createElement(g4.Provider,{value:{location:d$({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ss.Pop}},g):g}function i4e(){let i=u4e(),e=dpe(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),t=i instanceof Error?i.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},e),t?C.createElement("pre",{style:r},t):null,o)}class r4e extends C.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?C.createElement(p4.Provider,{value:this.props.routeContext},C.createElement(ype.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function o4e(i){let{routeContext:e,match:t,children:n}=i,r=C.useContext(mq);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(p4.Provider,{value:e},n)}function s4e(i,e,t){if(e===void 0&&(e=[]),i==null)if(t!=null&&t.errors)i=t.matches;else return null;let n=i,r=t==null?void 0:t.errors;if(r!=null){let o=n.findIndex(s=>s.route.id&&(r==null?void 0:r[s.route.id]));o>=0||Ci(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,s,a)=>{let l=s.route.id?r==null?void 0:r[s.route.id]:null,c=null;t&&(s.route.ErrorBoundary?c=C.createElement(s.route.ErrorBoundary,null):s.route.errorElement?c=s.route.errorElement:c=C.createElement(i4e,null));let u=e.concat(n.slice(0,a+1)),d=()=>{let h=o;return l?h=c:s.route.Component?h=C.createElement(s.route.Component,null):s.route.element&&(h=s.route.element),C.createElement(o4e,{match:s,routeContext:{outlet:o,matches:u},children:h})};return t&&(s.route.ErrorBoundary||s.route.errorElement||a===0)?C.createElement(r4e,{location:t.location,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u}}):d()},null)}var Xne;(function(i){i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator"})(Xne||(Xne={}));var zP;(function(i){i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator"})(zP||(zP={}));function a4e(i){let e=C.useContext(vq);return e||Ci(!1),e}function l4e(i){let e=C.useContext(p4);return e||Ci(!1),e}function c4e(i){let e=l4e(),t=e.matches[e.matches.length-1];return t.route.id||Ci(!1),t.route.id}function u4e(){var i;let e=C.useContext(ype),t=a4e(zP.UseRouteError),n=c4e(zP.UseRouteError);return e||((i=t.errors)==null?void 0:i[n])}function d4e(i){let{fallbackElement:e,router:t}=i,n=C.useCallback(()=>t.state,[t]),r=e4e(t.subscribe,n,n),o=C.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:l=>t.navigate(l),push:(l,c,u)=>t.navigate(l,{state:c,preventScrollReset:u==null?void 0:u.preventScrollReset}),replace:(l,c,u)=>t.navigate(l,{replace:!0,state:c,preventScrollReset:u==null?void 0:u.preventScrollReset})}),[t]),s=t.basename||"/",a=C.useMemo(()=>({router:t,navigator:o,static:!1,basename:s}),[t,o,s]);return C.createElement(C.Fragment,null,C.createElement(mq.Provider,{value:a},C.createElement(vq.Provider,{value:r},C.createElement(f4e,{basename:t.basename,location:t.state.location,navigationType:t.state.historyAction,navigator:o},t.state.initialized?C.createElement(g4e,null):e))),null)}function h4e(i){Ci(!1)}function f4e(i){let{basename:e="/",children:t=null,location:n,navigationType:r=ss.Pop,navigator:o,static:s=!1}=i;_q()&&Ci(!1);let a=e.replace(/^\/*/,"/"),l=C.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof n=="string"&&(n=jp(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,g=C.useMemo(()=>{let p=f4(c,a);return p==null?null:{location:{pathname:p,search:u,hash:d,state:h,key:f},navigationType:r}},[a,c,u,d,h,f,r]);return g==null?null:C.createElement(Cpe.Provider,{value:l},C.createElement(g4.Provider,{children:t,value:g}))}function g4e(i){let{children:e,location:t}=i,n=C.useContext(mq),r=n&&!e?n.router.routes:h$(e);return n4e(r,t)}var Yne;(function(i){i[i.pending=0]="pending",i[i.success=1]="success",i[i.error=2]="error"})(Yne||(Yne={}));new Promise(()=>{});function h$(i,e){e===void 0&&(e=[]);let t=[];return C.Children.forEach(i,(n,r)=>{if(!C.isValidElement(n))return;let o=[...e,r];if(n.type===C.Fragment){t.push.apply(t,h$(n.props.children,o));return}n.type!==h4e&&Ci(!1),!n.props.index||!n.props.children||Ci(!1);let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=h$(n.props.children,o)),t.push(s)}),t}function p4e(i){return!!i.ErrorBoundary||!!i.errorElement}/** + */function zFe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}const UFe=typeof Object.is=="function"?Object.is:zFe,{useState:jFe,useEffect:KFe,useLayoutEffect:GFe,useDebugValue:qFe}=pD;function XFe(i,e,t){const n=e(),[{inst:r},o]=jFe({inst:{value:n,getSnapshot:e}});return GFe(()=>{r.value=n,r.getSnapshot=e,r6(r)&&o({inst:r})},[i,n,e]),KFe(()=>(r6(r)&&o({inst:r}),i(()=>{r6(r)&&o({inst:r})})),[i]),qFe(n),n}function r6(i){const e=i.getSnapshot,t=i.value;try{const n=e();return!UFe(t,n)}catch{return!0}}function YFe(i,e,t){return e()}const ZFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QFe=!ZFe,JFe=QFe?YFe:XFe,e4e="useSyncExternalStore"in pD?(i=>i.useSyncExternalStore)(pD):JFe,mq=C.createContext(null),vq=C.createContext(null),Cpe=C.createContext(null),g4=C.createContext(null),p4=C.createContext({outlet:null,matches:[]}),ype=C.createContext(null);function d$(){return d$=Object.assign?Object.assign.bind():function(i){for(var e=1;eObject.assign({},p,{params:Object.assign({},s,p.params),pathname:sb([a,t.encodeLocation?t.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?a:sb([a,t.encodeLocation?t.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),r,n||void 0);return e&&g?C.createElement(g4.Provider,{value:{location:d$({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ss.Pop}},g):g}function i4e(){let i=u4e(),e=dpe(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),t=i instanceof Error?i.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},e),t?C.createElement("pre",{style:r},t):null,o)}class r4e extends C.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?C.createElement(p4.Provider,{value:this.props.routeContext},C.createElement(ype.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function o4e(i){let{routeContext:e,match:t,children:n}=i,r=C.useContext(mq);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(p4.Provider,{value:e},n)}function s4e(i,e,t){if(e===void 0&&(e=[]),i==null)if(t!=null&&t.errors)i=t.matches;else return null;let n=i,r=t==null?void 0:t.errors;if(r!=null){let o=n.findIndex(s=>s.route.id&&(r==null?void 0:r[s.route.id]));o>=0||Ci(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,s,a)=>{let l=s.route.id?r==null?void 0:r[s.route.id]:null,c=null;t&&(s.route.ErrorBoundary?c=C.createElement(s.route.ErrorBoundary,null):s.route.errorElement?c=s.route.errorElement:c=C.createElement(i4e,null));let u=e.concat(n.slice(0,a+1)),d=()=>{let h=o;return l?h=c:s.route.Component?h=C.createElement(s.route.Component,null):s.route.element&&(h=s.route.element),C.createElement(o4e,{match:s,routeContext:{outlet:o,matches:u},children:h})};return t&&(s.route.ErrorBoundary||s.route.errorElement||a===0)?C.createElement(r4e,{location:t.location,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u}}):d()},null)}var Xne;(function(i){i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator"})(Xne||(Xne={}));var zP;(function(i){i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator"})(zP||(zP={}));function a4e(i){let e=C.useContext(vq);return e||Ci(!1),e}function l4e(i){let e=C.useContext(p4);return e||Ci(!1),e}function c4e(i){let e=l4e(),t=e.matches[e.matches.length-1];return t.route.id||Ci(!1),t.route.id}function u4e(){var i;let e=C.useContext(ype),t=a4e(zP.UseRouteError),n=c4e(zP.UseRouteError);return e||((i=t.errors)==null?void 0:i[n])}function d4e(i){let{fallbackElement:e,router:t}=i,n=C.useCallback(()=>t.state,[t]),r=e4e(t.subscribe,n,n),o=C.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:l=>t.navigate(l),push:(l,c,u)=>t.navigate(l,{state:c,preventScrollReset:u==null?void 0:u.preventScrollReset}),replace:(l,c,u)=>t.navigate(l,{replace:!0,state:c,preventScrollReset:u==null?void 0:u.preventScrollReset})}),[t]),s=t.basename||"/",a=C.useMemo(()=>({router:t,navigator:o,static:!1,basename:s}),[t,o,s]);return C.createElement(C.Fragment,null,C.createElement(mq.Provider,{value:a},C.createElement(vq.Provider,{value:r},C.createElement(f4e,{basename:t.basename,location:t.state.location,navigationType:t.state.historyAction,navigator:o},t.state.initialized?C.createElement(g4e,null):e))),null)}function h4e(i){Ci(!1)}function f4e(i){let{basename:e="/",children:t=null,location:n,navigationType:r=ss.Pop,navigator:o,static:s=!1}=i;_q()&&Ci(!1);let a=e.replace(/^\/*/,"/"),l=C.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof n=="string"&&(n=jp(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,g=C.useMemo(()=>{let p=f4(c,a);return p==null?null:{location:{pathname:p,search:u,hash:d,state:h,key:f},navigationType:r}},[a,c,u,d,h,f,r]);return g==null?null:C.createElement(Cpe.Provider,{value:l},C.createElement(g4.Provider,{children:t,value:g}))}function g4e(i){let{children:e,location:t}=i,n=C.useContext(mq),r=n&&!e?n.router.routes:h$(e);return n4e(r,t)}var Yne;(function(i){i[i.pending=0]="pending",i[i.success=1]="success",i[i.error=2]="error"})(Yne||(Yne={}));new Promise(()=>{});function h$(i,e){e===void 0&&(e=[]);let t=[];return C.Children.forEach(i,(n,r)=>{if(!C.isValidElement(n))return;let o=[...e,r];if(n.type===C.Fragment){t.push.apply(t,h$(n.props.children,o));return}n.type!==h4e&&Ci(!1),!n.props.index||!n.props.children||Ci(!1);let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=h$(n.props.children,o)),t.push(s)}),t}function p4e(i){return!!i.ErrorBoundary||!!i.errorElement}/** * React Router DOM v6.10.0 * * Copyright (c) Remix Software Inc. @@ -95,33 +95,33 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function f$(){return f$=Object.assign?Object.assign.bind():function(i){for(var e=1;e0}),t=[],n=0,r=e;n1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(E4e,function(l,c,u,d,h,f){if(c)e.minimumIntegerDigits=u.length;else{if(d&&h)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Rpe.test(r.stem)){e.minimumIntegerDigits=r.stem.length;continue}if(eie.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(eie,function(l,c,u,d,h,f){return u==="*"?e.minimumFractionDigits=c.length:d&&d[0]==="#"?e.maximumFractionDigits=d.length:h&&f?(e.minimumFractionDigits=h.length,e.maximumFractionDigits=h.length+f.length):(e.minimumFractionDigits=c.length,e.maximumFractionDigits=c.length),""});var o=r.options[0];o==="w"?e=hn(hn({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=hn(hn({},e),tie(o)));continue}if(Npe.test(r.stem)){e=hn(hn({},e),tie(r.stem));continue}var s=Mpe(r.stem);s&&(e=hn(hn({},e),s));var a=D4e(r.stem);a&&(e=hn(hn({},e),a))}return e}var sR={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function k4e(i,e){for(var t="",n=0;n>1),l="a",c=T4e(e);for((c=="H"||c=="k")&&(a=0);a-- >0;)t+=l;for(;s-- >0;)t=c+t}else r==="J"?t+="H":t+=r}return t}function T4e(i){var e=i.hourCycle;if(e===void 0&&i.hourCycles&&i.hourCycles.length&&(e=i.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var t=i.language,n;t!=="root"&&(n=i.maximize().region);var r=sR[n||""]||sR[t||""]||sR["".concat(t,"-001")]||sR["001"];return r[0]}var o6,N4e=new RegExp("^".concat(Tpe.source,"*")),R4e=new RegExp("".concat(Tpe.source,"*$"));function $i(i,e){return{start:i,end:e}}var M4e=!!String.prototype.startsWith,P4e=!!String.fromCodePoint,A4e=!!Object.fromEntries,O4e=!!String.prototype.codePointAt,F4e=!!String.prototype.trimStart,B4e=!!String.prototype.trimEnd,W4e=!!Number.isSafeInteger,$4e=W4e?Number.isSafeInteger:function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i&&Math.abs(i)<=9007199254740991},m$=!0;try{var H4e=Ape("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");m$=((o6=H4e.exec("a"))===null||o6===void 0?void 0:o6[0])==="a"}catch{m$=!1}var iie=M4e?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},v$=P4e?String.fromCodePoint:function(){for(var e=[],t=0;to;){if(s=e[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},rie=A4e?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r=e.charCodeAt(t),o;return r<55296||r>56319||t+1===n||(o=e.charCodeAt(t+1))<56320||o>57343?r:(r-55296<<10)+(o-56320)+65536}},V4e=F4e?function(e){return e.trimStart()}:function(e){return e.replace(N4e,"")},z4e=B4e?function(e){return e.trimEnd()}:function(e){return e.replace(R4e,"")};function Ape(i,e){return new RegExp(i,e)}var _$;if(m$){var oie=Ape("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");_$=function(e,t){var n;oie.lastIndex=t;var r=oie.exec(e);return(n=r[1])!==null&&n!==void 0?n:""}}else _$=function(e,t){for(var n=[];;){var r=Ppe(e,t);if(r===void 0||Ope(r)||G4e(r))break;n.push(r),t+=r>=65536?2:1}return v$.apply(void 0,n)};var U4e=function(){function i(e,t){t===void 0&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return i.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},i.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(e,n);if(s.err)return s;r.push(s.val)}else{if(o===125&&e>0)break;if(o===35&&(t==="plural"||t==="selectordinal")){var a=this.clonePosition();this.bump(),r.push({type:so.pound,location:$i(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Ri.UNMATCHED_CLOSING_TAG,$i(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&b$(this.peek()||0)){var s=this.parseTag(e,t);if(s.err)return s;r.push(s.val)}else{var s=this.parseLiteral(e,t);if(s.err)return s;r.push(s.val)}}}return{val:r,err:null}},i.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:so.literal,value:"<".concat(r,"/>"),location:$i(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:so.tag,value:r,children:s,location:$i(n,this.clonePosition())},err:null}:this.error(Ri.INVALID_TAG,$i(a,this.clonePosition())))}else return this.error(Ri.UNCLOSED_TAG,$i(n,this.clonePosition()))}else return this.error(Ri.INVALID_TAG,$i(n,this.clonePosition()))},i.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&K4e(this.char());)this.bump();return this.message.slice(e,this.offset())},i.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o){r+=o;continue}var s=this.tryParseUnquoted(e,t);if(s){r+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){r+=a;continue}break}var l=$i(n,this.clonePosition());return{val:{type:so.literal,value:r,location:l},err:null}},i.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!j4e(this.peek()||0))?(this.bump(),"<"):null},i.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return v$.apply(void 0,t)},i.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),v$(n))},i.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Ri.EMPTY_ARGUMENT,$i(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Ri.MALFORMED_ARGUMENT,$i(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:so.argument,value:r,location:$i(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Ri.MALFORMED_ARGUMENT,$i(n,this.clonePosition()))}},i.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=_$(this.message,t),r=t+n.length;this.bumpTo(r);var o=this.clonePosition(),s=$i(e,o);return{value:n,location:s}},i.prototype.parseArgumentOptions=function(e,t,n,r){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(Ri.EXPECT_ARGUMENT_TYPE,$i(s,l));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var h=z4e(d.val);if(h.length===0)return this.error(Ri.EXPECT_ARGUMENT_STYLE,$i(this.clonePosition(),this.clonePosition()));var f=$i(u,this.clonePosition());c={style:h,styleLocation:f}}var g=this.tryParseArgumentClose(r);if(g.err)return g;var p=$i(r,this.clonePosition());if(c&&iie(c==null?void 0:c.style,"::",0)){var m=V4e(c.style.slice(2));if(a==="number"){var d=this.parseNumberSkeletonFromString(m,c.styleLocation);return d.err?d:{val:{type:so.number,value:n,location:p,style:d.val},err:null}}else{if(m.length===0)return this.error(Ri.EXPECT_DATE_TIME_SKELETON,p);var v=m;this.locale&&(v=k4e(m,this.locale));var h={type:Rw.dateTime,pattern:v,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?w4e(v):{}},_=a==="date"?so.date:so.time;return{val:{type:_,value:n,location:p,style:h},err:null}}}return{val:{type:a==="number"?so.number:a==="date"?so.date:so.time,value:n,location:p,style:(o=c==null?void 0:c.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Ri.EXPECT_SELECT_ARGUMENT_OPTIONS,$i(y,hn({},y)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),L=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(Ri.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,$i(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(Ri.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ri.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),S=this.parseIdentifierIfPossible(),L=d.val}var E=this.tryParsePluralOrSelectOptions(e,a,t,S);if(E.err)return E;var g=this.tryParseArgumentClose(r);if(g.err)return g;var D=$i(r,this.clonePosition());return a==="select"?{val:{type:so.select,value:n,options:rie(E.val),location:D},err:null}:{val:{type:so.plural,value:n,options:rie(E.val),offset:L,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(Ri.INVALID_ARGUMENT_TYPE,$i(s,l))}},i.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},i.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Ri.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,$i(r,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(t.offset,this.offset()),err:null}},i.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=x4e(e)}catch{return this.error(Ri.INVALID_NUMBER_SKELETON,t)}return{val:{type:Rw.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?I4e(n):{}},err:null}},i.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,s=!1,a=[],l=new Set,c=r.value,u=r.location;;){if(c.length===0){var d=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ri.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=$i(d,this.clonePosition()),c=this.message.slice(d.offset,this.offset())}else break}if(l.has(c))return this.error(t==="select"?Ri.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ri.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);c==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?Ri.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,$i(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,n);if(g.err)return g;var p=this.tryParseArgumentClose(f);if(p.err)return p;a.push([c,{value:g.val,location:$i(f,this.clonePosition())}]),l.add(c),this.bumpSpace(),o=this.parseIdentifierIfPossible(),c=o.value,u=o.location}return a.length===0?this.error(t==="select"?Ri.EXPECT_SELECT_ARGUMENT_SELECTOR:Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR,$i(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(Ri.MISSING_OTHER_CLAUSE,$i(this.clonePosition(),this.clonePosition())):{val:a,err:null}},i.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=$i(r,this.clonePosition());return o?(s*=n,$4e(s)?{val:s,err:null}:this.error(t,l)):this.error(e,l)},i.prototype.offset=function(){return this.position.offset},i.prototype.isEOF=function(){return this.offset()===this.message.length},i.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},i.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Ppe(this.message,e);if(t===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},i.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},i.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},i.prototype.bumpIf=function(e){if(iie(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},i.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},i.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ope(this.char());)this.bump()},i.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return n??null},i}();function b$(i){return i>=97&&i<=122||i>=65&&i<=90}function j4e(i){return b$(i)||i===47}function K4e(i){return i===45||i===46||i>=48&&i<=57||i===95||i>=97&&i<=122||i>=65&&i<=90||i==183||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8255&&i<=8256||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}function Ope(i){return i>=9&&i<=13||i===32||i===133||i>=8206&&i<=8207||i===8232||i===8233}function G4e(i){return i>=33&&i<=35||i===36||i>=37&&i<=39||i===40||i===41||i===42||i===43||i===44||i===45||i>=46&&i<=47||i>=58&&i<=59||i>=60&&i<=62||i>=63&&i<=64||i===91||i===92||i===93||i===94||i===96||i===123||i===124||i===125||i===126||i===161||i>=162&&i<=165||i===166||i===167||i===169||i===171||i===172||i===174||i===176||i===177||i===182||i===187||i===191||i===215||i===247||i>=8208&&i<=8213||i>=8214&&i<=8215||i===8216||i===8217||i===8218||i>=8219&&i<=8220||i===8221||i===8222||i===8223||i>=8224&&i<=8231||i>=8240&&i<=8248||i===8249||i===8250||i>=8251&&i<=8254||i>=8257&&i<=8259||i===8260||i===8261||i===8262||i>=8263&&i<=8273||i===8274||i===8275||i>=8277&&i<=8286||i>=8592&&i<=8596||i>=8597&&i<=8601||i>=8602&&i<=8603||i>=8604&&i<=8607||i===8608||i>=8609&&i<=8610||i===8611||i>=8612&&i<=8613||i===8614||i>=8615&&i<=8621||i===8622||i>=8623&&i<=8653||i>=8654&&i<=8655||i>=8656&&i<=8657||i===8658||i===8659||i===8660||i>=8661&&i<=8691||i>=8692&&i<=8959||i>=8960&&i<=8967||i===8968||i===8969||i===8970||i===8971||i>=8972&&i<=8991||i>=8992&&i<=8993||i>=8994&&i<=9e3||i===9001||i===9002||i>=9003&&i<=9083||i===9084||i>=9085&&i<=9114||i>=9115&&i<=9139||i>=9140&&i<=9179||i>=9180&&i<=9185||i>=9186&&i<=9254||i>=9255&&i<=9279||i>=9280&&i<=9290||i>=9291&&i<=9311||i>=9472&&i<=9654||i===9655||i>=9656&&i<=9664||i===9665||i>=9666&&i<=9719||i>=9720&&i<=9727||i>=9728&&i<=9838||i===9839||i>=9840&&i<=10087||i===10088||i===10089||i===10090||i===10091||i===10092||i===10093||i===10094||i===10095||i===10096||i===10097||i===10098||i===10099||i===10100||i===10101||i>=10132&&i<=10175||i>=10176&&i<=10180||i===10181||i===10182||i>=10183&&i<=10213||i===10214||i===10215||i===10216||i===10217||i===10218||i===10219||i===10220||i===10221||i===10222||i===10223||i>=10224&&i<=10239||i>=10240&&i<=10495||i>=10496&&i<=10626||i===10627||i===10628||i===10629||i===10630||i===10631||i===10632||i===10633||i===10634||i===10635||i===10636||i===10637||i===10638||i===10639||i===10640||i===10641||i===10642||i===10643||i===10644||i===10645||i===10646||i===10647||i===10648||i>=10649&&i<=10711||i===10712||i===10713||i===10714||i===10715||i>=10716&&i<=10747||i===10748||i===10749||i>=10750&&i<=11007||i>=11008&&i<=11055||i>=11056&&i<=11076||i>=11077&&i<=11078||i>=11079&&i<=11084||i>=11085&&i<=11123||i>=11124&&i<=11125||i>=11126&&i<=11157||i===11158||i>=11159&&i<=11263||i>=11776&&i<=11777||i===11778||i===11779||i===11780||i===11781||i>=11782&&i<=11784||i===11785||i===11786||i===11787||i===11788||i===11789||i>=11790&&i<=11798||i===11799||i>=11800&&i<=11801||i===11802||i===11803||i===11804||i===11805||i>=11806&&i<=11807||i===11808||i===11809||i===11810||i===11811||i===11812||i===11813||i===11814||i===11815||i===11816||i===11817||i>=11818&&i<=11822||i===11823||i>=11824&&i<=11833||i>=11834&&i<=11835||i>=11836&&i<=11839||i===11840||i===11841||i===11842||i>=11843&&i<=11855||i>=11856&&i<=11857||i===11858||i>=11859&&i<=11903||i>=12289&&i<=12291||i===12296||i===12297||i===12298||i===12299||i===12300||i===12301||i===12302||i===12303||i===12304||i===12305||i>=12306&&i<=12307||i===12308||i===12309||i===12310||i===12311||i===12312||i===12313||i===12314||i===12315||i===12316||i===12317||i>=12318&&i<=12319||i===12320||i===12336||i===64830||i===64831||i>=65093&&i<=65094}function C$(i){i.forEach(function(e){if(delete e.location,Epe(e)||Dpe(e))for(var t in e.options)delete e.options[t].location,C$(e.options[t].value);else Spe(e)&&kpe(e.style)||(xpe(e)||Lpe(e))&&p$(e.style)?delete e.style.location:Ipe(e)&&C$(e.children)})}function q4e(i,e){e===void 0&&(e={}),e=hn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var t=new U4e(i,e).parse();if(t.err){var n=SyntaxError(Ri[t.err.kind]);throw n.location=t.err.location,n.originalMessage=t.err.message,n}return e!=null&&e.captureLocation||C$(t.val),t.val}function tf(i,e){var t=e&&e.cache?e.cache:e3e,n=e&&e.serializer?e.serializer:J4e,r=e&&e.strategy?e.strategy:Y4e;return r(i,{cache:t,serializer:n})}function X4e(i){return i==null||typeof i=="number"||typeof i=="boolean"}function Fpe(i,e,t,n){var r=X4e(n)?n:t(n),o=e.get(r);return typeof o>"u"&&(o=i.call(this,n),e.set(r,o)),o}function Bpe(i,e,t){var n=Array.prototype.slice.call(arguments,3),r=t(n),o=e.get(r);return typeof o>"u"&&(o=i.apply(this,n),e.set(r,o)),o}function bq(i,e,t,n,r){return t.bind(e,i,n,r)}function Y4e(i,e){var t=i.length===1?Fpe:Bpe;return bq(i,this,t,e.cache.create(),e.serializer)}function Z4e(i,e){return bq(i,this,Bpe,e.cache.create(),e.serializer)}function Q4e(i,e){return bq(i,this,Fpe,e.cache.create(),e.serializer)}var J4e=function(){return JSON.stringify(arguments)};function Cq(){this.cache=Object.create(null)}Cq.prototype.get=function(i){return this.cache[i]};Cq.prototype.set=function(i,e){this.cache[i]=e};var e3e={create:function(){return new Cq}},nf={variadic:Z4e,monadic:Q4e},Hf;(function(i){i.MISSING_VALUE="MISSING_VALUE",i.INVALID_VALUE="INVALID_VALUE",i.MISSING_INTL_API="MISSING_INTL_API"})(Hf||(Hf={}));var L_=function(i){ud(e,i);function e(t,n,r){var o=i.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),sie=function(i){ud(e,i);function e(t,n,r,o){return i.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Hf.INVALID_VALUE,o)||this}return e}(L_),t3e=function(i){ud(e,i);function e(t,n,r){return i.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Hf.INVALID_VALUE,r)||this}return e}(L_),n3e=function(i){ud(e,i);function e(t,n){return i.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Hf.MISSING_VALUE,n)||this}return e}(L_),Cl;(function(i){i[i.literal=0]="literal",i[i.object=1]="object"})(Cl||(Cl={}));function i3e(i){return i.length<2?i:i.reduce(function(e,t){var n=e[e.length-1];return!n||n.type!==Cl.literal||t.type!==Cl.literal?e.push(t):n.value+=t.value,e},[])}function Wpe(i){return typeof i=="function"}function vM(i,e,t,n,r,o,s){if(i.length===1&&Jne(i[0]))return[{type:Cl.literal,value:i[0].value}];for(var a=[],l=0,c=i;l0}),t=[],n=0,r=e;n1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(E4e,function(l,c,u,d,h,f){if(c)e.minimumIntegerDigits=u.length;else{if(d&&h)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Rpe.test(r.stem)){e.minimumIntegerDigits=r.stem.length;continue}if(eie.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(eie,function(l,c,u,d,h,f){return u==="*"?e.minimumFractionDigits=c.length:d&&d[0]==="#"?e.maximumFractionDigits=d.length:h&&f?(e.minimumFractionDigits=h.length,e.maximumFractionDigits=h.length+f.length):(e.minimumFractionDigits=c.length,e.maximumFractionDigits=c.length),""});var o=r.options[0];o==="w"?e=hn(hn({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=hn(hn({},e),tie(o)));continue}if(Npe.test(r.stem)){e=hn(hn({},e),tie(r.stem));continue}var s=Mpe(r.stem);s&&(e=hn(hn({},e),s));var a=D4e(r.stem);a&&(e=hn(hn({},e),a))}return e}var sR={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function k4e(i,e){for(var t="",n=0;n>1),l="a",c=T4e(e);for((c=="H"||c=="k")&&(a=0);a-- >0;)t+=l;for(;s-- >0;)t=c+t}else r==="J"?t+="H":t+=r}return t}function T4e(i){var e=i.hourCycle;if(e===void 0&&i.hourCycles&&i.hourCycles.length&&(e=i.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var t=i.language,n;t!=="root"&&(n=i.maximize().region);var r=sR[n||""]||sR[t||""]||sR["".concat(t,"-001")]||sR["001"];return r[0]}var o6,N4e=new RegExp("^".concat(Tpe.source,"*")),R4e=new RegExp("".concat(Tpe.source,"*$"));function $i(i,e){return{start:i,end:e}}var M4e=!!String.prototype.startsWith,P4e=!!String.fromCodePoint,A4e=!!Object.fromEntries,O4e=!!String.prototype.codePointAt,F4e=!!String.prototype.trimStart,B4e=!!String.prototype.trimEnd,W4e=!!Number.isSafeInteger,$4e=W4e?Number.isSafeInteger:function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i&&Math.abs(i)<=9007199254740991},m$=!0;try{var H4e=Ape("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");m$=((o6=H4e.exec("a"))===null||o6===void 0?void 0:o6[0])==="a"}catch{m$=!1}var iie=M4e?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},v$=P4e?String.fromCodePoint:function(){for(var e=[],t=0;to;){if(s=e[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},rie=A4e?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r=e.charCodeAt(t),o;return r<55296||r>56319||t+1===n||(o=e.charCodeAt(t+1))<56320||o>57343?r:(r-55296<<10)+(o-56320)+65536}},V4e=F4e?function(e){return e.trimStart()}:function(e){return e.replace(N4e,"")},z4e=B4e?function(e){return e.trimEnd()}:function(e){return e.replace(R4e,"")};function Ape(i,e){return new RegExp(i,e)}var _$;if(m$){var oie=Ape("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");_$=function(e,t){var n;oie.lastIndex=t;var r=oie.exec(e);return(n=r[1])!==null&&n!==void 0?n:""}}else _$=function(e,t){for(var n=[];;){var r=Ppe(e,t);if(r===void 0||Ope(r)||G4e(r))break;n.push(r),t+=r>=65536?2:1}return v$.apply(void 0,n)};var U4e=function(){function i(e,t){t===void 0&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return i.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},i.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(e,n);if(s.err)return s;r.push(s.val)}else{if(o===125&&e>0)break;if(o===35&&(t==="plural"||t==="selectordinal")){var a=this.clonePosition();this.bump(),r.push({type:so.pound,location:$i(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Ri.UNMATCHED_CLOSING_TAG,$i(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&b$(this.peek()||0)){var s=this.parseTag(e,t);if(s.err)return s;r.push(s.val)}else{var s=this.parseLiteral(e,t);if(s.err)return s;r.push(s.val)}}}return{val:r,err:null}},i.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:so.literal,value:"<".concat(r,"/>"),location:$i(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:so.tag,value:r,children:s,location:$i(n,this.clonePosition())},err:null}:this.error(Ri.INVALID_TAG,$i(a,this.clonePosition())))}else return this.error(Ri.UNCLOSED_TAG,$i(n,this.clonePosition()))}else return this.error(Ri.INVALID_TAG,$i(n,this.clonePosition()))},i.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&K4e(this.char());)this.bump();return this.message.slice(e,this.offset())},i.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o){r+=o;continue}var s=this.tryParseUnquoted(e,t);if(s){r+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){r+=a;continue}break}var l=$i(n,this.clonePosition());return{val:{type:so.literal,value:r,location:l},err:null}},i.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!j4e(this.peek()||0))?(this.bump(),"<"):null},i.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return v$.apply(void 0,t)},i.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),v$(n))},i.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Ri.EMPTY_ARGUMENT,$i(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Ri.MALFORMED_ARGUMENT,$i(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:so.argument,value:r,location:$i(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Ri.MALFORMED_ARGUMENT,$i(n,this.clonePosition()))}},i.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=_$(this.message,t),r=t+n.length;this.bumpTo(r);var o=this.clonePosition(),s=$i(e,o);return{value:n,location:s}},i.prototype.parseArgumentOptions=function(e,t,n,r){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(Ri.EXPECT_ARGUMENT_TYPE,$i(s,l));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var h=z4e(d.val);if(h.length===0)return this.error(Ri.EXPECT_ARGUMENT_STYLE,$i(this.clonePosition(),this.clonePosition()));var f=$i(u,this.clonePosition());c={style:h,styleLocation:f}}var g=this.tryParseArgumentClose(r);if(g.err)return g;var p=$i(r,this.clonePosition());if(c&&iie(c==null?void 0:c.style,"::",0)){var m=V4e(c.style.slice(2));if(a==="number"){var d=this.parseNumberSkeletonFromString(m,c.styleLocation);return d.err?d:{val:{type:so.number,value:n,location:p,style:d.val},err:null}}else{if(m.length===0)return this.error(Ri.EXPECT_DATE_TIME_SKELETON,p);var v=m;this.locale&&(v=k4e(m,this.locale));var h={type:Rw.dateTime,pattern:v,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?w4e(v):{}},_=a==="date"?so.date:so.time;return{val:{type:_,value:n,location:p,style:h},err:null}}}return{val:{type:a==="number"?so.number:a==="date"?so.date:so.time,value:n,location:p,style:(o=c==null?void 0:c.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Ri.EXPECT_SELECT_ARGUMENT_OPTIONS,$i(y,hn({},y)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),L=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(Ri.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,$i(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(Ri.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ri.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),S=this.parseIdentifierIfPossible(),L=d.val}var E=this.tryParsePluralOrSelectOptions(e,a,t,S);if(E.err)return E;var g=this.tryParseArgumentClose(r);if(g.err)return g;var D=$i(r,this.clonePosition());return a==="select"?{val:{type:so.select,value:n,options:rie(E.val),location:D},err:null}:{val:{type:so.plural,value:n,options:rie(E.val),offset:L,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(Ri.INVALID_ARGUMENT_TYPE,$i(s,l))}},i.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(Ri.EXPECT_ARGUMENT_CLOSING_BRACE,$i(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},i.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Ri.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,$i(r,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(t.offset,this.offset()),err:null}},i.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=x4e(e)}catch{return this.error(Ri.INVALID_NUMBER_SKELETON,t)}return{val:{type:Rw.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?I4e(n):{}},err:null}},i.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,s=!1,a=[],l=new Set,c=r.value,u=r.location;;){if(c.length===0){var d=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ri.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=$i(d,this.clonePosition()),c=this.message.slice(d.offset,this.offset())}else break}if(l.has(c))return this.error(t==="select"?Ri.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ri.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);c==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?Ri.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,$i(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,n);if(g.err)return g;var p=this.tryParseArgumentClose(f);if(p.err)return p;a.push([c,{value:g.val,location:$i(f,this.clonePosition())}]),l.add(c),this.bumpSpace(),o=this.parseIdentifierIfPossible(),c=o.value,u=o.location}return a.length===0?this.error(t==="select"?Ri.EXPECT_SELECT_ARGUMENT_SELECTOR:Ri.EXPECT_PLURAL_ARGUMENT_SELECTOR,$i(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(Ri.MISSING_OTHER_CLAUSE,$i(this.clonePosition(),this.clonePosition())):{val:a,err:null}},i.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=$i(r,this.clonePosition());return o?(s*=n,$4e(s)?{val:s,err:null}:this.error(t,l)):this.error(e,l)},i.prototype.offset=function(){return this.position.offset},i.prototype.isEOF=function(){return this.offset()===this.message.length},i.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},i.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Ppe(this.message,e);if(t===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},i.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},i.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},i.prototype.bumpIf=function(e){if(iie(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},i.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},i.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ope(this.char());)this.bump()},i.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return n??null},i}();function b$(i){return i>=97&&i<=122||i>=65&&i<=90}function j4e(i){return b$(i)||i===47}function K4e(i){return i===45||i===46||i>=48&&i<=57||i===95||i>=97&&i<=122||i>=65&&i<=90||i==183||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8255&&i<=8256||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}function Ope(i){return i>=9&&i<=13||i===32||i===133||i>=8206&&i<=8207||i===8232||i===8233}function G4e(i){return i>=33&&i<=35||i===36||i>=37&&i<=39||i===40||i===41||i===42||i===43||i===44||i===45||i>=46&&i<=47||i>=58&&i<=59||i>=60&&i<=62||i>=63&&i<=64||i===91||i===92||i===93||i===94||i===96||i===123||i===124||i===125||i===126||i===161||i>=162&&i<=165||i===166||i===167||i===169||i===171||i===172||i===174||i===176||i===177||i===182||i===187||i===191||i===215||i===247||i>=8208&&i<=8213||i>=8214&&i<=8215||i===8216||i===8217||i===8218||i>=8219&&i<=8220||i===8221||i===8222||i===8223||i>=8224&&i<=8231||i>=8240&&i<=8248||i===8249||i===8250||i>=8251&&i<=8254||i>=8257&&i<=8259||i===8260||i===8261||i===8262||i>=8263&&i<=8273||i===8274||i===8275||i>=8277&&i<=8286||i>=8592&&i<=8596||i>=8597&&i<=8601||i>=8602&&i<=8603||i>=8604&&i<=8607||i===8608||i>=8609&&i<=8610||i===8611||i>=8612&&i<=8613||i===8614||i>=8615&&i<=8621||i===8622||i>=8623&&i<=8653||i>=8654&&i<=8655||i>=8656&&i<=8657||i===8658||i===8659||i===8660||i>=8661&&i<=8691||i>=8692&&i<=8959||i>=8960&&i<=8967||i===8968||i===8969||i===8970||i===8971||i>=8972&&i<=8991||i>=8992&&i<=8993||i>=8994&&i<=9e3||i===9001||i===9002||i>=9003&&i<=9083||i===9084||i>=9085&&i<=9114||i>=9115&&i<=9139||i>=9140&&i<=9179||i>=9180&&i<=9185||i>=9186&&i<=9254||i>=9255&&i<=9279||i>=9280&&i<=9290||i>=9291&&i<=9311||i>=9472&&i<=9654||i===9655||i>=9656&&i<=9664||i===9665||i>=9666&&i<=9719||i>=9720&&i<=9727||i>=9728&&i<=9838||i===9839||i>=9840&&i<=10087||i===10088||i===10089||i===10090||i===10091||i===10092||i===10093||i===10094||i===10095||i===10096||i===10097||i===10098||i===10099||i===10100||i===10101||i>=10132&&i<=10175||i>=10176&&i<=10180||i===10181||i===10182||i>=10183&&i<=10213||i===10214||i===10215||i===10216||i===10217||i===10218||i===10219||i===10220||i===10221||i===10222||i===10223||i>=10224&&i<=10239||i>=10240&&i<=10495||i>=10496&&i<=10626||i===10627||i===10628||i===10629||i===10630||i===10631||i===10632||i===10633||i===10634||i===10635||i===10636||i===10637||i===10638||i===10639||i===10640||i===10641||i===10642||i===10643||i===10644||i===10645||i===10646||i===10647||i===10648||i>=10649&&i<=10711||i===10712||i===10713||i===10714||i===10715||i>=10716&&i<=10747||i===10748||i===10749||i>=10750&&i<=11007||i>=11008&&i<=11055||i>=11056&&i<=11076||i>=11077&&i<=11078||i>=11079&&i<=11084||i>=11085&&i<=11123||i>=11124&&i<=11125||i>=11126&&i<=11157||i===11158||i>=11159&&i<=11263||i>=11776&&i<=11777||i===11778||i===11779||i===11780||i===11781||i>=11782&&i<=11784||i===11785||i===11786||i===11787||i===11788||i===11789||i>=11790&&i<=11798||i===11799||i>=11800&&i<=11801||i===11802||i===11803||i===11804||i===11805||i>=11806&&i<=11807||i===11808||i===11809||i===11810||i===11811||i===11812||i===11813||i===11814||i===11815||i===11816||i===11817||i>=11818&&i<=11822||i===11823||i>=11824&&i<=11833||i>=11834&&i<=11835||i>=11836&&i<=11839||i===11840||i===11841||i===11842||i>=11843&&i<=11855||i>=11856&&i<=11857||i===11858||i>=11859&&i<=11903||i>=12289&&i<=12291||i===12296||i===12297||i===12298||i===12299||i===12300||i===12301||i===12302||i===12303||i===12304||i===12305||i>=12306&&i<=12307||i===12308||i===12309||i===12310||i===12311||i===12312||i===12313||i===12314||i===12315||i===12316||i===12317||i>=12318&&i<=12319||i===12320||i===12336||i===64830||i===64831||i>=65093&&i<=65094}function C$(i){i.forEach(function(e){if(delete e.location,Epe(e)||Dpe(e))for(var t in e.options)delete e.options[t].location,C$(e.options[t].value);else Spe(e)&&kpe(e.style)||(xpe(e)||Lpe(e))&&p$(e.style)?delete e.style.location:Ipe(e)&&C$(e.children)})}function q4e(i,e){e===void 0&&(e={}),e=hn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var t=new U4e(i,e).parse();if(t.err){var n=SyntaxError(Ri[t.err.kind]);throw n.location=t.err.location,n.originalMessage=t.err.message,n}return e!=null&&e.captureLocation||C$(t.val),t.val}function tf(i,e){var t=e&&e.cache?e.cache:e3e,n=e&&e.serializer?e.serializer:J4e,r=e&&e.strategy?e.strategy:Y4e;return r(i,{cache:t,serializer:n})}function X4e(i){return i==null||typeof i=="number"||typeof i=="boolean"}function Fpe(i,e,t,n){var r=X4e(n)?n:t(n),o=e.get(r);return typeof o>"u"&&(o=i.call(this,n),e.set(r,o)),o}function Bpe(i,e,t){var n=Array.prototype.slice.call(arguments,3),r=t(n),o=e.get(r);return typeof o>"u"&&(o=i.apply(this,n),e.set(r,o)),o}function bq(i,e,t,n,r){return t.bind(e,i,n,r)}function Y4e(i,e){var t=i.length===1?Fpe:Bpe;return bq(i,this,t,e.cache.create(),e.serializer)}function Z4e(i,e){return bq(i,this,Bpe,e.cache.create(),e.serializer)}function Q4e(i,e){return bq(i,this,Fpe,e.cache.create(),e.serializer)}var J4e=function(){return JSON.stringify(arguments)};function Cq(){this.cache=Object.create(null)}Cq.prototype.get=function(i){return this.cache[i]};Cq.prototype.set=function(i,e){this.cache[i]=e};var e3e={create:function(){return new Cq}},nf={variadic:Z4e,monadic:Q4e},Hf;(function(i){i.MISSING_VALUE="MISSING_VALUE",i.INVALID_VALUE="INVALID_VALUE",i.MISSING_INTL_API="MISSING_INTL_API"})(Hf||(Hf={}));var E_=function(i){ud(e,i);function e(t,n,r){var o=i.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),sie=function(i){ud(e,i);function e(t,n,r,o){return i.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Hf.INVALID_VALUE,o)||this}return e}(E_),t3e=function(i){ud(e,i);function e(t,n,r){return i.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Hf.INVALID_VALUE,r)||this}return e}(E_),n3e=function(i){ud(e,i);function e(t,n){return i.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Hf.MISSING_VALUE,n)||this}return e}(E_),Cl;(function(i){i[i.literal=0]="literal",i[i.object=1]="object"})(Cl||(Cl={}));function i3e(i){return i.length<2?i:i.reduce(function(e,t){var n=e[e.length-1];return!n||n.type!==Cl.literal||t.type!==Cl.literal?e.push(t):n.value+=t.value,e},[])}function Wpe(i){return typeof i=="function"}function vM(i,e,t,n,r,o,s){if(i.length===1&&Jne(i[0]))return[{type:Cl.literal,value:i[0].value}];for(var a=[],l=0,c=i;l"u")){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e=="string"?e:e[0])}},i.__parse=q4e,i.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},i}(),kb;(function(i){i.FORMAT_ERROR="FORMAT_ERROR",i.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",i.INVALID_CONFIG="INVALID_CONFIG",i.MISSING_DATA="MISSING_DATA",i.MISSING_TRANSLATION="MISSING_TRANSLATION"})(kb||(kb={}));var $k=function(i){ud(e,i);function e(t,n,r){var o=this,s=r?r instanceof Error?r:new Error(String(r)):void 0;return o=i.call(this,"[@formatjs/intl Error ".concat(t,"] ").concat(n,` +`,Hf.MISSING_INTL_API,s);var S=t.getPluralRules(e,{type:u.pluralType}).select(h-(u.offset||0));y=u.options[S]||u.options.other}if(!y)throw new sie(u.value,h,Object.keys(u.options),s);a.push.apply(a,vM(y.value,e,t,n,r,h-(u.offset||0)));continue}}return i3e(a)}function r3e(i,e){return e?hn(hn(hn({},i||{}),e||{}),Object.keys(i).reduce(function(t,n){return t[n]=hn(hn({},i[n]),e[n]||{}),t},{})):i}function o3e(i,e){return e?Object.keys(i).reduce(function(t,n){return t[n]=r3e(i[n],e[n]),t},hn({},i)):i}function s6(i){return{create:function(){return{get:function(e){return i[e]},set:function(e,t){i[e]=t}}}}}function s3e(i){return i===void 0&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:tf(function(){for(var e,t=[],n=0;n"u")){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e=="string"?e:e[0])}},i.__parse=q4e,i.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},i}(),Tb;(function(i){i.FORMAT_ERROR="FORMAT_ERROR",i.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",i.INVALID_CONFIG="INVALID_CONFIG",i.MISSING_DATA="MISSING_DATA",i.MISSING_TRANSLATION="MISSING_TRANSLATION"})(Tb||(Tb={}));var $k=function(i){ud(e,i);function e(t,n,r){var o=this,s=r?r instanceof Error?r:new Error(String(r)):void 0;return o=i.call(this,"[@formatjs/intl Error ".concat(t,"] ").concat(n,` `).concat(s?` `.concat(s.message,` -`).concat(s.stack):""))||this,o.code=t,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(o,e),o}return e}(Error),a3e=function(i){ud(e,i);function e(t,n){return i.call(this,kb.UNSUPPORTED_FORMATTER,t,n)||this}return e}($k),l3e=function(i){ud(e,i);function e(t,n){return i.call(this,kb.INVALID_CONFIG,t,n)||this}return e}($k),aie=function(i){ud(e,i);function e(t,n){return i.call(this,kb.MISSING_DATA,t,n)||this}return e}($k),dd=function(i){ud(e,i);function e(t,n,r){var o=i.call(this,kb.FORMAT_ERROR,"".concat(t,` +`).concat(s.stack):""))||this,o.code=t,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(o,e),o}return e}(Error),a3e=function(i){ud(e,i);function e(t,n){return i.call(this,Tb.UNSUPPORTED_FORMATTER,t,n)||this}return e}($k),l3e=function(i){ud(e,i);function e(t,n){return i.call(this,Tb.INVALID_CONFIG,t,n)||this}return e}($k),aie=function(i){ud(e,i);function e(t,n){return i.call(this,Tb.MISSING_DATA,t,n)||this}return e}($k),dd=function(i){ud(e,i);function e(t,n,r){var o=i.call(this,Tb.FORMAT_ERROR,"".concat(t,` Locale: `).concat(n,` `),r)||this;return o.locale=n,o}return e}($k),a6=function(i){ud(e,i);function e(t,n,r,o){var s=i.call(this,"".concat(t,` MessageID: `).concat(r==null?void 0:r.id,` Default Message: `).concat(r==null?void 0:r.defaultMessage,` Description: `).concat(r==null?void 0:r.description,` -`),n,o)||this;return s.descriptor=r,s.locale=n,s}return e}(dd),c3e=function(i){ud(e,i);function e(t,n){var r=i.call(this,kb.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(n,'", using ').concat(t.defaultMessage?"default message (".concat(typeof t.defaultMessage=="string"?t.defaultMessage:t.defaultMessage.map(function(o){var s;return(s=o.value)!==null&&s!==void 0?s:JSON.stringify(o)}).join(),")"):"id"," as fallback."))||this;return r.descriptor=t,r}return e}($k);function fC(i,e,t){return t===void 0&&(t={}),e.reduce(function(n,r){return r in i?n[r]=i[r]:r in t&&(n[r]=t[r]),n},{})}var u3e=function(i){},d3e=function(i){},Hpe={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:u3e,onWarn:d3e};function Vpe(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function J_(i){return{create:function(){return{get:function(e){return i[e]},set:function(e,t){i[e]=t}}}}}function h3e(i){i===void 0&&(i=Vpe());var e=Intl.RelativeTimeFormat,t=Intl.ListFormat,n=Intl.DisplayNames,r=tf(function(){for(var a,l=[],c=0;c needs to exist in the component ancestry.")}var Gpe=hn(hn({},Hpe),{textComponent:C.Fragment});function P3e(i){return function(e){return i(C.Children.toArray(e))}}function A3e(i,e){if(i===e)return!0;if(!i||!e)return!1;var t=Object.keys(i),n=Object.keys(e),r=t.length;if(n.length!==r)return!1;for(var o=0;oi.length)&&(e=i.length);for(var t=0,n=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var L$={},i5e={get exports(){return L$},set exports(i){L$=i}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r1)&&(i=1),i}function cR(i){return i<=1?"".concat(Number(i)*100,"%"):i}function H0(i){return i.length===1?"0"+i:String(i)}function s5e(i,e,t){return{r:La(i,255)*255,g:La(e,255)*255,b:La(t,255)*255}}function gie(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=0,a=(n+r)/2;if(n===r)s=0,o=0;else{var l=n-r;switch(s=a>.5?l/(2-n-r):l/(n+r),n){case i:o=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function a5e(i,e,t){var n,r,o;if(i=La(i,360),e=La(e,100),t=La(t,100),e===0)r=t,o=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=c6(a,s,i+1/3),r=c6(a,s,i),o=c6(a,s,i-1/3)}return{r:n*255,g:r*255,b:o*255}}function E$(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=n,a=n-r,l=n===0?0:a/n;if(n===r)o=0;else{switch(n){case i:o=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var I$={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function M1(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,o=null,s=!1,a=!1;return typeof i=="string"&&(i=g5e(i)),typeof i=="object"&&(_g(i.r)&&_g(i.g)&&_g(i.b)?(e=s5e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):_g(i.h)&&_g(i.s)&&_g(i.v)?(n=cR(i.s),r=cR(i.v),e=l5e(i.h,n,r),s=!0,a="hsv"):_g(i.h)&&_g(i.s)&&_g(i.l)&&(n=cR(i.s),o=cR(i.l),e=a5e(i.h,n,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Jpe(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var h5e="[-\\+]?\\d+%?",f5e="[-\\+]?\\d*\\.\\d+%?",Gm="(?:".concat(f5e,")|(?:").concat(h5e,")"),u6="[\\s|\\(]+(".concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")\\s*\\)?"),d6="[\\s|\\(]+(".concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")\\s*\\)?"),Ld={CSS_UNIT:new RegExp(Gm),rgb:new RegExp("rgb"+u6),rgba:new RegExp("rgba"+d6),hsl:new RegExp("hsl"+u6),hsla:new RegExp("hsla"+d6),hsv:new RegExp("hsv"+u6),hsva:new RegExp("hsva"+d6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function g5e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(I$[i])i=I$[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ld.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ld.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ld.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Ld.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ld.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Ld.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ld.hex8.exec(i),t?{r:Hc(t[1]),g:Hc(t[2]),b:Hc(t[3]),a:pie(t[4]),format:e?"name":"hex8"}:(t=Ld.hex6.exec(i),t?{r:Hc(t[1]),g:Hc(t[2]),b:Hc(t[3]),format:e?"name":"hex"}:(t=Ld.hex4.exec(i),t?{r:Hc(t[1]+t[1]),g:Hc(t[2]+t[2]),b:Hc(t[3]+t[3]),a:pie(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ld.hex3.exec(i),t?{r:Hc(t[1]+t[1]),g:Hc(t[2]+t[2]),b:Hc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function _g(i){return!!Ld.CSS_UNIT.exec(String(i))}var Jr=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=d5e(e)),this.originalInput=e;var r=M1(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=Jpe(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=E$(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=E$(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=gie(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=gie(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),D$(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),c5e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(La(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(La(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+D$(this.r,this.g,this.b,!1),t=0,n=Object.entries(I$);t=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=lR(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=lR(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=lR(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=lR(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),o=t/100,s={r:(r.r-n.r)*o+n.r,g:(r.g-n.g)*o+n.g,b:(r.b-n.b)*o+n.b,a:(r.a-n.a)*o+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,o=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,o.push(new i(n));return o},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:r,v:o})),o=(o+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],o=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-uR*e:Math.round(i.h)+uR*e:n=t?Math.round(i.h)+uR*e:Math.round(i.h)-uR*e,n<0?n+=360:n>=360&&(n-=360),n}function bie(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-mie*e:e===tme?n=i.s+mie:n=i.s+p5e*e,n>1&&(n=1),t&&e===eme&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Cie(i,e,t){var n;return t?n=i.v+m5e*e:n=i.v-v5e*e,n>1&&(n=1),Number(n.toFixed(2))}function kp(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=M1(i),r=eme;r>0;r-=1){var o=vie(n),s=dR(M1({h:_ie(o,r,!0),s:bie(o,r,!0),v:Cie(o,r,!0)}));t.push(s)}t.push(dR(n));for(var a=1;a<=tme;a+=1){var l=vie(n),c=dR(M1({h:_ie(l,a),s:bie(l,a),v:Cie(l,a)}));t.push(c)}return e.theme==="dark"?_5e.map(function(u){var d=u.index,h=u.opacity,f=dR(b5e(M1(e.backgroundColor||"#141414"),M1(t[d]),h*100));return f}):t}var $y={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"},h6={},f6={};Object.keys($y).forEach(function(i){h6[i]=kp($y[i]),h6[i].primary=h6[i][5],f6[i]=kp($y[i],{theme:"dark",backgroundColor:"#141414"}),f6[i].primary=f6[i][5]});var k$={},C5e=function(e){};function y5e(i,e){}function w5e(i,e){}function S5e(){k$={}}function nme(i,e,t){!e&&!k$[t]&&(i(!1,t),k$[t]=!0)}function uo(i,e){nme(y5e,i,e)}function x5e(i,e){nme(w5e,i,e)}uo.preMessage=C5e;uo.resetWarned=S5e;uo.noteOnce=x5e;function ea(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function sb(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var yie="data-rc-order",L5e="rc-util-key",T$=new Map;function ime(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):L5e}function _4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function E5e(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function rme(i){return Array.from((T$.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function ome(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ea())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(yie,E5e(n)),t!=null&&t.nonce&&(r.nonce=t==null?void 0:t.nonce),r.innerHTML=i;var o=_4(e),s=o.firstChild;if(n){if(n==="queue"){var a=rme(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(yie))});if(a.length)return o.insertBefore(r,a[a.length-1].nextSibling),r}o.insertBefore(r,s)}else o.appendChild(r);return r}function sme(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=_4(e);return rme(t).find(function(n){return n.getAttribute(ime(e))===i})}function UP(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=sme(i,e);if(t){var n=_4(e);n.removeChild(t)}}function D5e(i,e){var t=T$.get(i);if(!t||!sb(document,t)){var n=ome("",e),r=n.parentNode;T$.set(i,r),i.removeChild(n)}}function Mw(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=_4(t);D5e(n,t);var r=sme(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==i&&(r.innerHTML=i),r}var l=ome(i,t);return l.setAttribute(ime(t),e),l}function I5e(i,e){uo(i,"[@ant-design/icons] ".concat(e))}function wie(i){return Un(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(Un(i.icon)==="object"||typeof i.icon=="function")}function Sie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:e[t]=n}return e},{})}function N$(i,e,t){return t?qe.createElement(i.tag,te(te({key:e},Sie(i.attrs)),t),(i.children||[]).map(function(n,r){return N$(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):qe.createElement(i.tag,te({key:e},Sie(i.attrs)),(i.children||[]).map(function(n,r){return N$(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function ame(i){return kp(i)[0]}function lme(i){return i?Array.isArray(i)?i:[i]:[]}var k5e=` +*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r1)&&(i=1),i}function cR(i){return i<=1?"".concat(Number(i)*100,"%"):i}function V0(i){return i.length===1?"0"+i:String(i)}function s5e(i,e,t){return{r:La(i,255)*255,g:La(e,255)*255,b:La(t,255)*255}}function gie(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=0,a=(n+r)/2;if(n===r)s=0,o=0;else{var l=n-r;switch(s=a>.5?l/(2-n-r):l/(n+r),n){case i:o=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function a5e(i,e,t){var n,r,o;if(i=La(i,360),e=La(e,100),t=La(t,100),e===0)r=t,o=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=c6(a,s,i+1/3),r=c6(a,s,i),o=c6(a,s,i-1/3)}return{r:n*255,g:r*255,b:o*255}}function E$(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=n,a=n-r,l=n===0?0:a/n;if(n===r)o=0;else{switch(n){case i:o=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var I$={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function M1(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,o=null,s=!1,a=!1;return typeof i=="string"&&(i=g5e(i)),typeof i=="object"&&(_g(i.r)&&_g(i.g)&&_g(i.b)?(e=s5e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):_g(i.h)&&_g(i.s)&&_g(i.v)?(n=cR(i.s),r=cR(i.v),e=l5e(i.h,n,r),s=!0,a="hsv"):_g(i.h)&&_g(i.s)&&_g(i.l)&&(n=cR(i.s),o=cR(i.l),e=a5e(i.h,n,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Jpe(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var h5e="[-\\+]?\\d+%?",f5e="[-\\+]?\\d*\\.\\d+%?",Gm="(?:".concat(f5e,")|(?:").concat(h5e,")"),u6="[\\s|\\(]+(".concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")\\s*\\)?"),d6="[\\s|\\(]+(".concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")[,|\\s]+(").concat(Gm,")\\s*\\)?"),Ld={CSS_UNIT:new RegExp(Gm),rgb:new RegExp("rgb"+u6),rgba:new RegExp("rgba"+d6),hsl:new RegExp("hsl"+u6),hsla:new RegExp("hsla"+d6),hsv:new RegExp("hsv"+u6),hsva:new RegExp("hsva"+d6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function g5e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(I$[i])i=I$[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ld.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ld.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ld.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Ld.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ld.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Ld.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ld.hex8.exec(i),t?{r:Hc(t[1]),g:Hc(t[2]),b:Hc(t[3]),a:pie(t[4]),format:e?"name":"hex8"}:(t=Ld.hex6.exec(i),t?{r:Hc(t[1]),g:Hc(t[2]),b:Hc(t[3]),format:e?"name":"hex"}:(t=Ld.hex4.exec(i),t?{r:Hc(t[1]+t[1]),g:Hc(t[2]+t[2]),b:Hc(t[3]+t[3]),a:pie(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ld.hex3.exec(i),t?{r:Hc(t[1]+t[1]),g:Hc(t[2]+t[2]),b:Hc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function _g(i){return!!Ld.CSS_UNIT.exec(String(i))}var Jr=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=d5e(e)),this.originalInput=e;var r=M1(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=Jpe(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=E$(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=E$(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=gie(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=gie(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),D$(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),c5e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(La(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(La(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+D$(this.r,this.g,this.b,!1),t=0,n=Object.entries(I$);t=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=lR(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=lR(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=lR(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=lR(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),o=t/100,s={r:(r.r-n.r)*o+n.r,g:(r.g-n.g)*o+n.g,b:(r.b-n.b)*o+n.b,a:(r.a-n.a)*o+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,o=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,o.push(new i(n));return o},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:r,v:o})),o=(o+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],o=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-uR*e:Math.round(i.h)+uR*e:n=t?Math.round(i.h)+uR*e:Math.round(i.h)-uR*e,n<0?n+=360:n>=360&&(n-=360),n}function bie(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-mie*e:e===tme?n=i.s+mie:n=i.s+p5e*e,n>1&&(n=1),t&&e===eme&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Cie(i,e,t){var n;return t?n=i.v+m5e*e:n=i.v-v5e*e,n>1&&(n=1),Number(n.toFixed(2))}function kp(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=M1(i),r=eme;r>0;r-=1){var o=vie(n),s=dR(M1({h:_ie(o,r,!0),s:bie(o,r,!0),v:Cie(o,r,!0)}));t.push(s)}t.push(dR(n));for(var a=1;a<=tme;a+=1){var l=vie(n),c=dR(M1({h:_ie(l,a),s:bie(l,a),v:Cie(l,a)}));t.push(c)}return e.theme==="dark"?_5e.map(function(u){var d=u.index,h=u.opacity,f=dR(b5e(M1(e.backgroundColor||"#141414"),M1(t[d]),h*100));return f}):t}var $y={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"},h6={},f6={};Object.keys($y).forEach(function(i){h6[i]=kp($y[i]),h6[i].primary=h6[i][5],f6[i]=kp($y[i],{theme:"dark",backgroundColor:"#141414"}),f6[i].primary=f6[i][5]});var k$={},C5e=function(e){};function y5e(i,e){}function w5e(i,e){}function S5e(){k$={}}function nme(i,e,t){!e&&!k$[t]&&(i(!1,t),k$[t]=!0)}function uo(i,e){nme(y5e,i,e)}function x5e(i,e){nme(w5e,i,e)}uo.preMessage=C5e;uo.resetWarned=S5e;uo.noteOnce=x5e;function ea(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ab(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var yie="data-rc-order",L5e="rc-util-key",T$=new Map;function ime(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):L5e}function _4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function E5e(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function rme(i){return Array.from((T$.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function ome(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ea())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(yie,E5e(n)),t!=null&&t.nonce&&(r.nonce=t==null?void 0:t.nonce),r.innerHTML=i;var o=_4(e),s=o.firstChild;if(n){if(n==="queue"){var a=rme(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(yie))});if(a.length)return o.insertBefore(r,a[a.length-1].nextSibling),r}o.insertBefore(r,s)}else o.appendChild(r);return r}function sme(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=_4(e);return rme(t).find(function(n){return n.getAttribute(ime(e))===i})}function UP(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=sme(i,e);if(t){var n=_4(e);n.removeChild(t)}}function D5e(i,e){var t=T$.get(i);if(!t||!ab(document,t)){var n=ome("",e),r=n.parentNode;T$.set(i,r),i.removeChild(n)}}function Mw(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=_4(t);D5e(n,t);var r=sme(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==i&&(r.innerHTML=i),r}var l=ome(i,t);return l.setAttribute(ime(t),e),l}function I5e(i,e){uo(i,"[@ant-design/icons] ".concat(e))}function wie(i){return Un(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(Un(i.icon)==="object"||typeof i.icon=="function")}function Sie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:e[t]=n}return e},{})}function N$(i,e,t){return t?qe.createElement(i.tag,te(te({key:e},Sie(i.attrs)),t),(i.children||[]).map(function(n,r){return N$(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):qe.createElement(i.tag,te({key:e},Sie(i.attrs)),(i.children||[]).map(function(n,r){return N$(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function ame(i){return kp(i)[0]}function lme(i){return i?Array.isArray(i)?i:[i]:[]}var k5e=` .anticon { display: inline-block; color: inherit; @@ -175,9 +175,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`,T5e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k5e,t=C.useContext(Sq),n=t.csp,r=t.prefixCls,o=e;r&&(o=o.replace(/anticon/g,r)),C.useEffect(function(){Mw(o,"@ant-design-icons",{prepend:!0,csp:n})},[])},N5e=["icon","className","onClick","style","primaryColor","secondaryColor"],wE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function R5e(i){var e=i.primaryColor,t=i.secondaryColor;wE.primaryColor=e,wE.secondaryColor=t||ame(e),wE.calculated=!!t}function M5e(){return te({},wE)}var b4=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Mn(e,N5e),c=wE;if(s&&(c={primaryColor:s,secondaryColor:a||ame(s)}),T5e(),I5e(wie(t),"icon should be icon definiton, but got ".concat(t)),!wie(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=te(te({},u),{},{icon:u.icon(c.primaryColor,c.secondaryColor)})),N$(u.icon,"svg-".concat(u.name),te({className:n,onClick:r,style:o,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};b4.displayName="IconReact";b4.getTwoToneColors=M5e;b4.setTwoToneColors=R5e;const Lq=b4;function cme(i){var e=lme(i),t=$e(e,2),n=t[0],r=t[1];return Lq.setTwoToneColors({primaryColor:n,secondaryColor:r})}function P5e(){var i=Lq.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var A5e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];cme("#1890ff");var C4=C.forwardRef(function(i,e){var t,n=i.className,r=i.icon,o=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Mn(i,A5e),d=C.useContext(Sq),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=De(g,f,(t={},we(t,"".concat(f,"-").concat(r.name),!!r.name),we(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),n),m=a;m===void 0&&l&&(m=-1);var v=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=lme(c),y=$e(_,2),S=y[0],L=y[1];return C.createElement("span",te(te({role:"img","aria-label":r.name},u),{},{ref:e,tabIndex:m,onClick:l,className:p}),C.createElement(Lq,{icon:r,primaryColor:S,secondaryColor:L,style:v}))});C4.displayName="AntdIcon";C4.getTwoToneColor=P5e;C4.setTwoToneColor=cme;const wi=C4;var O5e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};const F5e=O5e;var ume=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:F5e}))};ume.displayName="BulbOutlined";const xie=C.forwardRef(ume);var B5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const W5e=B5e;var dme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:W5e}))};dme.displayName="CaretDownFilled";const $5e=C.forwardRef(dme);var H5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const V5e=H5e;var hme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:V5e}))};hme.displayName="CaretDownOutlined";const z5e=C.forwardRef(hme);var U5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const j5e=U5e;var fme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:j5e}))};fme.displayName="CaretRightOutlined";const K5e=C.forwardRef(fme);var G5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};const q5e=G5e;var gme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:q5e}))};gme.displayName="CaretUpOutlined";const X5e=C.forwardRef(gme);var Y5e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};const Z5e=Y5e;var pme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:Z5e}))};pme.displayName="CheckCircleFilled";const Eq=C.forwardRef(pme);var Q5e={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"};const J5e=Q5e;var mme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:J5e}))};mme.displayName="CheckOutlined";const vme=C.forwardRef(mme);var eBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const tBe=eBe;var _me=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:tBe}))};_me.displayName="CloseCircleFilled";const PS=C.forwardRef(_me);var nBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const iBe=nBe;var bme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:iBe}))};bme.displayName="CloseOutlined";const Vk=C.forwardRef(bme);var rBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const oBe=rBe;var Cme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:oBe}))};Cme.displayName="DoubleLeftOutlined";const Lie=C.forwardRef(Cme);var sBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const aBe=sBe;var yme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:aBe}))};yme.displayName="DoubleRightOutlined";const Eie=C.forwardRef(yme);var lBe={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"};const cBe=lBe;var wme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:cBe}))};wme.displayName="DownOutlined";const Dq=C.forwardRef(wme);var uBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};const dBe=uBe;var Sme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:dBe}))};Sme.displayName="EllipsisOutlined";const xme=C.forwardRef(Sme);var hBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const fBe=hBe;var Lme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:fBe}))};Lme.displayName="ExclamationCircleFilled";const Eme=C.forwardRef(Lme);var gBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const pBe=gBe;var Dme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:pBe}))};Dme.displayName="EyeInvisibleOutlined";const mBe=C.forwardRef(Dme);var vBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};const _Be=vBe;var Ime=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:_Be}))};Ime.displayName="EyeOutlined";const kme=C.forwardRef(Ime);var bBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};const CBe=bBe;var Tme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:CBe}))};Tme.displayName="FileAddOutlined";const yBe=C.forwardRef(Tme);var wBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const SBe=wBe;var Nme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:SBe}))};Nme.displayName="FileOutlined";const Rme=C.forwardRef(Nme);var xBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"};const LBe=xBe;var Mme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:LBe}))};Mme.displayName="FilterFilled";const EBe=C.forwardRef(Mme);var DBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const IBe=DBe;var Pme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:IBe}))};Pme.displayName="FolderOpenOutlined";const Ame=C.forwardRef(Pme);var kBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const TBe=kBe;var Ome=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:TBe}))};Ome.displayName="FolderOutlined";const NBe=C.forwardRef(Ome);var RBe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28zm-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14 0-5.2-2.1-10.4-6.2-14z"}}]},name:"forward",theme:"outlined"};const MBe=RBe;var Fme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:MBe}))};Fme.displayName="ForwardOutlined";const PBe=C.forwardRef(Fme);var ABe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const OBe=ABe;var Bme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:OBe}))};Bme.displayName="HolderOutlined";const FBe=C.forwardRef(Bme);var BBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const WBe=BBe;var Wme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:WBe}))};Wme.displayName="InfoCircleFilled";const $me=C.forwardRef(Wme);var $Be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const HBe=$Be;var Hme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:HBe}))};Hme.displayName="InfoCircleOutlined";const Vme=C.forwardRef(Hme);var VBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const zBe=VBe;var zme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:zBe}))};zme.displayName="LeftOutlined";const Die=C.forwardRef(zme);var UBe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const jBe=UBe;var Ume=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:jBe}))};Ume.displayName="LoadingOutlined";const AD=C.forwardRef(Ume);var KBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const GBe=KBe;var jme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:GBe}))};jme.displayName="MinusSquareOutlined";const qBe=C.forwardRef(jme);var XBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const YBe=XBe;var Kme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:YBe}))};Kme.displayName="PlusSquareOutlined";const ZBe=C.forwardRef(Kme);var QBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};const JBe=QBe;var Gme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:JBe}))};Gme.displayName="ReloadOutlined";const e8e=C.forwardRef(Gme);var t8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const n8e=t8e;var qme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:n8e}))};qme.displayName="RightOutlined";const R$=C.forwardRef(qme);var i8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const r8e=i8e;var Xme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:r8e}))};Xme.displayName="SaveOutlined";const o8e=C.forwardRef(Xme);var s8e={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"};const a8e=s8e;var Yme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:a8e}))};Yme.displayName="SearchOutlined";const Iq=C.forwardRef(Yme);var l8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}}]},name:"star",theme:"outlined"};const c8e=l8e;var Zme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:c8e}))};Zme.displayName="StarOutlined";const u8e=C.forwardRef(Zme);var d8e={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-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const h8e=d8e;var Qme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:h8e}))};Qme.displayName="StopOutlined";const f8e=C.forwardRef(Qme);var g8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}},{tag:"path",attrs:{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4a8.42 8.42 0 00-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}}]},name:"translation",theme:"outlined"};const p8e=g8e;var Jme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:p8e}))};Jme.displayName="TranslationOutlined";const m8e=C.forwardRef(Jme);var v8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const _8e=v8e;var eve=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:_8e}))};eve.displayName="UpOutlined";const b8e=C.forwardRef(eve);function bs(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Iie(i,e){for(var t=0;t"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 zn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function y8e(i,e){if(e&&(Un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zn(i)}function xh(i){var e=C8e();return function(){var n=jP(i),r;if(e){var o=jP(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return y8e(this,r)}}function od(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return qe.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(od(n)):MD.isFragment(n)&&n.props?t=t.concat(od(n.props.children,e)):t.push(n))}),t}function gC(i,e,t){var n=C.useRef({});return(!("value"in n.current)||t(n.current.condition,e))&&(n.current.value=i(),n.current.condition=e),n.current.value}function OD(i,e){typeof i=="function"?i(e):Un(i)==="object"&&i&&"current"in i&&(i.current=e)}function pu(){for(var i=arguments.length,e=new Array(i),t=0;t0},i.prototype.connect_=function(){!P$||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),D8e?(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)},i.prototype.disconnect_=function(){!P$||!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)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,r=E8e.some(function(o){return!!~n.indexOf(o)});r&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),nve=function(i,e){for(var t=0,n=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof Pw(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new O8e(e)),this.controller_.addObserver(this),this.controller_.refresh())}},i.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 Pw(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))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},i.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new F8e(n.target,n.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),rve=typeof WeakMap<"u"?new WeakMap:new tve,ove=function(){function i(e){if(!(this instanceof i))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=I8e.getInstance(),n=new B8e(e,t,this);rve.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){ove.prototype[i]=function(){var e;return(e=rve.get(this))[i].apply(e,arguments)}});var sve=function(){return typeof GP.ResizeObserver<"u"?GP.ResizeObserver:ove}(),qm=new Map;function W8e(i){i.forEach(function(e){var t,n=e.target;(t=qm.get(n))===null||t===void 0||t.forEach(function(r){return r(n)})})}var ave=new sve(W8e);function $8e(i,e){qm.has(i)||(qm.set(i,new Set),ave.observe(i)),qm.get(i).add(e)}function H8e(i,e){qm.has(i)&&(qm.get(i).delete(e),qm.get(i).size||(ave.unobserve(i),qm.delete(i)))}var V8e=function(i){Sh(t,i);var e=xh(t);function t(){return bs(this,t),e.apply(this,arguments)}return Cs(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component),A$=C.createContext(null);function z8e(i){var e=i.children,t=i.onBatchResize,n=C.useRef(0),r=C.useRef([]),o=C.useContext(A$),s=C.useCallback(function(a,l,c){n.current+=1;var u=n.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===n.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return C.createElement(A$.Provider,{value:s},e)}function U8e(i,e){var t=i.children,n=i.disabled,r=C.useRef(null),o=C.useRef(null),s=C.useContext(A$),a=typeof t=="function",l=a?t(r):t,c=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&C.isValidElement(l)&&E_(l),d=u?l.ref:null,h=C.useMemo(function(){return pu(d,r)},[d,r]),f=function(){return FD(r.current)||FD(o.current)};C.useImperativeHandle(e,function(){return f()});var g=C.useRef(i);g.current=i;var p=C.useCallback(function(m){var v=g.current,_=v.onResize,y=v.data,S=m.getBoundingClientRect(),L=S.width,E=S.height,D=m.offsetWidth,k=m.offsetHeight,T=Math.floor(L),M=Math.floor(E);if(c.current.width!==T||c.current.height!==M||c.current.offsetWidth!==D||c.current.offsetHeight!==k){var P={width:T,height:M,offsetWidth:D,offsetHeight:k};c.current=P;var N=D===Math.round(L)?L:D,R=k===Math.round(E)?E:k,O=te(te({},P),{},{offsetWidth:N,offsetHeight:R});s==null||s(O,m,y),_&&Promise.resolve().then(function(){_(O,m)})}},[]);return C.useEffect(function(){var m=f();return m&&!n&&$8e(m,p),function(){return H8e(m,p)}},[r.current,n]),C.createElement(V8e,{ref:o},u?C.cloneElement(l,{ref:h}):l)}var j8e=C.forwardRef(U8e),K8e="rc-observer-key";function G8e(i,e){var t=i.children,n=typeof t=="function"?[t]:od(t);return n.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(K8e,"-").concat(o);return C.createElement(j8e,It({},i,{key:s,ref:o===0?e:void 0}),r)})}var Lh=C.forwardRef(G8e);Lh.Collection=z8e;function cl(i,e){var t=te({},i);return Array.isArray(e)&&e.forEach(function(n){delete t[n]}),t}function q8e(i){if(Array.isArray(i))return x$(i)}function lve(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function X8e(){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 gt(i){return q8e(i)||lve(i)||xq(i)||X8e()}function kq(i){for(var e=0,t,n=0,r=i.length;r>=4;++n,r-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&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^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&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 Tp(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(o);if(uo(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;n.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:{},n=t.salt,r=n===void 0?"":n,o=t.override,s=o===void 0?n6e:o,a=t.formatToken,l=C.useMemo(function(){return Object.assign.apply(Object,[{}].concat(gt(e)))},[e]),c=C.useMemo(function(){return YP(l)},[l]),u=C.useMemo(function(){return YP(s)},[s]),d=uve("token",[r,i.id,c,u],function(){var h=i.getDerivativeToken(l),f=te(te({},h),s);a&&(f=a(f));var g=J8e(f,r);f._tokenKey=g,r6e(g);var p="".concat(i6e,"-").concat(kq(g));return f._hashId=p,[f,p]},function(h){s6e(h[0]._tokenKey)});return d}var l6e={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},hve="comm",fve="rule",gve="decl",c6e="@import",u6e="@keyframes",d6e=Math.abs,Tq=String.fromCharCode;function pve(i){return i.trim()}function F$(i,e,t){return i.replace(e,t)}function h6e(i,e){return i.indexOf(e)}function BD(i,e){return i.charCodeAt(e)|0}function WD(i,e,t){return i.slice(e,t)}function Rm(i){return i.length}function mve(i){return i.length}function hR(i,e){return e.push(i),i}var S4=1,Aw=1,vve=0,sd=0,ds=0,AS="";function Nq(i,e,t,n,r,o,s){return{value:i,root:e,parent:t,type:n,props:r,children:o,line:S4,column:Aw,length:s,return:""}}function f6e(){return ds}function g6e(){return ds=sd>0?BD(AS,--sd):0,Aw--,ds===10&&(Aw=1,S4--),ds}function th(){return ds=sd2||B$(ds)>3?"":" "}function _6e(i,e){for(;--e&&th()&&!(ds<48||ds>102||ds>57&&ds<65||ds>70&&ds<97););return x4(i,_M()+(e<6&&ab()==32&&th()==32))}function W$(i){for(;th();)switch(ds){case i:return sd;case 34:case 39:i!==34&&i!==39&&W$(ds);break;case 40:i===41&&W$(i);break;case 92:th();break}return sd}function b6e(i,e){for(;th()&&i+ds!==47+10;)if(i+ds===42+42&&ab()===47)break;return"/*"+x4(e,sd-1)+"*"+Tq(i===47?i:th())}function C6e(i){for(;!B$(ab());)th();return x4(i,sd)}function y6e(i){return m6e(bM("",null,null,null,[""],i=p6e(i),0,[0],i))}function bM(i,e,t,n,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,m=1,v=1,_=0,y="",S=r,L=o,E=n,D=y;m;)switch(g=_,_=th()){case 40:if(g!=108&&BD(D,d-1)==58){h6e(D+=F$(p6(_),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:D+=p6(_);break;case 9:case 10:case 13:case 32:D+=v6e(g);break;case 92:D+=_6e(_M()-1,7);continue;case 47:switch(ab()){case 42:case 47:hR(w6e(b6e(th(),_M()),e,t),l);break;default:D+="/"}break;case 123*p:a[c++]=Rm(D)*v;case 125*p:case 59:case 0:switch(_){case 0:case 125:m=0;case 59+u:f>0&&Rm(D)-d&&hR(f>32?Nie(D+";",n,t,d-1):Nie(F$(D," ","")+";",n,t,d-2),l);break;case 59:D+=";";default:if(hR(E=Tie(D,e,t,c,u,r,a,y,S=[],L=[],d),o),_===123)if(u===0)bM(D,e,E,E,S,o,d,a,L);else switch(h===99&&BD(D,3)===110?100:h){case 100:case 109:case 115:bM(i,E,E,n&&hR(Tie(i,E,E,0,0,r,a,y,r,S=[],d),L),r,L,d,a,n?S:L);break;default:bM(D,E,E,E,[""],L,0,a,L)}}c=u=f=0,p=v=1,y=D="",d=s;break;case 58:d=1+Rm(D),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&g6e()==125)continue}switch(D+=Tq(_),_*p){case 38:v=u>0?1:(D+="\f",-1);break;case 44:a[c++]=(Rm(D)-1)*v,v=1;break;case 64:ab()===45&&(D+=p6(th())),h=ab(),u=d=Rm(y=D+=C6e(_M())),_++;break;case 45:g===45&&Rm(D)==2&&(p=0)}}return o}function Tie(i,e,t,n,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=mve(h),g=0,p=0,m=0;g0?h[v]+" "+_:F$(_,/&\f/g,h[v])))&&(l[m++]=y);return Nq(i,e,t,r===0?fve:a,l,c,u)}function w6e(i,e,t){return Nq(i,e,t,hve,Tq(f6e()),WD(i,2,-2),0)}function Nie(i,e,t,n){return Nq(i,e,t,gve,WD(i,0,n),WD(i,n+1,-1),n)}function $$(i,e){for(var t="",n=mve(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=n.root,o=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var S=y.getName(a);if(!f[S]){var L=i(y.style,t,{root:!1,parentSelectors:s}),E=$e(L,1),D=E[0];f[S]="@keyframes ".concat(y.getName(a)).concat(D)}}function p(y){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,S):L&&S.push(L)}),S}var m=p(Array.isArray(e)?e:[e]);if(m.forEach(function(y){var S=typeof y=="string"&&!r?{}:y;if(typeof S=="string")h+="".concat(S,` -`);else if(S._keyframe)g(S);else{var L=d.reduce(function(E,D){var k;return(D==null||(k=D.visit)===null||k===void 0?void 0:k.call(D,E))||E},S);Object.keys(L).forEach(function(E){var D=L[E];if(Un(D)==="object"&&D&&(E!=="animationName"||!D._keyframe)&&!L6e(D)){var k=!1,T=E.trim(),M=!1;(r||o)&&a?T.startsWith("@")?k=!0:T=E6e(E,a,c):r&&!a&&(T==="&"||T==="")&&(T="",M=!0);var P=i(D,t,{root:M,injectHash:k,parentSelectors:[].concat(gt(s),[T])}),N=$e(P,2),R=N[0],O=N[1];f=te(te({},f),O),h+="".concat(T).concat(R)}else{var B,$=(B=D==null?void 0:D.value)!==null&&B!==void 0?B:D,G=E.replace(/[A-Z]/g,function(j){return"-".concat(j.toLowerCase())}),U=$;!l6e[E]&&typeof U=="number"&&U!==0&&(U="".concat(U,"px")),E==="animationName"&&D!==null&&D!==void 0&&D._keyframe&&(g(D),U=D.getName(a)),h+="".concat(G,":").concat(U,";")}})}}),!r)h="{".concat(h,"}");else if(l&&t6e()){var v=l.split(","),_=v[v.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),v.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function I6e(i,e){return kq("".concat(i.join("%")).concat(e))}function k6e(){return null}function H$(i,e){var t=i.token,n=i.path,r=i.hashId,o=i.layer,s=i.nonce,a=C.useContext(cve),l=a.autoClear;a.mock;var c=a.defaultCache,u=a.hashPriority,d=a.container,h=a.ssrInline,f=a.transformers,g=a.linters,p=t._tokenKey,m=[p].concat(gt(n)),v=Rie,_=uve("style",m,function(){var D=e(),k=D6e(D,{hashId:r,hashPriority:u,layer:o,path:n.join("-"),transformers:f,linters:g}),T=$e(k,2),M=T[0],P=T[1],N=Mie(M),R=I6e(m,N);if(v){var O={mark:Hy,prepend:"queue",attachTo:d},B=typeof s=="function"?s():s;B&&(O.csp={nonce:B});var $=Mw(N,R,O);$[SE]=XP,$.setAttribute(O$,p),Object.keys(P).forEach(function(G){Mw(Mie(P[G]),"_effect-".concat(G),O)})}return[N,p,R]},function(D,k){var T=$e(D,3),M=T[2];(k||l)&&Rie&&UP(M,{mark:Hy})}),y=$e(_,3),S=y[0],L=y[1],E=y[2];return function(D){var k;if(!h||v||!c)k=C.createElement(k6e,null);else{var T;k=C.createElement("style",It({},(T={},we(T,O$,L),we(T,Hy,E),T),{dangerouslySetInnerHTML:{__html:S}}))}return C.createElement(C.Fragment,null,k,D)}}var vi=function(){function i(e,t){bs(this,i),we(this,"name",void 0),we(this,"style",void 0),we(this,"_keyframe",!0),this.name=e,this.style=t}return Cs(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function T6e(i,e){if(i.length!==e.length)return!1;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=$e(c,2),h=d[1];return r.internalGet(u)[1]0,void 0),Pie+=1}return Cs(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,r){return r(t,n)},void 0)}}]),i}(),m6=new Rq;function _ve(i){var e=Array.isArray(i)?i:[i];return m6.has(e)||m6.set(e,new N6e(e)),m6.get(e)}function QC(i){return i.notSplit=!0,i}QC(["borderTop","borderBottom"]),QC(["borderTop"]),QC(["borderBottom"]),QC(["borderLeft","borderRight"]),QC(["borderLeft"]),QC(["borderRight"]);var V0="RC_FORM_INTERNAL_HOOKS",kr=function(){uo(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Ow=C.createContext({getFieldValue:kr,getFieldsValue:kr,getFieldError:kr,getFieldWarning:kr,getFieldsError:kr,isFieldsTouched:kr,isFieldTouched:kr,isFieldValidating:kr,isFieldsValidating:kr,resetFields:kr,setFields:kr,setFieldValue:kr,setFieldsValue:kr,validateFields:kr,submit:kr,getInternalHooks:function(){return kr(),{dispatch:kr,initEntityValue:kr,registerField:kr,useSubscribe:kr,setInitialValues:kr,destroyForm:kr,setCallbacks:kr,registerWatch:kr,getFields:kr,setValidateMessages:kr,setPreserve:kr,getInitialValue:kr}}});function V$(i){return i==null?[]:Array.isArray(i)?i:[i]}function R6e(i){return i&&!!i._init}function Nl(){Nl=function(){return i};var i={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(N,R,O){N[R]=O.value},r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(N,R,O){return Object.defineProperty(N,R,{value:O,enumerable:!0,configurable:!0,writable:!0}),N[R]}try{l({},"")}catch{l=function(O,B,$){return O[B]=$}}function c(N,R,O,B){var $=R&&R.prototype instanceof h?R:h,G=Object.create($.prototype),U=new T(B||[]);return n(G,"_invoke",{value:L(N,O,U)}),G}function u(N,R,O){try{return{type:"normal",arg:N.call(R,O)}}catch(B){return{type:"throw",arg:B}}}i.wrap=c;var d={};function h(){}function f(){}function g(){}var p={};l(p,o,function(){return this});var m=Object.getPrototypeOf,v=m&&m(m(M([])));v&&v!==e&&t.call(v,o)&&(p=v);var _=g.prototype=h.prototype=Object.create(p);function y(N){["next","throw","return"].forEach(function(R){l(N,R,function(O){return this._invoke(R,O)})})}function S(N,R){function O($,G,U,j){var ie=u(N[$],N,G);if(ie.type!=="throw"){var Y=ie.arg,J=Y.value;return J&&Un(J)=="object"&&t.call(J,"__await")?R.resolve(J.__await).then(function(Q){O("next",Q,U,j)},function(Q){O("throw",Q,U,j)}):R.resolve(J).then(function(Q){Y.value=Q,U(Y)},function(Q){return O("throw",Q,U,j)})}j(ie.arg)}var B;n(this,"_invoke",{value:function(G,U){function j(){return new R(function(ie,Y){O(G,U,ie,Y)})}return B=B?B.then(j,j):j()}})}function L(N,R,O){var B="suspendedStart";return function($,G){if(B==="executing")throw new Error("Generator is already running");if(B==="completed"){if($==="throw")throw G;return P()}for(O.method=$,O.arg=G;;){var U=O.delegate;if(U){var j=E(U,O);if(j){if(j===d)continue;return j}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(B==="suspendedStart")throw B="completed",O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);B="executing";var ie=u(N,R,O);if(ie.type==="normal"){if(B=O.done?"completed":"suspendedYield",ie.arg===d)continue;return{value:ie.arg,done:O.done}}ie.type==="throw"&&(B="completed",O.method="throw",O.arg=ie.arg)}}}function E(N,R){var O=R.method,B=N.iterator[O];if(B===void 0)return R.delegate=null,O==="throw"&&N.iterator.return&&(R.method="return",R.arg=void 0,E(N,R),R.method==="throw")||O!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+O+"' method")),d;var $=u(B,N.iterator,R.arg);if($.type==="throw")return R.method="throw",R.arg=$.arg,R.delegate=null,d;var G=$.arg;return G?G.done?(R[N.resultName]=G.value,R.next=N.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,d):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,d)}function D(N){var R={tryLoc:N[0]};1 in N&&(R.catchLoc=N[1]),2 in N&&(R.finallyLoc=N[2],R.afterLoc=N[3]),this.tryEntries.push(R)}function k(N){var R=N.completion||{};R.type="normal",delete R.arg,N.completion=R}function T(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(D,this),this.reset(!0)}function M(N){if(N){var R=N[o];if(R)return R.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var O=-1,B=function $(){for(;++O=0;--$){var G=this.tryEntries[$],U=G.completion;if(G.tryLoc==="root")return B("end");if(G.tryLoc<=this.prev){var j=t.call(G,"catchLoc"),ie=t.call(G,"finallyLoc");if(j&&ie){if(this.prev=0;--B){var $=this.tryEntries[B];if($.tryLoc<=this.prev&&t.call($,"finallyLoc")&&this.prev<$.finallyLoc){var G=$;break}}G&&(R==="break"||R==="continue")&&G.tryLoc<=O&&O<=G.finallyLoc&&(G=null);var U=G?G.completion:{};return U.type=R,U.arg=O,G?(this.method="next",this.next=G.finallyLoc,d):this.complete(U)},complete:function(R,O){if(R.type==="throw")throw R.arg;return R.type==="break"||R.type==="continue"?this.next=R.arg:R.type==="return"?(this.rval=this.arg=R.arg,this.method="return",this.next="end"):R.type==="normal"&&O&&(this.next=O),d},finish:function(R){for(var O=this.tryEntries.length-1;O>=0;--O){var B=this.tryEntries[O];if(B.finallyLoc===R)return this.complete(B.completion,B.afterLoc),k(B),d}},catch:function(R){for(var O=this.tryEntries.length-1;O>=0;--O){var B=this.tryEntries[O];if(B.tryLoc===R){var $=B.completion;if($.type==="throw"){var G=$.arg;k(B)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,O,B){return this.delegate={iterator:M(R),resultName:O,nextLoc:B},this.method==="next"&&(this.arg=void 0),d}},i}function Aie(i,e,t,n,r,o,s){try{var a=i[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,r)}function pC(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i.apply(e,t);function s(l){Aie(o,n,r,s,a,"next",l)}function a(l){Aie(o,n,r,s,a,"throw",l)}s(void 0)})}}function z0(){return z0=Object.assign?Object.assign.bind():function(i){for(var e=1;e"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 CM(i,e,t){return P6e()?CM=Reflect.construct.bind():CM=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&$D(c,s.prototype),c},CM.apply(null,arguments)}function A6e(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function U$(i){var e=typeof Map=="function"?new Map:void 0;return U$=function(n){if(n===null||!A6e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return CM(n,arguments,z$(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$D(r,n)},U$(i)}var O6e=/%[sdj%]/g,F6e=function(){};typeof process<"u"&&process.env;function j$(i){if(!i||!i.length)return null;var e={};return i.forEach(function(t){var n=t.field;e[n]=e[n]||[],e[n].push(t)}),e}function Yc(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function B6e(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function As(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||B6e(e)&&typeof i=="string"&&!i)}function W6e(i,e,t){var n=[],r=0,o=i.length;function s(a){n.push.apply(n,a||[]),r++,r===o&&t(n)}i.forEach(function(a){e(a,s)})}function Oie(i,e,t){var n=0,r=i.length;function o(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a0&&arguments[0]!==void 0?arguments[0]:k5e,t=C.useContext(Sq),n=t.csp,r=t.prefixCls,o=e;r&&(o=o.replace(/anticon/g,r)),C.useEffect(function(){Mw(o,"@ant-design-icons",{prepend:!0,csp:n})},[])},N5e=["icon","className","onClick","style","primaryColor","secondaryColor"],wE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function R5e(i){var e=i.primaryColor,t=i.secondaryColor;wE.primaryColor=e,wE.secondaryColor=t||ame(e),wE.calculated=!!t}function M5e(){return te({},wE)}var b4=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Mn(e,N5e),c=wE;if(s&&(c={primaryColor:s,secondaryColor:a||ame(s)}),T5e(),I5e(wie(t),"icon should be icon definiton, but got ".concat(t)),!wie(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=te(te({},u),{},{icon:u.icon(c.primaryColor,c.secondaryColor)})),N$(u.icon,"svg-".concat(u.name),te({className:n,onClick:r,style:o,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};b4.displayName="IconReact";b4.getTwoToneColors=M5e;b4.setTwoToneColors=R5e;const Lq=b4;function cme(i){var e=lme(i),t=$e(e,2),n=t[0],r=t[1];return Lq.setTwoToneColors({primaryColor:n,secondaryColor:r})}function P5e(){var i=Lq.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var A5e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];cme("#1890ff");var C4=C.forwardRef(function(i,e){var t,n=i.className,r=i.icon,o=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Mn(i,A5e),d=C.useContext(Sq),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=De(g,f,(t={},we(t,"".concat(f,"-").concat(r.name),!!r.name),we(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),n),m=a;m===void 0&&l&&(m=-1);var v=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=lme(c),y=$e(_,2),S=y[0],L=y[1];return C.createElement("span",te(te({role:"img","aria-label":r.name},u),{},{ref:e,tabIndex:m,onClick:l,className:p}),C.createElement(Lq,{icon:r,primaryColor:S,secondaryColor:L,style:v}))});C4.displayName="AntdIcon";C4.getTwoToneColor=P5e;C4.setTwoToneColor=cme;const wi=C4;var O5e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};const F5e=O5e;var ume=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:F5e}))};ume.displayName="BulbOutlined";const xie=C.forwardRef(ume);var B5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const W5e=B5e;var dme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:W5e}))};dme.displayName="CaretDownFilled";const $5e=C.forwardRef(dme);var H5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const V5e=H5e;var hme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:V5e}))};hme.displayName="CaretDownOutlined";const z5e=C.forwardRef(hme);var U5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const j5e=U5e;var fme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:j5e}))};fme.displayName="CaretRightOutlined";const K5e=C.forwardRef(fme);var G5e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};const q5e=G5e;var gme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:q5e}))};gme.displayName="CaretUpOutlined";const X5e=C.forwardRef(gme);var Y5e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};const Z5e=Y5e;var pme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:Z5e}))};pme.displayName="CheckCircleFilled";const Eq=C.forwardRef(pme);var Q5e={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"};const J5e=Q5e;var mme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:J5e}))};mme.displayName="CheckOutlined";const vme=C.forwardRef(mme);var eBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const tBe=eBe;var _me=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:tBe}))};_me.displayName="CloseCircleFilled";const PS=C.forwardRef(_me);var nBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const iBe=nBe;var bme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:iBe}))};bme.displayName="CloseOutlined";const Vk=C.forwardRef(bme);var rBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const oBe=rBe;var Cme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:oBe}))};Cme.displayName="DoubleLeftOutlined";const Lie=C.forwardRef(Cme);var sBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const aBe=sBe;var yme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:aBe}))};yme.displayName="DoubleRightOutlined";const Eie=C.forwardRef(yme);var lBe={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"};const cBe=lBe;var wme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:cBe}))};wme.displayName="DownOutlined";const Dq=C.forwardRef(wme);var uBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};const dBe=uBe;var Sme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:dBe}))};Sme.displayName="EllipsisOutlined";const xme=C.forwardRef(Sme);var hBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const fBe=hBe;var Lme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:fBe}))};Lme.displayName="ExclamationCircleFilled";const Eme=C.forwardRef(Lme);var gBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const pBe=gBe;var Dme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:pBe}))};Dme.displayName="EyeInvisibleOutlined";const mBe=C.forwardRef(Dme);var vBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};const _Be=vBe;var Ime=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:_Be}))};Ime.displayName="EyeOutlined";const kme=C.forwardRef(Ime);var bBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};const CBe=bBe;var Tme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:CBe}))};Tme.displayName="FileAddOutlined";const yBe=C.forwardRef(Tme);var wBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const SBe=wBe;var Nme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:SBe}))};Nme.displayName="FileOutlined";const Rme=C.forwardRef(Nme);var xBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"};const LBe=xBe;var Mme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:LBe}))};Mme.displayName="FilterFilled";const EBe=C.forwardRef(Mme);var DBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const IBe=DBe;var Pme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:IBe}))};Pme.displayName="FolderOpenOutlined";const Ame=C.forwardRef(Pme);var kBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const TBe=kBe;var Ome=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:TBe}))};Ome.displayName="FolderOutlined";const NBe=C.forwardRef(Ome);var RBe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28zm-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14 0-5.2-2.1-10.4-6.2-14z"}}]},name:"forward",theme:"outlined"};const MBe=RBe;var Fme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:MBe}))};Fme.displayName="ForwardOutlined";const PBe=C.forwardRef(Fme);var ABe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const OBe=ABe;var Bme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:OBe}))};Bme.displayName="HolderOutlined";const FBe=C.forwardRef(Bme);var BBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const WBe=BBe;var Wme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:WBe}))};Wme.displayName="InfoCircleFilled";const $me=C.forwardRef(Wme);var $Be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const HBe=$Be;var Hme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:HBe}))};Hme.displayName="InfoCircleOutlined";const Vme=C.forwardRef(Hme);var VBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const zBe=VBe;var zme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:zBe}))};zme.displayName="LeftOutlined";const Die=C.forwardRef(zme);var UBe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const jBe=UBe;var Ume=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:jBe}))};Ume.displayName="LoadingOutlined";const AD=C.forwardRef(Ume);var KBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const GBe=KBe;var jme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:GBe}))};jme.displayName="MinusSquareOutlined";const qBe=C.forwardRef(jme);var XBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const YBe=XBe;var Kme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:YBe}))};Kme.displayName="PlusSquareOutlined";const ZBe=C.forwardRef(Kme);var QBe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};const JBe=QBe;var Gme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:JBe}))};Gme.displayName="ReloadOutlined";const e8e=C.forwardRef(Gme);var t8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const n8e=t8e;var qme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:n8e}))};qme.displayName="RightOutlined";const R$=C.forwardRef(qme);var i8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const r8e=i8e;var Xme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:r8e}))};Xme.displayName="SaveOutlined";const o8e=C.forwardRef(Xme);var s8e={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"};const a8e=s8e;var Yme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:a8e}))};Yme.displayName="SearchOutlined";const Iq=C.forwardRef(Yme);var l8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}}]},name:"star",theme:"outlined"};const c8e=l8e;var Zme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:c8e}))};Zme.displayName="StarOutlined";const u8e=C.forwardRef(Zme);var d8e={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-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const h8e=d8e;var Qme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:h8e}))};Qme.displayName="StopOutlined";const f8e=C.forwardRef(Qme);var g8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}},{tag:"path",attrs:{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4a8.42 8.42 0 00-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}}]},name:"translation",theme:"outlined"};const p8e=g8e;var Jme=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:p8e}))};Jme.displayName="TranslationOutlined";const m8e=C.forwardRef(Jme);var v8e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const _8e=v8e;var eve=function(e,t){return C.createElement(wi,te(te({},e),{},{ref:t,icon:_8e}))};eve.displayName="UpOutlined";const b8e=C.forwardRef(eve);function bs(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Iie(i,e){for(var t=0;t"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 zn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function y8e(i,e){if(e&&(Un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zn(i)}function xh(i){var e=C8e();return function(){var n=jP(i),r;if(e){var o=jP(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return y8e(this,r)}}function od(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return qe.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(od(n)):MD.isFragment(n)&&n.props?t=t.concat(od(n.props.children,e)):t.push(n))}),t}function pC(i,e,t){var n=C.useRef({});return(!("value"in n.current)||t(n.current.condition,e))&&(n.current.value=i(),n.current.condition=e),n.current.value}function OD(i,e){typeof i=="function"?i(e):Un(i)==="object"&&i&&"current"in i&&(i.current=e)}function pu(){for(var i=arguments.length,e=new Array(i),t=0;t0},i.prototype.connect_=function(){!P$||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),D8e?(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)},i.prototype.disconnect_=function(){!P$||!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)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,r=E8e.some(function(o){return!!~n.indexOf(o)});r&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),nve=function(i,e){for(var t=0,n=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof Pw(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new O8e(e)),this.controller_.addObserver(this),this.controller_.refresh())}},i.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 Pw(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))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},i.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new F8e(n.target,n.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),rve=typeof WeakMap<"u"?new WeakMap:new tve,ove=function(){function i(e){if(!(this instanceof i))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=I8e.getInstance(),n=new B8e(e,t,this);rve.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){ove.prototype[i]=function(){var e;return(e=rve.get(this))[i].apply(e,arguments)}});var sve=function(){return typeof GP.ResizeObserver<"u"?GP.ResizeObserver:ove}(),qm=new Map;function W8e(i){i.forEach(function(e){var t,n=e.target;(t=qm.get(n))===null||t===void 0||t.forEach(function(r){return r(n)})})}var ave=new sve(W8e);function $8e(i,e){qm.has(i)||(qm.set(i,new Set),ave.observe(i)),qm.get(i).add(e)}function H8e(i,e){qm.has(i)&&(qm.get(i).delete(e),qm.get(i).size||(ave.unobserve(i),qm.delete(i)))}var V8e=function(i){Sh(t,i);var e=xh(t);function t(){return bs(this,t),e.apply(this,arguments)}return Cs(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component),A$=C.createContext(null);function z8e(i){var e=i.children,t=i.onBatchResize,n=C.useRef(0),r=C.useRef([]),o=C.useContext(A$),s=C.useCallback(function(a,l,c){n.current+=1;var u=n.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===n.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return C.createElement(A$.Provider,{value:s},e)}function U8e(i,e){var t=i.children,n=i.disabled,r=C.useRef(null),o=C.useRef(null),s=C.useContext(A$),a=typeof t=="function",l=a?t(r):t,c=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&C.isValidElement(l)&&D_(l),d=u?l.ref:null,h=C.useMemo(function(){return pu(d,r)},[d,r]),f=function(){return FD(r.current)||FD(o.current)};C.useImperativeHandle(e,function(){return f()});var g=C.useRef(i);g.current=i;var p=C.useCallback(function(m){var v=g.current,_=v.onResize,y=v.data,S=m.getBoundingClientRect(),L=S.width,E=S.height,D=m.offsetWidth,k=m.offsetHeight,T=Math.floor(L),M=Math.floor(E);if(c.current.width!==T||c.current.height!==M||c.current.offsetWidth!==D||c.current.offsetHeight!==k){var P={width:T,height:M,offsetWidth:D,offsetHeight:k};c.current=P;var N=D===Math.round(L)?L:D,R=k===Math.round(E)?E:k,O=te(te({},P),{},{offsetWidth:N,offsetHeight:R});s==null||s(O,m,y),_&&Promise.resolve().then(function(){_(O,m)})}},[]);return C.useEffect(function(){var m=f();return m&&!n&&$8e(m,p),function(){return H8e(m,p)}},[r.current,n]),C.createElement(V8e,{ref:o},u?C.cloneElement(l,{ref:h}):l)}var j8e=C.forwardRef(U8e),K8e="rc-observer-key";function G8e(i,e){var t=i.children,n=typeof t=="function"?[t]:od(t);return n.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(K8e,"-").concat(o);return C.createElement(j8e,It({},i,{key:s,ref:o===0?e:void 0}),r)})}var Lh=C.forwardRef(G8e);Lh.Collection=z8e;function cl(i,e){var t=te({},i);return Array.isArray(e)&&e.forEach(function(n){delete t[n]}),t}function q8e(i){if(Array.isArray(i))return x$(i)}function lve(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function X8e(){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 gt(i){return q8e(i)||lve(i)||xq(i)||X8e()}function kq(i){for(var e=0,t,n=0,r=i.length;r>=4;++n,r-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&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^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&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 Tp(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(o);if(uo(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;n.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:{},n=t.salt,r=n===void 0?"":n,o=t.override,s=o===void 0?n6e:o,a=t.formatToken,l=C.useMemo(function(){return Object.assign.apply(Object,[{}].concat(gt(e)))},[e]),c=C.useMemo(function(){return YP(l)},[l]),u=C.useMemo(function(){return YP(s)},[s]),d=uve("token",[r,i.id,c,u],function(){var h=i.getDerivativeToken(l),f=te(te({},h),s);a&&(f=a(f));var g=J8e(f,r);f._tokenKey=g,r6e(g);var p="".concat(i6e,"-").concat(kq(g));return f._hashId=p,[f,p]},function(h){s6e(h[0]._tokenKey)});return d}var l6e={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},hve="comm",fve="rule",gve="decl",c6e="@import",u6e="@keyframes",d6e=Math.abs,Tq=String.fromCharCode;function pve(i){return i.trim()}function F$(i,e,t){return i.replace(e,t)}function h6e(i,e){return i.indexOf(e)}function BD(i,e){return i.charCodeAt(e)|0}function WD(i,e,t){return i.slice(e,t)}function Rm(i){return i.length}function mve(i){return i.length}function hR(i,e){return e.push(i),i}var S4=1,Aw=1,vve=0,sd=0,ds=0,AS="";function Nq(i,e,t,n,r,o,s){return{value:i,root:e,parent:t,type:n,props:r,children:o,line:S4,column:Aw,length:s,return:""}}function f6e(){return ds}function g6e(){return ds=sd>0?BD(AS,--sd):0,Aw--,ds===10&&(Aw=1,S4--),ds}function th(){return ds=sd2||B$(ds)>3?"":" "}function _6e(i,e){for(;--e&&th()&&!(ds<48||ds>102||ds>57&&ds<65||ds>70&&ds<97););return x4(i,_M()+(e<6&&lb()==32&&th()==32))}function W$(i){for(;th();)switch(ds){case i:return sd;case 34:case 39:i!==34&&i!==39&&W$(ds);break;case 40:i===41&&W$(i);break;case 92:th();break}return sd}function b6e(i,e){for(;th()&&i+ds!==47+10;)if(i+ds===42+42&&lb()===47)break;return"/*"+x4(e,sd-1)+"*"+Tq(i===47?i:th())}function C6e(i){for(;!B$(lb());)th();return x4(i,sd)}function y6e(i){return m6e(bM("",null,null,null,[""],i=p6e(i),0,[0],i))}function bM(i,e,t,n,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,m=1,v=1,_=0,y="",S=r,L=o,E=n,D=y;m;)switch(g=_,_=th()){case 40:if(g!=108&&BD(D,d-1)==58){h6e(D+=F$(p6(_),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:D+=p6(_);break;case 9:case 10:case 13:case 32:D+=v6e(g);break;case 92:D+=_6e(_M()-1,7);continue;case 47:switch(lb()){case 42:case 47:hR(w6e(b6e(th(),_M()),e,t),l);break;default:D+="/"}break;case 123*p:a[c++]=Rm(D)*v;case 125*p:case 59:case 0:switch(_){case 0:case 125:m=0;case 59+u:f>0&&Rm(D)-d&&hR(f>32?Nie(D+";",n,t,d-1):Nie(F$(D," ","")+";",n,t,d-2),l);break;case 59:D+=";";default:if(hR(E=Tie(D,e,t,c,u,r,a,y,S=[],L=[],d),o),_===123)if(u===0)bM(D,e,E,E,S,o,d,a,L);else switch(h===99&&BD(D,3)===110?100:h){case 100:case 109:case 115:bM(i,E,E,n&&hR(Tie(i,E,E,0,0,r,a,y,r,S=[],d),L),r,L,d,a,n?S:L);break;default:bM(D,E,E,E,[""],L,0,a,L)}}c=u=f=0,p=v=1,y=D="",d=s;break;case 58:d=1+Rm(D),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&g6e()==125)continue}switch(D+=Tq(_),_*p){case 38:v=u>0?1:(D+="\f",-1);break;case 44:a[c++]=(Rm(D)-1)*v,v=1;break;case 64:lb()===45&&(D+=p6(th())),h=lb(),u=d=Rm(y=D+=C6e(_M())),_++;break;case 45:g===45&&Rm(D)==2&&(p=0)}}return o}function Tie(i,e,t,n,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=mve(h),g=0,p=0,m=0;g0?h[v]+" "+_:F$(_,/&\f/g,h[v])))&&(l[m++]=y);return Nq(i,e,t,r===0?fve:a,l,c,u)}function w6e(i,e,t){return Nq(i,e,t,hve,Tq(f6e()),WD(i,2,-2),0)}function Nie(i,e,t,n){return Nq(i,e,t,gve,WD(i,0,n),WD(i,n+1,-1),n)}function $$(i,e){for(var t="",n=mve(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=n.root,o=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var S=y.getName(a);if(!f[S]){var L=i(y.style,t,{root:!1,parentSelectors:s}),E=$e(L,1),D=E[0];f[S]="@keyframes ".concat(y.getName(a)).concat(D)}}function p(y){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,S):L&&S.push(L)}),S}var m=p(Array.isArray(e)?e:[e]);if(m.forEach(function(y){var S=typeof y=="string"&&!r?{}:y;if(typeof S=="string")h+="".concat(S,` +`);else if(S._keyframe)g(S);else{var L=d.reduce(function(E,D){var k;return(D==null||(k=D.visit)===null||k===void 0?void 0:k.call(D,E))||E},S);Object.keys(L).forEach(function(E){var D=L[E];if(Un(D)==="object"&&D&&(E!=="animationName"||!D._keyframe)&&!L6e(D)){var k=!1,T=E.trim(),M=!1;(r||o)&&a?T.startsWith("@")?k=!0:T=E6e(E,a,c):r&&!a&&(T==="&"||T==="")&&(T="",M=!0);var P=i(D,t,{root:M,injectHash:k,parentSelectors:[].concat(gt(s),[T])}),N=$e(P,2),R=N[0],O=N[1];f=te(te({},f),O),h+="".concat(T).concat(R)}else{var B,$=(B=D==null?void 0:D.value)!==null&&B!==void 0?B:D,G=E.replace(/[A-Z]/g,function(j){return"-".concat(j.toLowerCase())}),U=$;!l6e[E]&&typeof U=="number"&&U!==0&&(U="".concat(U,"px")),E==="animationName"&&D!==null&&D!==void 0&&D._keyframe&&(g(D),U=D.getName(a)),h+="".concat(G,":").concat(U,";")}})}}),!r)h="{".concat(h,"}");else if(l&&t6e()){var v=l.split(","),_=v[v.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),v.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function I6e(i,e){return kq("".concat(i.join("%")).concat(e))}function k6e(){return null}function H$(i,e){var t=i.token,n=i.path,r=i.hashId,o=i.layer,s=i.nonce,a=C.useContext(cve),l=a.autoClear;a.mock;var c=a.defaultCache,u=a.hashPriority,d=a.container,h=a.ssrInline,f=a.transformers,g=a.linters,p=t._tokenKey,m=[p].concat(gt(n)),v=Rie,_=uve("style",m,function(){var D=e(),k=D6e(D,{hashId:r,hashPriority:u,layer:o,path:n.join("-"),transformers:f,linters:g}),T=$e(k,2),M=T[0],P=T[1],N=Mie(M),R=I6e(m,N);if(v){var O={mark:Hy,prepend:"queue",attachTo:d},B=typeof s=="function"?s():s;B&&(O.csp={nonce:B});var $=Mw(N,R,O);$[SE]=XP,$.setAttribute(O$,p),Object.keys(P).forEach(function(G){Mw(Mie(P[G]),"_effect-".concat(G),O)})}return[N,p,R]},function(D,k){var T=$e(D,3),M=T[2];(k||l)&&Rie&&UP(M,{mark:Hy})}),y=$e(_,3),S=y[0],L=y[1],E=y[2];return function(D){var k;if(!h||v||!c)k=C.createElement(k6e,null);else{var T;k=C.createElement("style",It({},(T={},we(T,O$,L),we(T,Hy,E),T),{dangerouslySetInnerHTML:{__html:S}}))}return C.createElement(C.Fragment,null,k,D)}}var vi=function(){function i(e,t){bs(this,i),we(this,"name",void 0),we(this,"style",void 0),we(this,"_keyframe",!0),this.name=e,this.style=t}return Cs(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function T6e(i,e){if(i.length!==e.length)return!1;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=$e(c,2),h=d[1];return r.internalGet(u)[1]0,void 0),Pie+=1}return Cs(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,r){return r(t,n)},void 0)}}]),i}(),m6=new Rq;function _ve(i){var e=Array.isArray(i)?i:[i];return m6.has(e)||m6.set(e,new N6e(e)),m6.get(e)}function QC(i){return i.notSplit=!0,i}QC(["borderTop","borderBottom"]),QC(["borderTop"]),QC(["borderBottom"]),QC(["borderLeft","borderRight"]),QC(["borderLeft"]),QC(["borderRight"]);var z0="RC_FORM_INTERNAL_HOOKS",kr=function(){uo(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Ow=C.createContext({getFieldValue:kr,getFieldsValue:kr,getFieldError:kr,getFieldWarning:kr,getFieldsError:kr,isFieldsTouched:kr,isFieldTouched:kr,isFieldValidating:kr,isFieldsValidating:kr,resetFields:kr,setFields:kr,setFieldValue:kr,setFieldsValue:kr,validateFields:kr,submit:kr,getInternalHooks:function(){return kr(),{dispatch:kr,initEntityValue:kr,registerField:kr,useSubscribe:kr,setInitialValues:kr,destroyForm:kr,setCallbacks:kr,registerWatch:kr,getFields:kr,setValidateMessages:kr,setPreserve:kr,getInitialValue:kr}}});function V$(i){return i==null?[]:Array.isArray(i)?i:[i]}function R6e(i){return i&&!!i._init}function Nl(){Nl=function(){return i};var i={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(N,R,O){N[R]=O.value},r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(N,R,O){return Object.defineProperty(N,R,{value:O,enumerable:!0,configurable:!0,writable:!0}),N[R]}try{l({},"")}catch{l=function(O,B,$){return O[B]=$}}function c(N,R,O,B){var $=R&&R.prototype instanceof h?R:h,G=Object.create($.prototype),U=new T(B||[]);return n(G,"_invoke",{value:L(N,O,U)}),G}function u(N,R,O){try{return{type:"normal",arg:N.call(R,O)}}catch(B){return{type:"throw",arg:B}}}i.wrap=c;var d={};function h(){}function f(){}function g(){}var p={};l(p,o,function(){return this});var m=Object.getPrototypeOf,v=m&&m(m(M([])));v&&v!==e&&t.call(v,o)&&(p=v);var _=g.prototype=h.prototype=Object.create(p);function y(N){["next","throw","return"].forEach(function(R){l(N,R,function(O){return this._invoke(R,O)})})}function S(N,R){function O($,G,U,j){var ie=u(N[$],N,G);if(ie.type!=="throw"){var Y=ie.arg,J=Y.value;return J&&Un(J)=="object"&&t.call(J,"__await")?R.resolve(J.__await).then(function(Q){O("next",Q,U,j)},function(Q){O("throw",Q,U,j)}):R.resolve(J).then(function(Q){Y.value=Q,U(Y)},function(Q){return O("throw",Q,U,j)})}j(ie.arg)}var B;n(this,"_invoke",{value:function(G,U){function j(){return new R(function(ie,Y){O(G,U,ie,Y)})}return B=B?B.then(j,j):j()}})}function L(N,R,O){var B="suspendedStart";return function($,G){if(B==="executing")throw new Error("Generator is already running");if(B==="completed"){if($==="throw")throw G;return P()}for(O.method=$,O.arg=G;;){var U=O.delegate;if(U){var j=E(U,O);if(j){if(j===d)continue;return j}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(B==="suspendedStart")throw B="completed",O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);B="executing";var ie=u(N,R,O);if(ie.type==="normal"){if(B=O.done?"completed":"suspendedYield",ie.arg===d)continue;return{value:ie.arg,done:O.done}}ie.type==="throw"&&(B="completed",O.method="throw",O.arg=ie.arg)}}}function E(N,R){var O=R.method,B=N.iterator[O];if(B===void 0)return R.delegate=null,O==="throw"&&N.iterator.return&&(R.method="return",R.arg=void 0,E(N,R),R.method==="throw")||O!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+O+"' method")),d;var $=u(B,N.iterator,R.arg);if($.type==="throw")return R.method="throw",R.arg=$.arg,R.delegate=null,d;var G=$.arg;return G?G.done?(R[N.resultName]=G.value,R.next=N.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,d):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,d)}function D(N){var R={tryLoc:N[0]};1 in N&&(R.catchLoc=N[1]),2 in N&&(R.finallyLoc=N[2],R.afterLoc=N[3]),this.tryEntries.push(R)}function k(N){var R=N.completion||{};R.type="normal",delete R.arg,N.completion=R}function T(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(D,this),this.reset(!0)}function M(N){if(N){var R=N[o];if(R)return R.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var O=-1,B=function $(){for(;++O=0;--$){var G=this.tryEntries[$],U=G.completion;if(G.tryLoc==="root")return B("end");if(G.tryLoc<=this.prev){var j=t.call(G,"catchLoc"),ie=t.call(G,"finallyLoc");if(j&&ie){if(this.prev=0;--B){var $=this.tryEntries[B];if($.tryLoc<=this.prev&&t.call($,"finallyLoc")&&this.prev<$.finallyLoc){var G=$;break}}G&&(R==="break"||R==="continue")&&G.tryLoc<=O&&O<=G.finallyLoc&&(G=null);var U=G?G.completion:{};return U.type=R,U.arg=O,G?(this.method="next",this.next=G.finallyLoc,d):this.complete(U)},complete:function(R,O){if(R.type==="throw")throw R.arg;return R.type==="break"||R.type==="continue"?this.next=R.arg:R.type==="return"?(this.rval=this.arg=R.arg,this.method="return",this.next="end"):R.type==="normal"&&O&&(this.next=O),d},finish:function(R){for(var O=this.tryEntries.length-1;O>=0;--O){var B=this.tryEntries[O];if(B.finallyLoc===R)return this.complete(B.completion,B.afterLoc),k(B),d}},catch:function(R){for(var O=this.tryEntries.length-1;O>=0;--O){var B=this.tryEntries[O];if(B.tryLoc===R){var $=B.completion;if($.type==="throw"){var G=$.arg;k(B)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,O,B){return this.delegate={iterator:M(R),resultName:O,nextLoc:B},this.method==="next"&&(this.arg=void 0),d}},i}function Aie(i,e,t,n,r,o,s){try{var a=i[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,r)}function mC(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i.apply(e,t);function s(l){Aie(o,n,r,s,a,"next",l)}function a(l){Aie(o,n,r,s,a,"throw",l)}s(void 0)})}}function U0(){return U0=Object.assign?Object.assign.bind():function(i){for(var e=1;e"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 CM(i,e,t){return P6e()?CM=Reflect.construct.bind():CM=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&$D(c,s.prototype),c},CM.apply(null,arguments)}function A6e(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function U$(i){var e=typeof Map=="function"?new Map:void 0;return U$=function(n){if(n===null||!A6e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return CM(n,arguments,z$(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$D(r,n)},U$(i)}var O6e=/%[sdj%]/g,F6e=function(){};typeof process<"u"&&process.env;function j$(i){if(!i||!i.length)return null;var e={};return i.forEach(function(t){var n=t.field;e[n]=e[n]||[],e[n].push(t)}),e}function Yc(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function B6e(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function As(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||B6e(e)&&typeof i=="string"&&!i)}function W6e(i,e,t){var n=[],r=0,o=i.length;function s(a){n.push.apply(n,a||[]),r++,r===o&&t(n)}i.forEach(function(a){e(a,s)})}function Oie(i,e,t){var n=0,r=i.length;function o(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a()\[\]\\.,;:\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},PL={integer:function(e){return PL.number(e)&&parseInt(e,10)===e},float:function(e){return PL.number(e)&&!PL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!PL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match($ie.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(j6e())},hex:function(e){return typeof e=="string"&&!!e.match($ie.hex)}},K6e=function(e,t,n,r,o){if(e.required&&t===void 0){bve(e,t,n,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?PL[a](t)||r.push(Yc(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Yc(o.messages.types[a],e.fullField,e.type))},G6e=function(e,t,n,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Yc(o.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?r.push(Yc(o.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&r.push(Yc(o.messages[d].range,e.fullField,e.min,e.max))},JC="enum",q6e=function(e,t,n,r,o){e[JC]=Array.isArray(e[JC])?e[JC]:[],e[JC].indexOf(t)===-1&&r.push(Yc(o.messages[JC],e.fullField,e[JC].join(", ")))},X6e=function(e,t,n,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Yc(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(Yc(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Di={required:bve,whitespace:U6e,type:K6e,range:G6e,enum:q6e,pattern:X6e},Y6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"string")&&!e.required)return n();Di.required(e,t,r,s,o,"string"),As(t,"string")||(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o),Di.pattern(e,t,r,s,o),e.whitespace===!0&&Di.whitespace(e,t,r,s,o))}n(s)},Z6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},Q6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},J6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},e9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),As(t)||Di.type(e,t,r,s,o)}n(s)},t9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},n9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},i9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();Di.required(e,t,r,s,o,"array"),t!=null&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},r9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},o9e="enum",s9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di[o9e](e,t,r,s,o)}n(s)},a9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"string")&&!e.required)return n();Di.required(e,t,r,s,o),As(t,"string")||Di.pattern(e,t,r,s,o)}n(s)},l9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"date")&&!e.required)return n();if(Di.required(e,t,r,s,o),!As(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),Di.type(e,l,r,s,o),l&&Di.range(e,l.getTime(),r,s,o)}}n(s)},c9e=function(e,t,n,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;Di.required(e,t,r,s,o,a),n(s)},v6=function(e,t,n,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(As(t,s)&&!e.required)return n();Di.required(e,t,r,a,o,s),As(t,s)||Di.type(e,t,r,a,o)}n(a)},u9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o)}n(s)},LE={string:Y6e,method:Z6e,number:Q6e,boolean:J6e,regexp:e9e,integer:t9e,float:n9e,array:i9e,object:r9e,enum:s9e,pattern:a9e,date:l9e,url:v6,hex:v6,email:v6,required:c9e,any:u9e};function K$(){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 G$=K$(),zk=function(){function i(t){this.rules=null,this._messages=G$,this.define(t)}var e=i.prototype;return e.define=function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var s=n[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Wie(K$(),n)),this._messages},e.validate=function(n,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=n,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var m=[],v={};function _(S){if(Array.isArray(S)){var L;m=(L=m).concat.apply(L,S)}else m.push(S)}for(var y=0;y3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!Yd(i,e.slice(0,-1))?i:wve(i,e,t,n)}function L4(i){return Array.isArray(i)?h9e(i):Un(i)==="object"&&i!==null?d9e(i):i}function d9e(i){if(Object.getPrototypeOf(i)===Object.prototype){var e={};for(var t in i)e[t]=L4(i[t]);return e}return i}function h9e(i){return i.map(function(e){return L4(e)})}function Xo(i){return V$(i)}function Hie(i,e){var t={};return e.forEach(function(n){var r=Yd(i,n);t=bm(t,n,r)}),t}function EE(i,e){return i&&i.some(function(t){return xve(t,e)})}function Vie(i){return Un(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Sve(i,e){var t=Array.isArray(i)?gt(i):te({},i);return e&&Object.keys(e).forEach(function(n){var r=t[n],o=e[n],s=Vie(r)&&Vie(o);t[n]=s?Sve(r,o||{}):L4(o)}),t}function DE(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=n||t<0||t>=n)return i;var r=i[e],o=e-t;return o>0?[].concat(gt(i.slice(0,t)),[r],gt(i.slice(t,e)),gt(i.slice(e+1,n))):o<0?[].concat(gt(i.slice(0,e)),gt(i.slice(e+1,t+1)),[r],gt(i.slice(t+1,n))):i}var Uie=zk;function p9e(i,e){return i.replace(/\$\{\w+\}/g,function(t){var n=t.slice(2,-1);return e[n]})}var jie="CODE_LOGIC_ERROR";function q$(i,e,t,n,r){return X$.apply(this,arguments)}function X$(){return X$=pC(Nl().mark(function i(e,t,n,r,o){var s,a,l,c,u,d,h,f,g;return Nl().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return s=te({},n),delete s.ruleIndex,Uie.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(v){return console.error(v),Promise.reject(jie)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new Uie(we({},e,[s])),u=DE({},Cve,r.validateMessages),c.messages(u),d=[],m.prev=10,m.next=13,Promise.resolve(c.validate(we({},e,t),te({},r)));case 13:m.next=18;break;case 15:m.prev=15,m.t0=m.catch(10),m.t0.errors&&(d=m.t0.errors.map(function(v,_){var y=v.message,S=y===jie?u.default:y;return C.isValidElement(S)?C.cloneElement(S,{key:"error_".concat(_)}):S}));case 18:if(!(!d.length&&l)){m.next=23;break}return m.next=21,Promise.all(t.map(function(v,_){return q$("".concat(e,".").concat(_),v,l,r,o)}));case 21:return h=m.sent,m.abrupt("return",h.reduce(function(v,_){return[].concat(gt(v),gt(_))},[]));case 23:return f=te(te({},n),{},{name:e,enum:(n.enum||[]).join(", ")},o),g=d.map(function(v){return typeof v=="string"?p9e(v,f):v}),m.abrupt("return",g);case 26:case"end":return m.stop()}},i,null,[[10,15]])})),X$.apply(this,arguments)}function m9e(i,e,t,n,r,o){var s=i.join("."),a=t.map(function(u,d){var h=u.validator,f=te(te({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,p,m){var v=!1,_=function(){for(var L=arguments.length,E=new Array(L),D=0;D0&&arguments[0]!==void 0?arguments[0]:Nu;if(r.validatePromise===d){var L;r.validatePromise=null;var E=[],D=[];(L=S.forEach)===null||L===void 0||L.call(S,function(k){var T=k.rule.warningOnly,M=k.errors,P=M===void 0?Nu:M;T?D.push.apply(D,gt(P)):E.push.apply(E,gt(P))}),r.errors=E,r.warnings=D,r.triggerMetaEvent(),r.reRender()}}),y});return r.validatePromise=d,r.dirty=!0,r.errors=Nu,r.warnings=Nu,r.triggerMetaEvent(),r.reRender(),d},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(V0),u=c.getInitialValue;return u(r.getNamePath())!==void 0},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},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},r.getOnlyChild=function(l){if(typeof l=="function"){var c=r.getMeta();return te(te({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=od(l);return u.length!==1||!C.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}},r.getValue=function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Yd(l||c(!0),u)},r.getControlled=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,m=c.fieldContext,v=d!==void 0?d:m.validateTrigger,_=r.getNamePath(),y=m.getInternalHooks,S=m.getFieldsValue,L=y(V0),E=L.dispatch,D=r.getValue(),k=p||function(N){return we({},g,N)},T=l[u],M=te(te({},l),k(D));M[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var N,R=arguments.length,O=new Array(R),B=0;B=0&&M<=P.length?(u.keys=[].concat(gt(u.keys.slice(0,M)),[u.id],gt(u.keys.slice(M))),y([].concat(gt(P.slice(0,M)),[T],gt(P.slice(M))))):(u.keys=[].concat(gt(u.keys),[u.id]),y([].concat(gt(P),[T]))),u.id+=1},remove:function(T){var M=L(),P=new Set(Array.isArray(T)?T:[T]);P.size<=0||(u.keys=u.keys.filter(function(N,R){return!P.has(R)}),y(M.filter(function(N,R){return!P.has(R)})))},move:function(T,M){if(T!==M){var P=L();T<0||T>=P.length||M<0||M>=P.length||(u.keys=zie(u.keys,T,M),y(zie(P,T,M)))}}},D=_||[];return Array.isArray(D)||(D=[]),r(D.map(function(k,T){var M=u.keys[T];return M===void 0&&(u.keys[T]=u.id,M=u.keys[T],u.id+=1),{name:T,key:M,isListField:!0}}),E,m)})))};function w9e(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(r,o){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&o(n),r(n))})})}):Promise.resolve([])}var Eve="__@field_split__";function _6(i){return i.map(function(e){return"".concat(Un(e),":").concat(e)}).join(Eve)}var e1=function(){function i(){bs(this,i),this.kvs=new Map}return Cs(i,[{key:"set",value:function(t,n){this.kvs.set(_6(t),n)}},{key:"get",value:function(t){return this.kvs.get(_6(t))}},{key:"update",value:function(t,n){var r=this.get(t),o=n(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(_6(t))}},{key:"map",value:function(t){return gt(this.kvs.entries()).map(function(n){var r=$e(n,2),o=r[0],s=r[1],a=o.split(Eve);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=$e(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var r=n.key,o=n.value;return t[r.join(".")]=o,null}),t}}]),i}(),S9e=["name"],x9e=Cs(function i(e){var t=this;bs(this,i),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,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}},this.getInternalHooks=function(n){return n===V0?(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}):(uo(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){t.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,r){if(t.initialValues=n||{},r){var o,s=DE({},n,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=bm(s,l,Yd(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}},this.destroyForm=function(){var n=new e1;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=n},this.getInitialValue=function(n){var r=Yd(t.initialValues,n);return n.length?L4(r):r},this.setCallbacks=function(n){t.callbacks=n},this.setValidateMessages=function(n){t.validateMessages=n},this.setPreserve=function(n){t.preserve=n},this.watchList=[],this.registerWatch=function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(r){return r!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){t.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new e1;return t.getFieldEntities(n).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r},this.getFieldEntitiesForNamePathList=function(n){if(!n)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return n.map(function(o){var s=Xo(o);return r.get(s)||{INVALIDATE_NAME_PATH:Xo(o)}})},this.getFieldsValue=function(n,r){if(t.warningUnhooked(),n===!0&&!r)return t.store;var o=t.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),s=[];return o.forEach(function(a){var l,c="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!n&&(!((l=a.isListField)===null||l===void 0)&&l.call(a))))if(!r)s.push(c);else{var u="getMeta"in a?a.getMeta():null;r(u)&&s.push(c)}}),Hie(t.store,s.map(Xo))},this.getFieldValue=function(n){t.warningUnhooked();var r=Xo(n);return Yd(t.store,r)},this.getFieldsError=function(n){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(n);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:Xo(n[s]),errors:[],warnings:[]}})},this.getFieldError=function(n){t.warningUnhooked();var r=Xo(n),o=t.getFieldsError([r])[0];return o.errors},this.getFieldWarning=function(n){t.warningUnhooked();var r=Xo(n),o=t.getFieldsError([r])[0];return o.warnings},this.isFieldsTouched=function(){t.warningUnhooked();for(var n=arguments.length,r=new Array(n),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},r=new e1,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)uo(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)uo(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h);(!n.skipExist||p===void 0)&&t.updateStore(bm(t.store,h,gt(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,gt(gt(c).map(function(d){return d.entity})))}})):a=o,s(a)},this.resetFields=function(n){t.warningUnhooked();var r=t.store;if(!n){t.updateStore(DE({},t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=n.map(Xo);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(bm(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)},this.setFields=function(n){t.warningUnhooked();var r=t.store,o=[];n.forEach(function(s){var a=s.name,l=Mn(s,S9e),c=Xo(a);o.push(c),"value"in l&&t.updateStore(bm(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)},this.getFields=function(){var n=t.getFieldEntities(!0),r=n.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=te(te({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r},this.initEntityValue=function(n){var r=n.props.initialValue;if(r!==void 0){var o=n.getNamePath(),s=Yd(t.store,o);s===void 0&&t.updateStore(bm(t.store,o,r))}},this.isMergedPreserve=function(n){var r=n!==void 0?n:t.preserve;return r??!0},this.registerField=function(n){t.fieldEntities.push(n);var r=n.getNamePath();if(t.notifyWatch([r]),n.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(o,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!xve(d.getNamePath(),r)})){var u=t.store;t.updateStore(bm(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var r=n.namePath,o=n.value;t.updateValue(r,o);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(n,r,o){if(t.subscribable){var s=te(te({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,r,s)})}else t.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(n,o,{type:"dependenciesUpdate",relatedFields:[r].concat(gt(o))}),o},this.updateValue=function(n,r){var o=Xo(n),s=t.store;t.updateStore(bm(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=Hie(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(gt(a)))},this.setFieldsValue=function(n){t.warningUnhooked();var r=t.store;if(n){var o=DE(t.store,n);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()},this.setFieldValue=function(n,r){t.setFields([{name:n,value:r}])},this.getDependencyChildrenFields=function(n){var r=new Set,o=[],s=new e1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=Xo(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(n),o},this.triggerOnFieldsChange=function(n,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new e1;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return EE(n,u)});o(l,s)}},this.validateFields=function(n,r){t.warningUnhooked();var o=!!n,s=o?n.map(Xo):[],a=[];t.getFieldEntities(!0).forEach(function(u){if(o||s.push(u.getNamePath()),r!=null&&r.recursive&&o){var d=u.getNamePath();d.every(function(g,p){return n[p]===g||n[p]===void 0})&&s.push(d)}if(!(!u.props.rules||!u.props.rules.length)){var h=u.getNamePath();if(!o||EE(s,h)){var f=u.validateRules(te({validateMessages:te(te({},Cve),t.validateMessages)},r));a.push(f.then(function(){return{name:h,errors:[],warnings:[]}}).catch(function(g){var p,m=[],v=[];return(p=g.forEach)===null||p===void 0||p.call(g,function(_){var y=_.rule.warningOnly,S=_.errors;y?v.push.apply(v,gt(S)):m.push.apply(m,gt(S))}),m.length?Promise.reject({name:h,errors:m,warnings:v}):{name:h,errors:m,warnings:v}}))}}});var l=w9e(a);t.lastValidatePromise=l,l.catch(function(u){return u}).then(function(u){var d=u.map(function(h){var f=h.name;return f});t.notifyObservers(t.store,d,{type:"validateFinish"}),t.triggerOnFieldsChange(d,u)});var c=l.then(function(){return t.lastValidatePromise===l?Promise.resolve(t.getFieldsValue(s)):Promise.reject([])}).catch(function(u){var d=u.filter(function(h){return h&&h.errors.length});return Promise.reject({values:t.getFieldsValue(s),errorFields:d,outOfDate:t.lastValidatePromise!==l})});return c.catch(function(u){return u}),t.triggerOnFieldsChange(s),c},this.submit=function(){t.warningUnhooked(),t.validateFields().then(function(n){var r=t.callbacks.onFinish;if(r)try{r(n)}catch(o){console.error(o)}}).catch(function(n){var r=t.callbacks.onFinishFailed;r&&r(n)})},this.forceRootUpdate=e});function Dve(i){var e=C.useRef(),t=C.useState({}),n=$e(t,2),r=n[1];if(!e.current)if(i)e.current=i;else{var o=function(){r({})},s=new x9e(o);e.current=s.getForm()}return[e.current]}var Q$=C.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ive=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,s=C.useContext(Q$),a=C.useRef({});return C.createElement(Q$.Provider,{value:te(te({},s),{},{validateMessages:te(te({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=te(te({},a.current),{},we({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=te({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},L9e=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],E9e=function(e,t){var n=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,m=e.onFinish,v=e.onFinishFailed,_=Mn(e,L9e),y=C.useContext(Q$),S=Dve(s),L=$e(S,1),E=L[0],D=E.getInternalHooks(V0),k=D.useSubscribe,T=D.setInitialValues,M=D.setCallbacks,P=D.setValidateMessages,N=D.setPreserve,R=D.destroyForm;C.useImperativeHandle(t,function(){return E}),C.useEffect(function(){return y.registerForm(n,E),function(){y.unregisterForm(n)}},[y,E,n]),P(te(te({},y.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(J){if(y.triggerFormChange(n,J),p){for(var Q=arguments.length,he=new Array(Q>1?Q-1:0),ge=1;ge{const t=C.useContext(Pq),n=C.useMemo(()=>{var o;const s=e||Tb[i],a=(o=t==null?void 0:t[i])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),r=C.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?Tb.locale:o},[t]);return[n,r]},jk=P9e,A9e="internalMark",O9e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;C.useEffect(()=>(Xie(e&&e.Modal),()=>{Xie()}),[e]);const r=C.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return C.createElement(Pq.Provider,{value:r},t)},F9e=O9e,B9e="5.4.2",HD=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],W9e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},Rve=W9e;function $9e(i){const{sizeUnit:e,sizeStep:t}=i;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 Aq={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"},H9e=Object.assign(Object.assign({},Aq),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, +`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+r+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+r+"$"),l=function(S){return S&&S.exact?o:new RegExp("(?:"+e(S)+t+e(S)+")|(?:"+e(S)+r+e(S)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+r+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",d=l.v4().source,h=l.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",m="(?::\\d{2,5})?",v='(?:[/?#][^\\s"]*)?',_="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+f+g+p+")"+m+v;return fR=new RegExp("(?:^"+_+"$)","i"),fR},$ie={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},PL={integer:function(e){return PL.number(e)&&parseInt(e,10)===e},float:function(e){return PL.number(e)&&!PL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!PL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match($ie.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(j6e())},hex:function(e){return typeof e=="string"&&!!e.match($ie.hex)}},K6e=function(e,t,n,r,o){if(e.required&&t===void 0){bve(e,t,n,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?PL[a](t)||r.push(Yc(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Yc(o.messages.types[a],e.fullField,e.type))},G6e=function(e,t,n,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Yc(o.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?r.push(Yc(o.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&r.push(Yc(o.messages[d].range,e.fullField,e.min,e.max))},JC="enum",q6e=function(e,t,n,r,o){e[JC]=Array.isArray(e[JC])?e[JC]:[],e[JC].indexOf(t)===-1&&r.push(Yc(o.messages[JC],e.fullField,e[JC].join(", ")))},X6e=function(e,t,n,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Yc(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(Yc(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Di={required:bve,whitespace:U6e,type:K6e,range:G6e,enum:q6e,pattern:X6e},Y6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"string")&&!e.required)return n();Di.required(e,t,r,s,o,"string"),As(t,"string")||(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o),Di.pattern(e,t,r,s,o),e.whitespace===!0&&Di.whitespace(e,t,r,s,o))}n(s)},Z6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},Q6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},J6e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},e9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),As(t)||Di.type(e,t,r,s,o)}n(s)},t9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},n9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},i9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();Di.required(e,t,r,s,o,"array"),t!=null&&(Di.type(e,t,r,s,o),Di.range(e,t,r,s,o))}n(s)},r9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di.type(e,t,r,s,o)}n(s)},o9e="enum",s9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o),t!==void 0&&Di[o9e](e,t,r,s,o)}n(s)},a9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"string")&&!e.required)return n();Di.required(e,t,r,s,o),As(t,"string")||Di.pattern(e,t,r,s,o)}n(s)},l9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t,"date")&&!e.required)return n();if(Di.required(e,t,r,s,o),!As(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),Di.type(e,l,r,s,o),l&&Di.range(e,l.getTime(),r,s,o)}}n(s)},c9e=function(e,t,n,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;Di.required(e,t,r,s,o,a),n(s)},v6=function(e,t,n,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(As(t,s)&&!e.required)return n();Di.required(e,t,r,a,o,s),As(t,s)||Di.type(e,t,r,a,o)}n(a)},u9e=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(As(t)&&!e.required)return n();Di.required(e,t,r,s,o)}n(s)},LE={string:Y6e,method:Z6e,number:Q6e,boolean:J6e,regexp:e9e,integer:t9e,float:n9e,array:i9e,object:r9e,enum:s9e,pattern:a9e,date:l9e,url:v6,hex:v6,email:v6,required:c9e,any:u9e};function K$(){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 G$=K$(),zk=function(){function i(t){this.rules=null,this._messages=G$,this.define(t)}var e=i.prototype;return e.define=function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var s=n[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Wie(K$(),n)),this._messages},e.validate=function(n,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=n,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var m=[],v={};function _(S){if(Array.isArray(S)){var L;m=(L=m).concat.apply(L,S)}else m.push(S)}for(var y=0;y3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!Yd(i,e.slice(0,-1))?i:wve(i,e,t,n)}function L4(i){return Array.isArray(i)?h9e(i):Un(i)==="object"&&i!==null?d9e(i):i}function d9e(i){if(Object.getPrototypeOf(i)===Object.prototype){var e={};for(var t in i)e[t]=L4(i[t]);return e}return i}function h9e(i){return i.map(function(e){return L4(e)})}function Xo(i){return V$(i)}function Hie(i,e){var t={};return e.forEach(function(n){var r=Yd(i,n);t=bm(t,n,r)}),t}function EE(i,e){return i&&i.some(function(t){return xve(t,e)})}function Vie(i){return Un(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Sve(i,e){var t=Array.isArray(i)?gt(i):te({},i);return e&&Object.keys(e).forEach(function(n){var r=t[n],o=e[n],s=Vie(r)&&Vie(o);t[n]=s?Sve(r,o||{}):L4(o)}),t}function DE(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=n||t<0||t>=n)return i;var r=i[e],o=e-t;return o>0?[].concat(gt(i.slice(0,t)),[r],gt(i.slice(t,e)),gt(i.slice(e+1,n))):o<0?[].concat(gt(i.slice(0,e)),gt(i.slice(e+1,t+1)),[r],gt(i.slice(t+1,n))):i}var Uie=zk;function p9e(i,e){return i.replace(/\$\{\w+\}/g,function(t){var n=t.slice(2,-1);return e[n]})}var jie="CODE_LOGIC_ERROR";function q$(i,e,t,n,r){return X$.apply(this,arguments)}function X$(){return X$=mC(Nl().mark(function i(e,t,n,r,o){var s,a,l,c,u,d,h,f,g;return Nl().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return s=te({},n),delete s.ruleIndex,Uie.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(v){return console.error(v),Promise.reject(jie)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new Uie(we({},e,[s])),u=DE({},Cve,r.validateMessages),c.messages(u),d=[],m.prev=10,m.next=13,Promise.resolve(c.validate(we({},e,t),te({},r)));case 13:m.next=18;break;case 15:m.prev=15,m.t0=m.catch(10),m.t0.errors&&(d=m.t0.errors.map(function(v,_){var y=v.message,S=y===jie?u.default:y;return C.isValidElement(S)?C.cloneElement(S,{key:"error_".concat(_)}):S}));case 18:if(!(!d.length&&l)){m.next=23;break}return m.next=21,Promise.all(t.map(function(v,_){return q$("".concat(e,".").concat(_),v,l,r,o)}));case 21:return h=m.sent,m.abrupt("return",h.reduce(function(v,_){return[].concat(gt(v),gt(_))},[]));case 23:return f=te(te({},n),{},{name:e,enum:(n.enum||[]).join(", ")},o),g=d.map(function(v){return typeof v=="string"?p9e(v,f):v}),m.abrupt("return",g);case 26:case"end":return m.stop()}},i,null,[[10,15]])})),X$.apply(this,arguments)}function m9e(i,e,t,n,r,o){var s=i.join("."),a=t.map(function(u,d){var h=u.validator,f=te(te({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,p,m){var v=!1,_=function(){for(var L=arguments.length,E=new Array(L),D=0;D0&&arguments[0]!==void 0?arguments[0]:Nu;if(r.validatePromise===d){var L;r.validatePromise=null;var E=[],D=[];(L=S.forEach)===null||L===void 0||L.call(S,function(k){var T=k.rule.warningOnly,M=k.errors,P=M===void 0?Nu:M;T?D.push.apply(D,gt(P)):E.push.apply(E,gt(P))}),r.errors=E,r.warnings=D,r.triggerMetaEvent(),r.reRender()}}),y});return r.validatePromise=d,r.dirty=!0,r.errors=Nu,r.warnings=Nu,r.triggerMetaEvent(),r.reRender(),d},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(z0),u=c.getInitialValue;return u(r.getNamePath())!==void 0},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},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},r.getOnlyChild=function(l){if(typeof l=="function"){var c=r.getMeta();return te(te({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=od(l);return u.length!==1||!C.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}},r.getValue=function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Yd(l||c(!0),u)},r.getControlled=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,m=c.fieldContext,v=d!==void 0?d:m.validateTrigger,_=r.getNamePath(),y=m.getInternalHooks,S=m.getFieldsValue,L=y(z0),E=L.dispatch,D=r.getValue(),k=p||function(N){return we({},g,N)},T=l[u],M=te(te({},l),k(D));M[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var N,R=arguments.length,O=new Array(R),B=0;B=0&&M<=P.length?(u.keys=[].concat(gt(u.keys.slice(0,M)),[u.id],gt(u.keys.slice(M))),y([].concat(gt(P.slice(0,M)),[T],gt(P.slice(M))))):(u.keys=[].concat(gt(u.keys),[u.id]),y([].concat(gt(P),[T]))),u.id+=1},remove:function(T){var M=L(),P=new Set(Array.isArray(T)?T:[T]);P.size<=0||(u.keys=u.keys.filter(function(N,R){return!P.has(R)}),y(M.filter(function(N,R){return!P.has(R)})))},move:function(T,M){if(T!==M){var P=L();T<0||T>=P.length||M<0||M>=P.length||(u.keys=zie(u.keys,T,M),y(zie(P,T,M)))}}},D=_||[];return Array.isArray(D)||(D=[]),r(D.map(function(k,T){var M=u.keys[T];return M===void 0&&(u.keys[T]=u.id,M=u.keys[T],u.id+=1),{name:T,key:M,isListField:!0}}),E,m)})))};function w9e(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(r,o){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&o(n),r(n))})})}):Promise.resolve([])}var Eve="__@field_split__";function _6(i){return i.map(function(e){return"".concat(Un(e),":").concat(e)}).join(Eve)}var e1=function(){function i(){bs(this,i),this.kvs=new Map}return Cs(i,[{key:"set",value:function(t,n){this.kvs.set(_6(t),n)}},{key:"get",value:function(t){return this.kvs.get(_6(t))}},{key:"update",value:function(t,n){var r=this.get(t),o=n(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(_6(t))}},{key:"map",value:function(t){return gt(this.kvs.entries()).map(function(n){var r=$e(n,2),o=r[0],s=r[1],a=o.split(Eve);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=$e(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var r=n.key,o=n.value;return t[r.join(".")]=o,null}),t}}]),i}(),S9e=["name"],x9e=Cs(function i(e){var t=this;bs(this,i),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,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}},this.getInternalHooks=function(n){return n===z0?(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}):(uo(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){t.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,r){if(t.initialValues=n||{},r){var o,s=DE({},n,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=bm(s,l,Yd(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}},this.destroyForm=function(){var n=new e1;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=n},this.getInitialValue=function(n){var r=Yd(t.initialValues,n);return n.length?L4(r):r},this.setCallbacks=function(n){t.callbacks=n},this.setValidateMessages=function(n){t.validateMessages=n},this.setPreserve=function(n){t.preserve=n},this.watchList=[],this.registerWatch=function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(r){return r!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){t.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new e1;return t.getFieldEntities(n).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r},this.getFieldEntitiesForNamePathList=function(n){if(!n)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return n.map(function(o){var s=Xo(o);return r.get(s)||{INVALIDATE_NAME_PATH:Xo(o)}})},this.getFieldsValue=function(n,r){if(t.warningUnhooked(),n===!0&&!r)return t.store;var o=t.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),s=[];return o.forEach(function(a){var l,c="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!n&&(!((l=a.isListField)===null||l===void 0)&&l.call(a))))if(!r)s.push(c);else{var u="getMeta"in a?a.getMeta():null;r(u)&&s.push(c)}}),Hie(t.store,s.map(Xo))},this.getFieldValue=function(n){t.warningUnhooked();var r=Xo(n);return Yd(t.store,r)},this.getFieldsError=function(n){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(n);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:Xo(n[s]),errors:[],warnings:[]}})},this.getFieldError=function(n){t.warningUnhooked();var r=Xo(n),o=t.getFieldsError([r])[0];return o.errors},this.getFieldWarning=function(n){t.warningUnhooked();var r=Xo(n),o=t.getFieldsError([r])[0];return o.warnings},this.isFieldsTouched=function(){t.warningUnhooked();for(var n=arguments.length,r=new Array(n),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},r=new e1,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)uo(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)uo(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h);(!n.skipExist||p===void 0)&&t.updateStore(bm(t.store,h,gt(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,gt(gt(c).map(function(d){return d.entity})))}})):a=o,s(a)},this.resetFields=function(n){t.warningUnhooked();var r=t.store;if(!n){t.updateStore(DE({},t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=n.map(Xo);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(bm(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)},this.setFields=function(n){t.warningUnhooked();var r=t.store,o=[];n.forEach(function(s){var a=s.name,l=Mn(s,S9e),c=Xo(a);o.push(c),"value"in l&&t.updateStore(bm(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)},this.getFields=function(){var n=t.getFieldEntities(!0),r=n.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=te(te({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r},this.initEntityValue=function(n){var r=n.props.initialValue;if(r!==void 0){var o=n.getNamePath(),s=Yd(t.store,o);s===void 0&&t.updateStore(bm(t.store,o,r))}},this.isMergedPreserve=function(n){var r=n!==void 0?n:t.preserve;return r??!0},this.registerField=function(n){t.fieldEntities.push(n);var r=n.getNamePath();if(t.notifyWatch([r]),n.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(o,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!xve(d.getNamePath(),r)})){var u=t.store;t.updateStore(bm(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var r=n.namePath,o=n.value;t.updateValue(r,o);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(n,r,o){if(t.subscribable){var s=te(te({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,r,s)})}else t.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(n,o,{type:"dependenciesUpdate",relatedFields:[r].concat(gt(o))}),o},this.updateValue=function(n,r){var o=Xo(n),s=t.store;t.updateStore(bm(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=Hie(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(gt(a)))},this.setFieldsValue=function(n){t.warningUnhooked();var r=t.store;if(n){var o=DE(t.store,n);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()},this.setFieldValue=function(n,r){t.setFields([{name:n,value:r}])},this.getDependencyChildrenFields=function(n){var r=new Set,o=[],s=new e1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=Xo(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(n),o},this.triggerOnFieldsChange=function(n,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new e1;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return EE(n,u)});o(l,s)}},this.validateFields=function(n,r){t.warningUnhooked();var o=!!n,s=o?n.map(Xo):[],a=[];t.getFieldEntities(!0).forEach(function(u){if(o||s.push(u.getNamePath()),r!=null&&r.recursive&&o){var d=u.getNamePath();d.every(function(g,p){return n[p]===g||n[p]===void 0})&&s.push(d)}if(!(!u.props.rules||!u.props.rules.length)){var h=u.getNamePath();if(!o||EE(s,h)){var f=u.validateRules(te({validateMessages:te(te({},Cve),t.validateMessages)},r));a.push(f.then(function(){return{name:h,errors:[],warnings:[]}}).catch(function(g){var p,m=[],v=[];return(p=g.forEach)===null||p===void 0||p.call(g,function(_){var y=_.rule.warningOnly,S=_.errors;y?v.push.apply(v,gt(S)):m.push.apply(m,gt(S))}),m.length?Promise.reject({name:h,errors:m,warnings:v}):{name:h,errors:m,warnings:v}}))}}});var l=w9e(a);t.lastValidatePromise=l,l.catch(function(u){return u}).then(function(u){var d=u.map(function(h){var f=h.name;return f});t.notifyObservers(t.store,d,{type:"validateFinish"}),t.triggerOnFieldsChange(d,u)});var c=l.then(function(){return t.lastValidatePromise===l?Promise.resolve(t.getFieldsValue(s)):Promise.reject([])}).catch(function(u){var d=u.filter(function(h){return h&&h.errors.length});return Promise.reject({values:t.getFieldsValue(s),errorFields:d,outOfDate:t.lastValidatePromise!==l})});return c.catch(function(u){return u}),t.triggerOnFieldsChange(s),c},this.submit=function(){t.warningUnhooked(),t.validateFields().then(function(n){var r=t.callbacks.onFinish;if(r)try{r(n)}catch(o){console.error(o)}}).catch(function(n){var r=t.callbacks.onFinishFailed;r&&r(n)})},this.forceRootUpdate=e});function Dve(i){var e=C.useRef(),t=C.useState({}),n=$e(t,2),r=n[1];if(!e.current)if(i)e.current=i;else{var o=function(){r({})},s=new x9e(o);e.current=s.getForm()}return[e.current]}var Q$=C.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ive=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,s=C.useContext(Q$),a=C.useRef({});return C.createElement(Q$.Provider,{value:te(te({},s),{},{validateMessages:te(te({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=te(te({},a.current),{},we({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=te({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},L9e=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],E9e=function(e,t){var n=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,m=e.onFinish,v=e.onFinishFailed,_=Mn(e,L9e),y=C.useContext(Q$),S=Dve(s),L=$e(S,1),E=L[0],D=E.getInternalHooks(z0),k=D.useSubscribe,T=D.setInitialValues,M=D.setCallbacks,P=D.setValidateMessages,N=D.setPreserve,R=D.destroyForm;C.useImperativeHandle(t,function(){return E}),C.useEffect(function(){return y.registerForm(n,E),function(){y.unregisterForm(n)}},[y,E,n]),P(te(te({},y.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(J){if(y.triggerFormChange(n,J),p){for(var Q=arguments.length,he=new Array(Q>1?Q-1:0),ge=1;ge{const t=C.useContext(Pq),n=C.useMemo(()=>{var o;const s=e||Nb[i],a=(o=t==null?void 0:t[i])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),r=C.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?Nb.locale:o},[t]);return[n,r]},jk=P9e,A9e="internalMark",O9e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;C.useEffect(()=>(Xie(e&&e.Modal),()=>{Xie()}),[e]);const r=C.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return C.createElement(Pq.Provider,{value:r},t)},F9e=O9e,B9e="5.4.2",HD=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],W9e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},Rve=W9e;function $9e(i){const{sizeUnit:e,sizeStep:t}=i;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 Aq={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"},H9e=Object.assign(Object.assign({},Aq),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",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}),E4=H9e;function Mve(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:r,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=i,d=t(l),h=t(r),f=t(o),g=t(s),p=t(a),m=n(c,u);return Object.assign(Object.assign({},m),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorBgMask:new Jr("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const V9e=i=>{let e=i,t=i,n=i,r=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?r=4:i>=8&&(r=6),{borderRadius:i>16?16:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}},z9e=V9e;function U9e(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:r}=i;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},z9e(n))}const bg=(i,e)=>new Jr(i).setAlpha(e).toRgbString(),zx=(i,e)=>new Jr(i).darken(e).toHexString(),j9e=i=>{const e=kp(i);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]}},K9e=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:bg(n,.88),colorTextSecondary:bg(n,.65),colorTextTertiary:bg(n,.45),colorTextQuaternary:bg(n,.25),colorFill:bg(n,.15),colorFillSecondary:bg(n,.06),colorFillTertiary:bg(n,.04),colorFillQuaternary:bg(n,.02),colorBgLayout:zx(t,4),colorBgContainer:zx(t,0),colorBgElevated:zx(t,0),colorBgSpotlight:bg(n,.85),colorBorder:zx(t,15),colorBorderSecondary:zx(t,6)}};function G9e(i){const e=new Array(10).fill(null).map((t,n)=>{const r=n-1,o=i*Math.pow(2.71828,r/5),s=n>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>{const n=t+8;return{size:t,lineHeight:n/t}})}const q9e=i=>{const e=G9e(i),t=e.map(r=>r.size),n=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:n[1],lineHeightLG:n[2],lineHeightSM:n[0],lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}},Pve=q9e;function D4(i){const e=Object.keys(Aq).map(t=>{const n=kp(i[t]);return new Array(10).fill(1).reduce((r,o,s)=>(r[`${t}-${s+1}`]=n[s],r[`${t}${s+1}`]=n[s],r),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),Mve(i,{generateColorPalettes:j9e,generateNeutralColorPalettes:K9e})),Pve(i.fontSize)),$9e(i)),Rve(i)),U9e(i))}function b6(i){return i>=0&&i<=255}function gR(i,e){const{r:t,g:n,b:r,a:o}=new Jr(i).toRgb();if(o<1)return i;const{r:s,g:a,b:l}=new Jr(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((n-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if(b6(u)&&b6(d)&&b6(h))return new Jr({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Jr({r:t,g:n,b:r,a:1}).toRgbString()}var X9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{delete n[h]});const r=Object.assign(Object.assign({},t),n),o=480,s=576,a=768,l=992,c=1200,u=1600;return Object.assign(Object.assign(Object.assign({},r),{colorLink:r.colorInfoText,colorLinkHover:r.colorInfoHover,colorLinkActive:r.colorInfoActive,colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:gR(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:gR(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:gR(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:gR(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), @@ -222,13 +222,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 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)"}),n)}const Oq="anticon",Z9e=(i,e)=>e||(i?`ant-${i}`:"ant"),Pn=C.createContext({getPrefixCls:Z9e,iconPrefixCls:Oq}),Q9e=i=>({color:i.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:focus, &:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive}}),J9e=(i,e,t,n,r)=>{const o=i/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,f=d,g=2*o-l,p=c,m=2*o-s,v=a,_=o*Math.sqrt(2)+t*(Math.sqrt(2)-2);return{pointerEvents:"none",width:i,height:i,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:i,height:i/2,background:n,clipPath:`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${f} L ${g} ${p} A ${t} ${t} 0 0 0 ${m} ${v} Z')`,content:'""'},"&::after":{content:'""',position:"absolute",width:_,height:_,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},lb={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Vr=i=>({boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:i.fontFamily}),Kk=()=>({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"}}),VD=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),e7e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, - &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),t7e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},Np=i=>({outline:`${i.lineWidthFocus}px solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),zD=i=>({"&:focus-visible":Object.assign({},Np(i))});function yo(i,e,t,n){return r=>{const[o,s,a]=mC(),{getPrefixCls:l,iconPrefixCls:c,csp:u}=C.useContext(Pn),d=l(),h={theme:o,token:s,hashId:a,nonce:()=>u==null?void 0:u.nonce};return H$(Object.assign(Object.assign({},h),{path:["Shared",d]}),()=>[{"&":e7e(s)}]),[H$(Object.assign(Object.assign({},h),{path:[i,r,c]}),()=>{const{token:f,flush:g}=i7e(s),p=typeof t=="function"?t(f):t,m=Object.assign(Object.assign({},p),s[i]),v=`.${r}`,_=Bi(f,{componentCls:v,prefixCls:r,iconCls:`.${c}`,antCls:`.${d}`},m),y=e(_,{hashId:a,prefixCls:r,rootPrefixCls:d,iconPrefixCls:c,overrideComponentToken:s[i]});return g(i,m),[(n==null?void 0:n.resetStyle)===!1?null:t7e(s,r),y]}),a]}}const Ave=typeof CSSINJS_STATISTIC<"u";let J$=!0;function Bi(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(r).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),J$=!0,n}function n7e(){}function i7e(i){let e,t=i,n=n7e;return Ave&&(e=new Set,t=new Proxy(i,{get(r,o){return J$&&e.add(o),r[o]}}),n=(r,o)=>{Array.from(e)}),{token:t,keys:e,flush:n}}function r7e(i,e){return HD.reduce((t,n)=>{const r=i[`${n}1`],o=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:r,lightBorderColor:o,darkColor:s,textColor:a}))},{})}const o7e=_ve(D4),ZP={token:E4,hashed:!0},Ove=qe.createContext(ZP);function mC(){const{token:i,hashed:e,theme:t,components:n}=qe.useContext(Ove),r=`${B9e}-${e||""}`,o=t||o7e,[s,a]=a6e(o,[E4,i],{salt:r,override:Object.assign({override:i},n),formatToken:Y9e});return[o,s,e?a:""]}const s7e=`-ant-${Date.now()}-${Math.random()}`;function a7e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Jr(s),c=kp(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Jr(e.primaryColor),a=kp(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Jr(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(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"),` + `,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)"}),n)}const Oq="anticon",Z9e=(i,e)=>e||(i?`ant-${i}`:"ant"),Pn=C.createContext({getPrefixCls:Z9e,iconPrefixCls:Oq}),Q9e=i=>({color:i.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:focus, &:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive}}),J9e=(i,e,t,n,r)=>{const o=i/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,f=d,g=2*o-l,p=c,m=2*o-s,v=a,_=o*Math.sqrt(2)+t*(Math.sqrt(2)-2);return{pointerEvents:"none",width:i,height:i,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:i,height:i/2,background:n,clipPath:`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${f} L ${g} ${p} A ${t} ${t} 0 0 0 ${m} ${v} Z')`,content:'""'},"&::after":{content:'""',position:"absolute",width:_,height:_,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},cb={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Vr=i=>({boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:i.fontFamily}),Kk=()=>({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"}}),VD=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),e7e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, + &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),t7e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},Np=i=>({outline:`${i.lineWidthFocus}px solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),zD=i=>({"&:focus-visible":Object.assign({},Np(i))});function yo(i,e,t,n){return r=>{const[o,s,a]=vC(),{getPrefixCls:l,iconPrefixCls:c,csp:u}=C.useContext(Pn),d=l(),h={theme:o,token:s,hashId:a,nonce:()=>u==null?void 0:u.nonce};return H$(Object.assign(Object.assign({},h),{path:["Shared",d]}),()=>[{"&":e7e(s)}]),[H$(Object.assign(Object.assign({},h),{path:[i,r,c]}),()=>{const{token:f,flush:g}=i7e(s),p=typeof t=="function"?t(f):t,m=Object.assign(Object.assign({},p),s[i]),v=`.${r}`,_=Bi(f,{componentCls:v,prefixCls:r,iconCls:`.${c}`,antCls:`.${d}`},m),y=e(_,{hashId:a,prefixCls:r,rootPrefixCls:d,iconPrefixCls:c,overrideComponentToken:s[i]});return g(i,m),[(n==null?void 0:n.resetStyle)===!1?null:t7e(s,r),y]}),a]}}const Ave=typeof CSSINJS_STATISTIC<"u";let J$=!0;function Bi(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(r).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),J$=!0,n}function n7e(){}function i7e(i){let e,t=i,n=n7e;return Ave&&(e=new Set,t=new Proxy(i,{get(r,o){return J$&&e.add(o),r[o]}}),n=(r,o)=>{Array.from(e)}),{token:t,keys:e,flush:n}}function r7e(i,e){return HD.reduce((t,n)=>{const r=i[`${n}1`],o=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:r,lightBorderColor:o,darkColor:s,textColor:a}))},{})}const o7e=_ve(D4),ZP={token:E4,hashed:!0},Ove=qe.createContext(ZP);function vC(){const{token:i,hashed:e,theme:t,components:n}=qe.useContext(Ove),r=`${B9e}-${e||""}`,o=t||o7e,[s,a]=a6e(o,[E4,i],{salt:r,override:Object.assign({override:i},n),formatToken:Y9e});return[o,s,e?a:""]}const s7e=`-ant-${Date.now()}-${Math.random()}`;function a7e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Jr(s),c=kp(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Jr(e.primaryColor),a=kp(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Jr(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` :root { ${Object.keys(t).map(s=>`--${i}-${s}: ${t[s]};`).join(` `)} } - `.trim()}function l7e(i,e){const t=a7e(i,e);ea()&&Mw(t,`${s7e}-dynamic-theme`)}const eH=C.createContext(!1),c7e=i=>{let{children:e,disabled:t}=i;const n=C.useContext(eH);return C.createElement(eH.Provider,{value:t??n},e)},D_=eH,tH=C.createContext(void 0),u7e=i=>{let{children:e,size:t}=i;const n=C.useContext(tH);return C.createElement(tH.Provider,{value:t||n},e)},Eh=tH;function d7e(){const i=C.useContext(D_),e=C.useContext(Eh);return{componentDisabled:i,componentSize:e}}function h7e(i,e){const t=i||{},n=t.inherit===!1||!e?ZP:e;return gC(()=>{if(!i)return e;const o=Object.assign({},n.components);return Object.keys(i.components||{}).forEach(s=>{o[s]=Object.assign(Object.assign({},o[s]),i.components[s])}),Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:o})},[t,n],(o,s)=>o.some((a,l)=>{const c=s[l];return!Tp(a,c,!0)}))}const f7e=(i,e)=>{const[t,n]=mC();return H$({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},Kk()),{[`.${i} .${i}-icon`]:{display:"block"}})}])},g7e=f7e;var p7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{prefixCls:e,iconPrefixCls:t,theme:n}=i;e!==void 0&&(QP=e),t!==void 0&&(Fve=t),n&&l7e(wM(),n)},Fq=()=>({getPrefixCls:(i,e)=>e||(i?`${wM()}-${i}`:wM()),getIconPrefixCls:_7e,getRootPrefixCls:()=>QP||wM()}),C7e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,form:r,locale:o,componentSize:s,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,legacyLocale:d,parentContext:h,iconPrefixCls:f,theme:g,componentDisabled:p}=i,m=C.useCallback((R,O)=>{const{prefixCls:B}=i;if(O)return O;const $=B||h.getPrefixCls("");return R?`${$}-${R}`:$},[h.getPrefixCls,i.prefixCls]),v=f||h.iconPrefixCls||Oq,_=v!==h.iconPrefixCls,y=t||h.csp,S=g7e(v,y),L=h7e(g,h.theme),E={csp:y,autoInsertSpaceInButton:n,locale:o||d,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,getPrefixCls:m,iconPrefixCls:v,theme:L},D=Object.assign({},h);Object.keys(E).forEach(R=>{E[R]!==void 0&&(D[R]=E[R])}),m7e.forEach(R=>{const O=i[R];O&&(D[R]=O)});const k=gC(()=>D,D,(R,O)=>{const B=Object.keys(R),$=Object.keys(O);return B.length!==$.length||B.some(G=>R[G]!==O[G])}),T=C.useMemo(()=>({prefixCls:v,csp:y}),[v,y]);let M=_?S(e):e;const P=C.useMemo(()=>{var R,O,B;return DE({},((R=Tb.Form)===null||R===void 0?void 0:R.defaultValidateMessages)||{},((B=(O=k.locale)===null||O===void 0?void 0:O.Form)===null||B===void 0?void 0:B.defaultValidateMessages)||{},(r==null?void 0:r.validateMessages)||{})},[k,r==null?void 0:r.validateMessages]);Object.keys(P).length>0&&(M=C.createElement(Ive,{validateMessages:P},e)),o&&(M=C.createElement(F9e,{locale:o,_ANT_MARK__:A9e},M)),(v||y)&&(M=C.createElement(Sq.Provider,{value:T},M)),s&&(M=C.createElement(u7e,{size:s},M));const N=C.useMemo(()=>{const R=L||{},{algorithm:O,token:B}=R,$=p7e(R,["algorithm","token"]),G=O&&(!Array.isArray(O)||O.length>0)?_ve(O):void 0;return Object.assign(Object.assign({},$),{theme:G,token:Object.assign(Object.assign({},E4),B)})},[L]);return g&&(M=C.createElement(Ove.Provider,{value:N},M)),p!==void 0&&(M=C.createElement(c7e,{disabled:p},M)),C.createElement(Pn.Provider,{value:k},M)},OS=i=>{const e=C.useContext(Pn),t=C.useContext(Pq);return C.createElement(C7e,Object.assign({parentContext:e,legacyLocale:t},i))};OS.ConfigContext=Pn;OS.SizeContext=Eh;OS.config=b7e;OS.useConfig=d7e;Object.defineProperty(OS,"SizeContext",{get:()=>Eh});const I4=OS;var Bve=function(e){return+setTimeout(e,16)},Wve=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(Bve=function(e){return window.requestAnimationFrame(e)},Wve=function(e){return window.cancelAnimationFrame(e)});var Yie=0,Bq=new Map;function $ve(i){Bq.delete(i)}var er=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Yie+=1;var n=Yie;function r(o){if(o===0)$ve(n),e();else{var s=Bve(function(){r(o-1)});Bq.set(n,s)}}return r(t),n};er.cancel=function(i){var e=Bq.get(i);return $ve(e),Wve(e)};function Zg(i,e,t,n){var r=kw.unstable_batchedUpdates?function(s){kw.unstable_batchedUpdates(t,s)}:t;return i.addEventListener&&i.addEventListener(e,r,n),{remove:function(){i.removeEventListener&&i.removeEventListener(e,r,n)}}}var y7e=C.createContext({}),w7e=function(i){Sh(t,i);var e=xh(t);function t(){return bs(this,t),e.apply(this,arguments)}return Cs(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component);function Cv(i){var e=C.useRef(!1),t=C.useState(i),n=$e(t,2),r=n[0],o=n[1];C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}var P1="none",pR="appear",mR="enter",vR="leave",Zie="none",sf="prepare",sy="start",ay="active",Wq="end",Hve="prepared";function Qie(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function S7e(i,e){var t={animationend:Qie("Animation","AnimationEnd"),transitionend:Qie("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var x7e=S7e(ea(),typeof window<"u"?window:{}),Vve={};if(ea()){var L7e=document.createElement("div");Vve=L7e.style}var _R={};function zve(i){if(_R[i])return _R[i];var e=x7e[i];if(e)for(var t=Object.keys(e),n=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:2;e();var o=er(function(){r<=1?n({isCanceled:function(){return o!==i.current}}):t(n,r-1)});i.current=o}return C.useEffect(function(){return function(){e()}},[]),[t,e]};var I7e=[sf,sy,ay,Wq],k7e=[sf,Hve],qve=!1,T7e=!0;function Xve(i){return i===ay||i===Wq}const N7e=function(i,e,t){var n=Cv(Zie),r=$e(n,2),o=r[0],s=r[1],a=D7e(),l=$e(a,2),c=l[0],u=l[1];function d(){s(sf,!0)}var h=e?k7e:I7e;return Gve(function(){if(o!==Zie&&o!==Wq){var f=h.indexOf(o),g=h[f+1],p=t(o);p===qve?s(g,!0):g&&c(function(m){function v(){m.isCanceled()||s(g,!0)}p===!0?v():Promise.resolve(p).then(v)})}},[i,o]),C.useEffect(function(){return function(){u()}},[]),[d,o]};function R7e(i,e,t,n){var r=n.motionEnter,o=r===void 0?!0:r,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,m=n.onEnterStart,v=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,S=n.onLeaveActive,L=n.onAppearEnd,E=n.onEnterEnd,D=n.onLeaveEnd,k=n.onVisibleChanged,T=Cv(),M=$e(T,2),P=M[0],N=M[1],R=Cv(P1),O=$e(R,2),B=O[0],$=O[1],G=Cv(null),U=$e(G,2),j=U[0],ie=U[1],Y=C.useRef(!1),J=C.useRef(null);function Q(){return t()}var he=C.useRef(!1);function ge(){$(P1,!0),ie(null,!0)}function ye(We){var dt=Q();if(!(We&&!We.deadline&&We.target!==dt)){var re=he.current,ue;B===pR&&re?ue=L==null?void 0:L(dt,We):B===mR&&re?ue=E==null?void 0:E(dt,We):B===vR&&re&&(ue=D==null?void 0:D(dt,We)),B!==P1&&re&&ue!==!1&&ge()}}var be=E7e(ye),Ge=$e(be,1),nt=Ge[0],je=C.useMemo(function(){var We,dt,re;switch(B){case pR:return We={},we(We,sf,h),we(We,sy,p),we(We,ay,_),We;case mR:return dt={},we(dt,sf,f),we(dt,sy,m),we(dt,ay,y),dt;case vR:return re={},we(re,sf,g),we(re,sy,v),we(re,ay,S),re;default:return{}}},[B]),_e=N7e(B,!i,function(We){if(We===sf){var dt=je[sf];return dt?dt(Q()):qve}if(Pe in je){var re;ie(((re=je[Pe])===null||re===void 0?void 0:re.call(je,Q(),null))||null)}return Pe===ay&&(nt(Q()),u>0&&(clearTimeout(J.current),J.current=setTimeout(function(){ye({deadline:!0})},u))),Pe===Hve&&ge(),T7e}),Ve=$e(_e,2),Le=Ve[0],Pe=Ve[1],Be=Xve(Pe);he.current=Be,Gve(function(){N(e);var We=Y.current;Y.current=!0;var dt;!We&&e&&a&&(dt=pR),We&&e&&o&&(dt=mR),(We&&!e&&c||!We&&d&&!e&&c)&&(dt=vR),dt&&($(dt),Le())},[e]),C.useEffect(function(){(B===pR&&!a||B===mR&&!o||B===vR&&!c)&&$(P1)},[a,o,c]),C.useEffect(function(){return function(){Y.current=!1,clearTimeout(J.current)}},[]);var Qe=C.useRef(!1);C.useEffect(function(){P&&(Qe.current=!0),P!==void 0&&B===P1&&((Qe.current||P)&&(k==null||k(P)),Qe.current=!0)},[P,B]);var Ye=j;return je[sf]&&Pe===sy&&(Ye=te({transition:"none"},Ye)),[B,Pe,Ye,P??e]}function M7e(i){var e=i;Un(i)==="object"&&(e=i.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var n=C.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,f=r.leavedClassName,g=r.eventProps,p=C.useContext(y7e),m=p.motion,v=t(r,m),_=C.useRef(),y=C.useRef();function S(){try{return _.current instanceof HTMLElement?_.current:FD(y.current)}catch{return null}}var L=R7e(v,a,S,r),E=$e(L,4),D=E[0],k=E[1],T=E[2],M=E[3],P=C.useRef(M);M&&(P.current=!0);var N=C.useCallback(function(j){_.current=j,OD(o,j)},[o]),R,O=te(te({},g),{},{visible:a});if(!d)R=null;else if(D===P1)M?R=d(te({},O),N):!c&&P.current&&f?R=d(te(te({},O),{},{className:f}),N):u||!c&&!f?R=d(te(te({},O),{},{style:{display:"none"}}),N):R=null;else{var B,$;k===sf?$="prepare":Xve(k)?$="active":k===sy&&($="start"),R=d(te(te({},O),{},{className:De(tre(h,D),(B={},we(B,tre(h,"".concat(D,"-").concat($)),$),we(B,h,typeof h=="string"),B)),style:T}),N)}if(C.isValidElement(R)&&E_(R)){var G=R,U=G.ref;U||(R=C.cloneElement(R,{ref:N}))}return C.createElement(w7e,{ref:y},R)});return n.displayName="CSSMotion",n}const hd=M7e(Kve);var nH="add",iH="keep",rH="remove",C6="removed";function P7e(i){var e;return i&&Un(i)==="object"&&"key"in i?e=i:e={key:i},te(te({},e),{},{key:String(e.key)})}function oH(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(P7e)}function A7e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,r=e.length,o=oH(i),s=oH(e);o.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==rH}),t.forEach(function(u){u.key===c&&(u.status=iH)})}),t}var O7e=["component","children","onVisibleChanged","onAllRemoved"],F7e=["status"],B7e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function W7e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hd,t=function(n){Sh(o,n);var r=xh(o);function o(){var s;bs(this,o);for(var a=arguments.length,l=new Array(a),c=0;c((t.startsWith("data-")||t.startsWith("aria-")||t==="role")&&!t.startsWith("data-__")&&(e[t]=i[t]),e),{})}const{isValidElement:uh}=pD;function Yve(i){return i&&uh(i)&&i.type===C.Fragment}function V7e(i,e,t){return uh(i)?C.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function ta(i,e){return V7e(i,i,e)}function rc(i){var e=C.useRef();e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s"u")return 0;const r=e?"scrollTop":"scrollLeft";let o=0;return sH(i)?o=i[e?"pageYOffset":"pageXOffset"]:i instanceof Document?o=i.documentElement[r]:(i instanceof HTMLElement||i)&&(o=i[r]),i&&!sH(i)&&typeof o!="number"&&(o=(n=((t=i.ownerDocument)!==null&&t!==void 0?t:i).documentElement)===null||n===void 0?void 0:n[r]),o}function U7e(i,e,t,n){const r=t-e;return i/=n/2,i<1?r/2*i*i*i+e:r/2*((i-=2)*i*i+2)+e}function j7e(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:t=()=>window,callback:n,duration:r=450}=e,o=t(),s=z7e(o,!0),a=Date.now(),l=()=>{const u=Date.now()-a,d=U7e(u>r?r:u,s,i,r);sH(o)?o.scrollTo(window.pageXOffset,d):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,u=_t.F1&&t<=_t.F12)return!1;switch(t){case _t.ALT:case _t.CAPS_LOCK:case _t.CONTEXT_MENU:case _t.CTRL:case _t.DOWN:case _t.END:case _t.ESC:case _t.HOME:case _t.INSERT:case _t.LEFT:case _t.MAC_FF_META:case _t.META:case _t.NUMLOCK:case _t.NUM_CENTER:case _t.PAGE_DOWN:case _t.PAGE_UP:case _t.PAUSE:case _t.PRINT_SCREEN:case _t.RIGHT:case _t.SHIFT:case _t.UP:case _t.WIN_KEY:case _t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=_t.ZERO&&e<=_t.NINE||e>=_t.NUM_ZERO&&e<=_t.NUM_MULTIPLY||e>=_t.A&&e<=_t.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case _t.SPACE:case _t.QUESTION_MARK:case _t.NUM_PLUS:case _t.NUM_MINUS:case _t.NUM_PERIOD:case _t.NUM_DIVISION:case _t.SEMICOLON:case _t.DASH:case _t.EQUALS:case _t.COMMA:case _t.PERIOD:case _t.SLASH:case _t.APOSTROPHE:case _t.SINGLE_QUOTE:case _t.OPEN_SQUARE_BRACKET:case _t.BACKSLASH:case _t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},K7e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,r=i.className,o=i.duration,s=o===void 0?4.5:o,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,m=C.useState(!1),v=$e(m,2),_=v[0],y=v[1],S=function(){g(a)},L=function(k){(k.key==="Enter"||k.code==="Enter"||k.keyCode===_t.ENTER)&&S()};C.useEffect(function(){if(!_&&s>0){var D=setTimeout(function(){S()},s*1e3);return function(){clearTimeout(D)}}},[s,_,p]);var E="".concat(t,"-notice");return C.createElement("div",It({},h,{ref:e,className:De(E,r,we({},"".concat(E,"-closable"),c)),style:n,onMouseEnter:function(){y(!0)},onMouseLeave:function(){y(!1)},onClick:f}),C.createElement("div",{className:"".concat(E,"-content")},l),c&&C.createElement("a",{tabIndex:0,className:"".concat(E,"-close"),onKeyDown:L,onClick:function(k){k.preventDefault(),k.stopPropagation(),S()}},d))});const Zve=K7e;var G7e=C.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,r=i.container,o=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=C.useState([]),d=$e(u,2),h=d[0],f=d[1],g=function(D){var k,T=h.find(function(M){return M.key===D});T==null||(k=T.onClose)===null||k===void 0||k.call(T),f(function(M){return M.filter(function(P){return P.key!==D})})};C.useImperativeHandle(e,function(){return{open:function(D){f(function(k){var T=gt(k),M=T.findIndex(function(R){return R.key===D.key}),P=te({},D);if(M>=0){var N;P.times=(((N=k[M])===null||N===void 0?void 0:N.times)||0)+1,T[M]=P}else P.times=0,T.push(P);return s>0&&T.length>s&&(T=T.slice(-s)),T})},close:function(D){g(D)},destroy:function(){f([])}}});var p=C.useState({}),m=$e(p,2),v=m[0],_=m[1];C.useEffect(function(){var E={};h.forEach(function(D){var k=D.placement,T=k===void 0?"topRight":k;T&&(E[T]=E[T]||[],E[T].push(D))}),Object.keys(v).forEach(function(D){E[D]=E[D]||[]}),_(E)},[h]);var y=function(D){_(function(k){var T=te({},k),M=T[D]||[];return M.length||delete T[D],T})},S=C.useRef(!1);if(C.useEffect(function(){Object.keys(v).length>0?S.current=!0:S.current&&(c==null||c(),S.current=!1)},[v]),!r)return null;var L=Object.keys(v);return lh.createPortal(C.createElement(C.Fragment,null,L.map(function(E){var D=v[E],k=D.map(function(M){return{config:M,key:M.key}}),T=typeof o=="function"?o(E):o;return C.createElement($7e,It({key:E,className:De(n,"".concat(n,"-").concat(E),a==null?void 0:a(E)),style:l==null?void 0:l(E),keys:k,motionAppear:!0},T,{onAllRemoved:function(){y(E)}}),function(M,P){var N=M.config,R=M.className,O=M.style,B=N.key,$=N.times,G=N.className,U=N.style;return C.createElement(Zve,It({},N,{ref:P,prefixCls:n,className:De(R,G),style:te(te({},O),U),times:$,key:B,eventKey:B,onNoticeClose:g}))})})),r)}),q7e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved"],X7e=function(){return document.body},nre=0;function Y7e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?X7e:e,n=i.motion,r=i.prefixCls,o=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=Mn(i,q7e),u=C.useState(),d=$e(u,2),h=d[0],f=d[1],g=C.useRef(),p=C.createElement(G7e,{container:h,ref:g,prefixCls:r,motion:n,maxCount:o,className:s,style:a,onAllRemoved:l}),m=C.useState([]),v=$e(m,2),_=v[0],y=v[1],S=C.useMemo(function(){return{open:function(E){var D=Y7e(c,E);(D.key===null||D.key===void 0)&&(D.key="rc-notification-".concat(nre),nre+=1),y(function(k){return[].concat(gt(k),[{type:"open",config:D}])})},close:function(E){y(function(D){return[].concat(gt(D),[{type:"close",key:E}])})},destroy:function(){y(function(E){return[].concat(gt(E),[{type:"destroy"}])})}}},[]);return C.useEffect(function(){f(t())}),C.useEffect(function(){g.current&&_.length&&(_.forEach(function(L){switch(L.type){case"open":g.current.open(L.config);break;case"close":g.current.close(L.key);break;case"destroy":g.current.destroy();break}}),y([]))},[_]),[S,p]}const Q7e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:r,colorBgElevated:o,colorSuccess:s,colorError:a,colorWarning:l,colorInfo:c,fontSizeLG:u,motionEaseInOutCirc:d,motionDurationSlow:h,marginXS:f,paddingXS:g,borderRadiusLG:p,zIndexPopup:m,messageNoticeContentPadding:v}=i,_=new vi("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),y=new vi("MessageMoveOut",{"0%":{maxHeight:i.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[e]:Object.assign(Object.assign({},Vr(i)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:m,[`${e}-move-up`]:{animationFillMode:"forwards"},[` + `.trim()}function l7e(i,e){const t=a7e(i,e);ea()&&Mw(t,`${s7e}-dynamic-theme`)}const eH=C.createContext(!1),c7e=i=>{let{children:e,disabled:t}=i;const n=C.useContext(eH);return C.createElement(eH.Provider,{value:t??n},e)},I_=eH,tH=C.createContext(void 0),u7e=i=>{let{children:e,size:t}=i;const n=C.useContext(tH);return C.createElement(tH.Provider,{value:t||n},e)},Eh=tH;function d7e(){const i=C.useContext(I_),e=C.useContext(Eh);return{componentDisabled:i,componentSize:e}}function h7e(i,e){const t=i||{},n=t.inherit===!1||!e?ZP:e;return pC(()=>{if(!i)return e;const o=Object.assign({},n.components);return Object.keys(i.components||{}).forEach(s=>{o[s]=Object.assign(Object.assign({},o[s]),i.components[s])}),Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:o})},[t,n],(o,s)=>o.some((a,l)=>{const c=s[l];return!Tp(a,c,!0)}))}const f7e=(i,e)=>{const[t,n]=vC();return H$({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},Kk()),{[`.${i} .${i}-icon`]:{display:"block"}})}])},g7e=f7e;var p7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{prefixCls:e,iconPrefixCls:t,theme:n}=i;e!==void 0&&(QP=e),t!==void 0&&(Fve=t),n&&l7e(wM(),n)},Fq=()=>({getPrefixCls:(i,e)=>e||(i?`${wM()}-${i}`:wM()),getIconPrefixCls:_7e,getRootPrefixCls:()=>QP||wM()}),C7e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,form:r,locale:o,componentSize:s,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,legacyLocale:d,parentContext:h,iconPrefixCls:f,theme:g,componentDisabled:p}=i,m=C.useCallback((R,O)=>{const{prefixCls:B}=i;if(O)return O;const $=B||h.getPrefixCls("");return R?`${$}-${R}`:$},[h.getPrefixCls,i.prefixCls]),v=f||h.iconPrefixCls||Oq,_=v!==h.iconPrefixCls,y=t||h.csp,S=g7e(v,y),L=h7e(g,h.theme),E={csp:y,autoInsertSpaceInButton:n,locale:o||d,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,getPrefixCls:m,iconPrefixCls:v,theme:L},D=Object.assign({},h);Object.keys(E).forEach(R=>{E[R]!==void 0&&(D[R]=E[R])}),m7e.forEach(R=>{const O=i[R];O&&(D[R]=O)});const k=pC(()=>D,D,(R,O)=>{const B=Object.keys(R),$=Object.keys(O);return B.length!==$.length||B.some(G=>R[G]!==O[G])}),T=C.useMemo(()=>({prefixCls:v,csp:y}),[v,y]);let M=_?S(e):e;const P=C.useMemo(()=>{var R,O,B;return DE({},((R=Nb.Form)===null||R===void 0?void 0:R.defaultValidateMessages)||{},((B=(O=k.locale)===null||O===void 0?void 0:O.Form)===null||B===void 0?void 0:B.defaultValidateMessages)||{},(r==null?void 0:r.validateMessages)||{})},[k,r==null?void 0:r.validateMessages]);Object.keys(P).length>0&&(M=C.createElement(Ive,{validateMessages:P},e)),o&&(M=C.createElement(F9e,{locale:o,_ANT_MARK__:A9e},M)),(v||y)&&(M=C.createElement(Sq.Provider,{value:T},M)),s&&(M=C.createElement(u7e,{size:s},M));const N=C.useMemo(()=>{const R=L||{},{algorithm:O,token:B}=R,$=p7e(R,["algorithm","token"]),G=O&&(!Array.isArray(O)||O.length>0)?_ve(O):void 0;return Object.assign(Object.assign({},$),{theme:G,token:Object.assign(Object.assign({},E4),B)})},[L]);return g&&(M=C.createElement(Ove.Provider,{value:N},M)),p!==void 0&&(M=C.createElement(c7e,{disabled:p},M)),C.createElement(Pn.Provider,{value:k},M)},OS=i=>{const e=C.useContext(Pn),t=C.useContext(Pq);return C.createElement(C7e,Object.assign({parentContext:e,legacyLocale:t},i))};OS.ConfigContext=Pn;OS.SizeContext=Eh;OS.config=b7e;OS.useConfig=d7e;Object.defineProperty(OS,"SizeContext",{get:()=>Eh});const I4=OS;var Bve=function(e){return+setTimeout(e,16)},Wve=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(Bve=function(e){return window.requestAnimationFrame(e)},Wve=function(e){return window.cancelAnimationFrame(e)});var Yie=0,Bq=new Map;function $ve(i){Bq.delete(i)}var tr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Yie+=1;var n=Yie;function r(o){if(o===0)$ve(n),e();else{var s=Bve(function(){r(o-1)});Bq.set(n,s)}}return r(t),n};tr.cancel=function(i){var e=Bq.get(i);return $ve(e),Wve(e)};function Zg(i,e,t,n){var r=kw.unstable_batchedUpdates?function(s){kw.unstable_batchedUpdates(t,s)}:t;return i.addEventListener&&i.addEventListener(e,r,n),{remove:function(){i.removeEventListener&&i.removeEventListener(e,r,n)}}}var y7e=C.createContext({}),w7e=function(i){Sh(t,i);var e=xh(t);function t(){return bs(this,t),e.apply(this,arguments)}return Cs(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component);function Cv(i){var e=C.useRef(!1),t=C.useState(i),n=$e(t,2),r=n[0],o=n[1];C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}var P1="none",pR="appear",mR="enter",vR="leave",Zie="none",sf="prepare",sy="start",ay="active",Wq="end",Hve="prepared";function Qie(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function S7e(i,e){var t={animationend:Qie("Animation","AnimationEnd"),transitionend:Qie("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var x7e=S7e(ea(),typeof window<"u"?window:{}),Vve={};if(ea()){var L7e=document.createElement("div");Vve=L7e.style}var _R={};function zve(i){if(_R[i])return _R[i];var e=x7e[i];if(e)for(var t=Object.keys(e),n=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:2;e();var o=tr(function(){r<=1?n({isCanceled:function(){return o!==i.current}}):t(n,r-1)});i.current=o}return C.useEffect(function(){return function(){e()}},[]),[t,e]};var I7e=[sf,sy,ay,Wq],k7e=[sf,Hve],qve=!1,T7e=!0;function Xve(i){return i===ay||i===Wq}const N7e=function(i,e,t){var n=Cv(Zie),r=$e(n,2),o=r[0],s=r[1],a=D7e(),l=$e(a,2),c=l[0],u=l[1];function d(){s(sf,!0)}var h=e?k7e:I7e;return Gve(function(){if(o!==Zie&&o!==Wq){var f=h.indexOf(o),g=h[f+1],p=t(o);p===qve?s(g,!0):g&&c(function(m){function v(){m.isCanceled()||s(g,!0)}p===!0?v():Promise.resolve(p).then(v)})}},[i,o]),C.useEffect(function(){return function(){u()}},[]),[d,o]};function R7e(i,e,t,n){var r=n.motionEnter,o=r===void 0?!0:r,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,m=n.onEnterStart,v=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,S=n.onLeaveActive,L=n.onAppearEnd,E=n.onEnterEnd,D=n.onLeaveEnd,k=n.onVisibleChanged,T=Cv(),M=$e(T,2),P=M[0],N=M[1],R=Cv(P1),O=$e(R,2),B=O[0],$=O[1],G=Cv(null),U=$e(G,2),j=U[0],ie=U[1],Y=C.useRef(!1),J=C.useRef(null);function Q(){return t()}var he=C.useRef(!1);function ge(){$(P1,!0),ie(null,!0)}function ye(We){var dt=Q();if(!(We&&!We.deadline&&We.target!==dt)){var re=he.current,ue;B===pR&&re?ue=L==null?void 0:L(dt,We):B===mR&&re?ue=E==null?void 0:E(dt,We):B===vR&&re&&(ue=D==null?void 0:D(dt,We)),B!==P1&&re&&ue!==!1&&ge()}}var be=E7e(ye),Ge=$e(be,1),nt=Ge[0],je=C.useMemo(function(){var We,dt,re;switch(B){case pR:return We={},we(We,sf,h),we(We,sy,p),we(We,ay,_),We;case mR:return dt={},we(dt,sf,f),we(dt,sy,m),we(dt,ay,y),dt;case vR:return re={},we(re,sf,g),we(re,sy,v),we(re,ay,S),re;default:return{}}},[B]),_e=N7e(B,!i,function(We){if(We===sf){var dt=je[sf];return dt?dt(Q()):qve}if(Pe in je){var re;ie(((re=je[Pe])===null||re===void 0?void 0:re.call(je,Q(),null))||null)}return Pe===ay&&(nt(Q()),u>0&&(clearTimeout(J.current),J.current=setTimeout(function(){ye({deadline:!0})},u))),Pe===Hve&&ge(),T7e}),Ve=$e(_e,2),Le=Ve[0],Pe=Ve[1],Be=Xve(Pe);he.current=Be,Gve(function(){N(e);var We=Y.current;Y.current=!0;var dt;!We&&e&&a&&(dt=pR),We&&e&&o&&(dt=mR),(We&&!e&&c||!We&&d&&!e&&c)&&(dt=vR),dt&&($(dt),Le())},[e]),C.useEffect(function(){(B===pR&&!a||B===mR&&!o||B===vR&&!c)&&$(P1)},[a,o,c]),C.useEffect(function(){return function(){Y.current=!1,clearTimeout(J.current)}},[]);var Qe=C.useRef(!1);C.useEffect(function(){P&&(Qe.current=!0),P!==void 0&&B===P1&&((Qe.current||P)&&(k==null||k(P)),Qe.current=!0)},[P,B]);var Ye=j;return je[sf]&&Pe===sy&&(Ye=te({transition:"none"},Ye)),[B,Pe,Ye,P??e]}function M7e(i){var e=i;Un(i)==="object"&&(e=i.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var n=C.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,f=r.leavedClassName,g=r.eventProps,p=C.useContext(y7e),m=p.motion,v=t(r,m),_=C.useRef(),y=C.useRef();function S(){try{return _.current instanceof HTMLElement?_.current:FD(y.current)}catch{return null}}var L=R7e(v,a,S,r),E=$e(L,4),D=E[0],k=E[1],T=E[2],M=E[3],P=C.useRef(M);M&&(P.current=!0);var N=C.useCallback(function(j){_.current=j,OD(o,j)},[o]),R,O=te(te({},g),{},{visible:a});if(!d)R=null;else if(D===P1)M?R=d(te({},O),N):!c&&P.current&&f?R=d(te(te({},O),{},{className:f}),N):u||!c&&!f?R=d(te(te({},O),{},{style:{display:"none"}}),N):R=null;else{var B,$;k===sf?$="prepare":Xve(k)?$="active":k===sy&&($="start"),R=d(te(te({},O),{},{className:De(tre(h,D),(B={},we(B,tre(h,"".concat(D,"-").concat($)),$),we(B,h,typeof h=="string"),B)),style:T}),N)}if(C.isValidElement(R)&&D_(R)){var G=R,U=G.ref;U||(R=C.cloneElement(R,{ref:N}))}return C.createElement(w7e,{ref:y},R)});return n.displayName="CSSMotion",n}const hd=M7e(Kve);var nH="add",iH="keep",rH="remove",C6="removed";function P7e(i){var e;return i&&Un(i)==="object"&&"key"in i?e=i:e={key:i},te(te({},e),{},{key:String(e.key)})}function oH(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(P7e)}function A7e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,r=e.length,o=oH(i),s=oH(e);o.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==rH}),t.forEach(function(u){u.key===c&&(u.status=iH)})}),t}var O7e=["component","children","onVisibleChanged","onAllRemoved"],F7e=["status"],B7e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function W7e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hd,t=function(n){Sh(o,n);var r=xh(o);function o(){var s;bs(this,o);for(var a=arguments.length,l=new Array(a),c=0;c((t.startsWith("data-")||t.startsWith("aria-")||t==="role")&&!t.startsWith("data-__")&&(e[t]=i[t]),e),{})}const{isValidElement:uh}=pD;function Yve(i){return i&&uh(i)&&i.type===C.Fragment}function V7e(i,e,t){return uh(i)?C.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function ta(i,e){return V7e(i,i,e)}function rc(i){var e=C.useRef();e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s"u")return 0;const r=e?"scrollTop":"scrollLeft";let o=0;return sH(i)?o=i[e?"pageYOffset":"pageXOffset"]:i instanceof Document?o=i.documentElement[r]:(i instanceof HTMLElement||i)&&(o=i[r]),i&&!sH(i)&&typeof o!="number"&&(o=(n=((t=i.ownerDocument)!==null&&t!==void 0?t:i).documentElement)===null||n===void 0?void 0:n[r]),o}function U7e(i,e,t,n){const r=t-e;return i/=n/2,i<1?r/2*i*i*i+e:r/2*((i-=2)*i*i+2)+e}function j7e(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:t=()=>window,callback:n,duration:r=450}=e,o=t(),s=z7e(o,!0),a=Date.now(),l=()=>{const u=Date.now()-a,d=U7e(u>r?r:u,s,i,r);sH(o)?o.scrollTo(window.pageXOffset,d):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,u=_t.F1&&t<=_t.F12)return!1;switch(t){case _t.ALT:case _t.CAPS_LOCK:case _t.CONTEXT_MENU:case _t.CTRL:case _t.DOWN:case _t.END:case _t.ESC:case _t.HOME:case _t.INSERT:case _t.LEFT:case _t.MAC_FF_META:case _t.META:case _t.NUMLOCK:case _t.NUM_CENTER:case _t.PAGE_DOWN:case _t.PAGE_UP:case _t.PAUSE:case _t.PRINT_SCREEN:case _t.RIGHT:case _t.SHIFT:case _t.UP:case _t.WIN_KEY:case _t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=_t.ZERO&&e<=_t.NINE||e>=_t.NUM_ZERO&&e<=_t.NUM_MULTIPLY||e>=_t.A&&e<=_t.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case _t.SPACE:case _t.QUESTION_MARK:case _t.NUM_PLUS:case _t.NUM_MINUS:case _t.NUM_PERIOD:case _t.NUM_DIVISION:case _t.SEMICOLON:case _t.DASH:case _t.EQUALS:case _t.COMMA:case _t.PERIOD:case _t.SLASH:case _t.APOSTROPHE:case _t.SINGLE_QUOTE:case _t.OPEN_SQUARE_BRACKET:case _t.BACKSLASH:case _t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},K7e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,r=i.className,o=i.duration,s=o===void 0?4.5:o,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,m=C.useState(!1),v=$e(m,2),_=v[0],y=v[1],S=function(){g(a)},L=function(k){(k.key==="Enter"||k.code==="Enter"||k.keyCode===_t.ENTER)&&S()};C.useEffect(function(){if(!_&&s>0){var D=setTimeout(function(){S()},s*1e3);return function(){clearTimeout(D)}}},[s,_,p]);var E="".concat(t,"-notice");return C.createElement("div",It({},h,{ref:e,className:De(E,r,we({},"".concat(E,"-closable"),c)),style:n,onMouseEnter:function(){y(!0)},onMouseLeave:function(){y(!1)},onClick:f}),C.createElement("div",{className:"".concat(E,"-content")},l),c&&C.createElement("a",{tabIndex:0,className:"".concat(E,"-close"),onKeyDown:L,onClick:function(k){k.preventDefault(),k.stopPropagation(),S()}},d))});const Zve=K7e;var G7e=C.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,r=i.container,o=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=C.useState([]),d=$e(u,2),h=d[0],f=d[1],g=function(D){var k,T=h.find(function(M){return M.key===D});T==null||(k=T.onClose)===null||k===void 0||k.call(T),f(function(M){return M.filter(function(P){return P.key!==D})})};C.useImperativeHandle(e,function(){return{open:function(D){f(function(k){var T=gt(k),M=T.findIndex(function(R){return R.key===D.key}),P=te({},D);if(M>=0){var N;P.times=(((N=k[M])===null||N===void 0?void 0:N.times)||0)+1,T[M]=P}else P.times=0,T.push(P);return s>0&&T.length>s&&(T=T.slice(-s)),T})},close:function(D){g(D)},destroy:function(){f([])}}});var p=C.useState({}),m=$e(p,2),v=m[0],_=m[1];C.useEffect(function(){var E={};h.forEach(function(D){var k=D.placement,T=k===void 0?"topRight":k;T&&(E[T]=E[T]||[],E[T].push(D))}),Object.keys(v).forEach(function(D){E[D]=E[D]||[]}),_(E)},[h]);var y=function(D){_(function(k){var T=te({},k),M=T[D]||[];return M.length||delete T[D],T})},S=C.useRef(!1);if(C.useEffect(function(){Object.keys(v).length>0?S.current=!0:S.current&&(c==null||c(),S.current=!1)},[v]),!r)return null;var L=Object.keys(v);return lh.createPortal(C.createElement(C.Fragment,null,L.map(function(E){var D=v[E],k=D.map(function(M){return{config:M,key:M.key}}),T=typeof o=="function"?o(E):o;return C.createElement($7e,It({key:E,className:De(n,"".concat(n,"-").concat(E),a==null?void 0:a(E)),style:l==null?void 0:l(E),keys:k,motionAppear:!0},T,{onAllRemoved:function(){y(E)}}),function(M,P){var N=M.config,R=M.className,O=M.style,B=N.key,$=N.times,G=N.className,U=N.style;return C.createElement(Zve,It({},N,{ref:P,prefixCls:n,className:De(R,G),style:te(te({},O),U),times:$,key:B,eventKey:B,onNoticeClose:g}))})})),r)}),q7e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved"],X7e=function(){return document.body},nre=0;function Y7e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?X7e:e,n=i.motion,r=i.prefixCls,o=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=Mn(i,q7e),u=C.useState(),d=$e(u,2),h=d[0],f=d[1],g=C.useRef(),p=C.createElement(G7e,{container:h,ref:g,prefixCls:r,motion:n,maxCount:o,className:s,style:a,onAllRemoved:l}),m=C.useState([]),v=$e(m,2),_=v[0],y=v[1],S=C.useMemo(function(){return{open:function(E){var D=Y7e(c,E);(D.key===null||D.key===void 0)&&(D.key="rc-notification-".concat(nre),nre+=1),y(function(k){return[].concat(gt(k),[{type:"open",config:D}])})},close:function(E){y(function(D){return[].concat(gt(D),[{type:"close",key:E}])})},destroy:function(){y(function(E){return[].concat(gt(E),[{type:"destroy"}])})}}},[]);return C.useEffect(function(){f(t())}),C.useEffect(function(){g.current&&_.length&&(_.forEach(function(L){switch(L.type){case"open":g.current.open(L.config);break;case"close":g.current.close(L.key);break;case"destroy":g.current.destroy();break}}),y([]))},[_]),[S,p]}const Q7e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:r,colorBgElevated:o,colorSuccess:s,colorError:a,colorWarning:l,colorInfo:c,fontSizeLG:u,motionEaseInOutCirc:d,motionDurationSlow:h,marginXS:f,paddingXS:g,borderRadiusLG:p,zIndexPopup:m,messageNoticeContentPadding:v}=i,_=new vi("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),y=new vi("MessageMoveOut",{"0%":{maxHeight:i.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[e]:Object.assign(Object.assign({},Vr(i)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:m,[`${e}-move-up`]:{animationFillMode:"forwards"},[` ${e}-move-up-appear, ${e}-move-up-enter `]:{animationName:_,animationDuration:h,animationPlayState:"paused",animationTimingFunction:d},[` @@ -236,13 +236,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e}-move-up-enter${e}-move-up-enter-active `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:y,animationDuration:h,animationPlayState:"paused",animationTimingFunction:d},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[`${e}-notice`]:{padding:g,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:f,fontSize:u},[`${e}-notice-content`]:{display:"inline-block",padding:v,background:o,borderRadius:p,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:s},[`${e}-error > ${t}`]:{color:a},[`${e}-warning > ${t}`]:{color:l},[` ${e}-info > ${t}, - ${e}-loading > ${t}`]:{color:c}}},{[`${e}-notice-pure-panel`]:{padding:0,textAlign:"start"}}]},Qve=yo("Message",i=>{const e=Bi(i,{messageNoticeContentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});return[Q7e(e)]},i=>({height:150,zIndexPopup:i.zIndexPopupBase+10}));function J7e(i,e){return{motionName:e??`${i}-move-up`}}function $q(i){let e;const t=new Promise(r=>{e=i(()=>{r(!0)})}),n=()=>{e==null||e()};return n.then=(r,o)=>t.then(r,o),n.promise=t,n}var eWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{top:t,prefixCls:n,getContainer:r,maxCount:o,duration:s=oWe,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d}=C.useContext(Pn),h=n||u("message"),[,f]=Qve(h),g=()=>({left:"50%",transform:"translateX(-50%)",top:t??rWe}),p=()=>De(f,a?`${h}-rtl`:""),m=()=>J7e(h,l),v=C.createElement("span",{className:`${h}-close-x`},C.createElement(Vk,{className:`${h}-close-icon`})),[_,y]=Z7e({prefixCls:h,style:g,className:p,motion:m,closable:!1,closeIcon:v,duration:s,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:o,onAllRemoved:c});return C.useImperativeHandle(e,()=>Object.assign(Object.assign({},_),{prefixCls:h,hashId:f})),y});let ire=0;function e_e(i){const e=C.useRef(null);return[C.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},r=l=>{if(!e.current){const L=()=>{};return L.then=()=>{},L}const{open:c,prefixCls:u,hashId:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:m,className:v,onClose:_}=l,y=iWe(l,["content","icon","type","key","className","onClose"]);let S=m;return S==null&&(ire+=1,S=`antd-message-${ire}`),$q(L=>(c(Object.assign(Object.assign({},y),{key:S,content:C.createElement(Jve,{prefixCls:u,type:p,icon:g},f),placement:"top",className:De(p&&`${h}-${p}`,d,v),onClose:()=>{_==null||_(),L()}})),()=>{n(S)}))},s={open:r,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const m=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return r(m)};s[l]=c}),s},[]),C.createElement(sWe,Object.assign({key:"message-holder"},i,{ref:e}))]}function aWe(i){return e_e(i)}function lWe(){const[i,e]=C.useState([]),t=C.useCallback(n=>(e(r=>[].concat(gt(r),[n])),()=>{e(r=>r.filter(o=>o!==n))}),[]);return[i,t]}var Gk=te({},aOe),cWe=Gk.version,uWe=Gk.render,dWe=Gk.unmountComponentAtNode,k4;try{var hWe=Number((cWe||"").split(".")[0]);hWe>=18&&(k4=Gk.createRoot)}catch{}function rre(i){var e=Gk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Un(e)==="object"&&(e.usingClientEntryPoint=i)}var JP="__rc_react_root__";function fWe(i,e){rre(!0);var t=e[JP]||k4(e);rre(!1),t.render(i),e[JP]=t}function gWe(i,e){uWe(i,e)}function Hq(i,e){if(k4){fWe(i,e);return}gWe(i,e)}function pWe(i){return aH.apply(this,arguments)}function aH(){return aH=pC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var r;(r=e[JP])===null||r===void 0||r.unmount(),delete e[JP]}));case 1:case"end":return n.stop()}},i)})),aH.apply(this,arguments)}function mWe(i){dWe(i)}function t_e(i){return lH.apply(this,arguments)}function lH(){return lH=pC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(k4===void 0){n.next=2;break}return n.abrupt("return",pWe(e));case 2:mWe(e);case 3:case"end":return n.stop()}},i)})),lH.apply(this,arguments)}const qk=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var r=i.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},vWe=i=>{const{componentCls:e,colorPrimary:t}=i;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 ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0}}}}},_We=yo("Wave",i=>[vWe(i)]);function bWe(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function y6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&bWe(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function CWe(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return y6(e)?e:y6(t)?t:y6(n)?n:null}function w6(i){return Number.isNaN(i)?0:i}const yWe=i=>{const{className:e,target:t}=i,n=C.useRef(null),[r,o]=C.useState(null),[s,a]=C.useState([]),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=C.useState(0),[g,p]=C.useState(0),[m,v]=C.useState(!1),_={left:l,top:u,width:h,height:g,borderRadius:s.map(S=>`${S}px`).join(" ")};r&&(_["--wave-color"]=r);function y(){const S=getComputedStyle(t);o(CWe(t));const L=S.position==="static",{borderLeftWidth:E,borderTopWidth:D}=S;c(L?t.offsetLeft:w6(-parseFloat(E))),d(L?t.offsetTop:w6(-parseFloat(D))),f(t.offsetWidth),p(t.offsetHeight);const{borderTopLeftRadius:k,borderTopRightRadius:T,borderBottomLeftRadius:M,borderBottomRightRadius:P}=S;a([k,T,P,M].map(N=>w6(parseFloat(N))))}return C.useEffect(()=>{if(t){const S=er(()=>{y(),v(!0)});let L;return typeof ResizeObserver<"u"&&(L=new ResizeObserver(y),L.observe(t)),()=>{er.cancel(S),L==null||L.disconnect()}}},[]),m?C.createElement(hd,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(S,L)=>{var E;if(L.deadline||L.propertyName==="opacity"){const D=(E=n.current)===null||E===void 0?void 0:E.parentElement;t_e(D).then(()=>{var k;(k=D.parentElement)===null||k===void 0||k.removeChild(D)})}return!1}},S=>{let{className:L}=S;return C.createElement("div",{ref:n,className:De(e,L),style:_})}):null};function wWe(i,e){const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",i==null||i.insertBefore(t,i==null?void 0:i.firstChild),Hq(C.createElement(yWe,{target:i,className:e}),t)}function SWe(i,e){function t(){const n=i.current;wWe(n,e)}return t}const xWe=i=>{const{children:e,disabled:t}=i,{getPrefixCls:n}=C.useContext(Pn),r=C.useRef(null),o=n("wave"),[,s]=_We(o),a=SWe(r,De(o,s));if(qe.useEffect(()=>{const c=r.current;if(!c||c.nodeType!==1||t)return;const u=d=>{d.target.tagName==="INPUT"||!qk(d.target)||!c.getAttribute||c.getAttribute("disabled")||c.disabled||c.className.includes("disabled")||c.className.includes("-leave")||a()};return c.addEventListener("click",u,!0),()=>{c.removeEventListener("click",u,!0)}},[t]),!qe.isValidElement(e))return e??null;const l=E_(e)?pu(e.ref,r):r;return ta(e,{ref:l})},LWe=xWe,EWe=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},DWe=EWe,IWe=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"}}}},n_e=yo("Space",i=>[IWe(i),DWe(i)],()=>({}),{resetStyle:!1});var i_e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(T4),n=C.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return De({[`${i}-compact${a}item`]:!0,[`${i}-compact${a}first-item`]:o,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},Fw=i=>{let{children:e}=i;return C.createElement(T4.Provider,{value:null},e)},kWe=i=>{var{children:e}=i,t=i_e(i,["children"]);return C.createElement(T4.Provider,{value:t},e)},TWe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{size:n="middle",direction:r,block:o,prefixCls:s,className:a,rootClassName:l,children:c}=i,u=i_e(i,["size","direction","block","prefixCls","className","rootClassName","children"]),d=e("space-compact",s),[h,f]=n_e(d),g=De(d,f,{[`${d}-rtl`]:t==="rtl",[`${d}-block`]:o,[`${d}-vertical`]:r==="vertical"},a,l),p=C.useContext(T4),m=od(c),v=C.useMemo(()=>m.map((_,y)=>{const S=_&&_.key||`${d}-item-${y}`;return C.createElement(kWe,{key:S,compactSize:n,compactDirection:r,isFirstItem:y===0&&(!p||(p==null?void 0:p.isFirstItem)),isLastItem:y===m.length-1&&(!p||(p==null?void 0:p.isLastItem))},_)}),[n,m,p]);return m.length===0?null:h(C.createElement("div",Object.assign({className:g},u),v))},NWe=TWe,S6=()=>({width:0,opacity:0,transform:"scale(0)"}),x6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),RWe=i=>{let{prefixCls:e,loading:t,existIcon:n}=i;const r=!!t;return n?qe.createElement("span",{className:`${e}-loading-icon`},qe.createElement(AD,null)):qe.createElement(hd,{visible:r,motionName:`${e}-loading-icon-motion`,removeOnLeave:!0,onAppearStart:S6,onAppearActive:x6,onEnterStart:S6,onEnterActive:x6,onLeaveStart:x6,onLeaveActive:S6},(o,s)=>{let{className:a,style:l}=o;return qe.createElement("span",{className:`${e}-loading-icon`,style:l,ref:s},qe.createElement(AD,{className:a}))})},MWe=RWe;var PWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,size:r,className:o}=i,s=PWe(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=mC();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=De(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return C.createElement(r_e.Provider,{value:r},C.createElement("div",Object.assign({},s,{className:u})))},OWe=AWe,ore=/^[\u4e00-\u9fa5]{2}$/,cH=ore.test.bind(ore);function FWe(i){return typeof i=="string"}function L6(i){return i==="text"||i==="link"}function BWe(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&FWe(i.type)&&cH(i.props.children)?ta(i,{children:i.props.children.split("").join(t)}):typeof i=="string"?cH(i)?qe.createElement("span",null,i.split("").join(t)):qe.createElement("span",null,i):Yve(i)?qe.createElement("span",null,i):i}function WWe(i,e){let t=!1;const n=[];return qe.Children.forEach(i,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${r}`}else n.push(r);t=s}),qe.Children.map(n,r=>BWe(r,e))}const sre=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),$We=i=>{const{componentCls:e,fontSize:t,lineWidth:n,colorPrimaryHover:r,colorErrorHover:o}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-n,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, + ${e}-loading > ${t}`]:{color:c}}},{[`${e}-notice-pure-panel`]:{padding:0,textAlign:"start"}}]},Qve=yo("Message",i=>{const e=Bi(i,{messageNoticeContentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});return[Q7e(e)]},i=>({height:150,zIndexPopup:i.zIndexPopupBase+10}));function J7e(i,e){return{motionName:e??`${i}-move-up`}}function $q(i){let e;const t=new Promise(r=>{e=i(()=>{r(!0)})}),n=()=>{e==null||e()};return n.then=(r,o)=>t.then(r,o),n.promise=t,n}var eWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{top:t,prefixCls:n,getContainer:r,maxCount:o,duration:s=oWe,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d}=C.useContext(Pn),h=n||u("message"),[,f]=Qve(h),g=()=>({left:"50%",transform:"translateX(-50%)",top:t??rWe}),p=()=>De(f,a?`${h}-rtl`:""),m=()=>J7e(h,l),v=C.createElement("span",{className:`${h}-close-x`},C.createElement(Vk,{className:`${h}-close-icon`})),[_,y]=Z7e({prefixCls:h,style:g,className:p,motion:m,closable:!1,closeIcon:v,duration:s,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:o,onAllRemoved:c});return C.useImperativeHandle(e,()=>Object.assign(Object.assign({},_),{prefixCls:h,hashId:f})),y});let ire=0;function e_e(i){const e=C.useRef(null);return[C.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},r=l=>{if(!e.current){const L=()=>{};return L.then=()=>{},L}const{open:c,prefixCls:u,hashId:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:m,className:v,onClose:_}=l,y=iWe(l,["content","icon","type","key","className","onClose"]);let S=m;return S==null&&(ire+=1,S=`antd-message-${ire}`),$q(L=>(c(Object.assign(Object.assign({},y),{key:S,content:C.createElement(Jve,{prefixCls:u,type:p,icon:g},f),placement:"top",className:De(p&&`${h}-${p}`,d,v),onClose:()=>{_==null||_(),L()}})),()=>{n(S)}))},s={open:r,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const m=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return r(m)};s[l]=c}),s},[]),C.createElement(sWe,Object.assign({key:"message-holder"},i,{ref:e}))]}function aWe(i){return e_e(i)}function lWe(){const[i,e]=C.useState([]),t=C.useCallback(n=>(e(r=>[].concat(gt(r),[n])),()=>{e(r=>r.filter(o=>o!==n))}),[]);return[i,t]}var Gk=te({},aOe),cWe=Gk.version,uWe=Gk.render,dWe=Gk.unmountComponentAtNode,k4;try{var hWe=Number((cWe||"").split(".")[0]);hWe>=18&&(k4=Gk.createRoot)}catch{}function rre(i){var e=Gk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Un(e)==="object"&&(e.usingClientEntryPoint=i)}var JP="__rc_react_root__";function fWe(i,e){rre(!0);var t=e[JP]||k4(e);rre(!1),t.render(i),e[JP]=t}function gWe(i,e){uWe(i,e)}function Hq(i,e){if(k4){fWe(i,e);return}gWe(i,e)}function pWe(i){return aH.apply(this,arguments)}function aH(){return aH=mC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var r;(r=e[JP])===null||r===void 0||r.unmount(),delete e[JP]}));case 1:case"end":return n.stop()}},i)})),aH.apply(this,arguments)}function mWe(i){dWe(i)}function t_e(i){return lH.apply(this,arguments)}function lH(){return lH=mC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(k4===void 0){n.next=2;break}return n.abrupt("return",pWe(e));case 2:mWe(e);case 3:case"end":return n.stop()}},i)})),lH.apply(this,arguments)}const qk=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var r=i.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},vWe=i=>{const{componentCls:e,colorPrimary:t}=i;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 ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0}}}}},_We=yo("Wave",i=>[vWe(i)]);function bWe(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function y6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&bWe(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function CWe(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return y6(e)?e:y6(t)?t:y6(n)?n:null}function w6(i){return Number.isNaN(i)?0:i}const yWe=i=>{const{className:e,target:t}=i,n=C.useRef(null),[r,o]=C.useState(null),[s,a]=C.useState([]),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=C.useState(0),[g,p]=C.useState(0),[m,v]=C.useState(!1),_={left:l,top:u,width:h,height:g,borderRadius:s.map(S=>`${S}px`).join(" ")};r&&(_["--wave-color"]=r);function y(){const S=getComputedStyle(t);o(CWe(t));const L=S.position==="static",{borderLeftWidth:E,borderTopWidth:D}=S;c(L?t.offsetLeft:w6(-parseFloat(E))),d(L?t.offsetTop:w6(-parseFloat(D))),f(t.offsetWidth),p(t.offsetHeight);const{borderTopLeftRadius:k,borderTopRightRadius:T,borderBottomLeftRadius:M,borderBottomRightRadius:P}=S;a([k,T,P,M].map(N=>w6(parseFloat(N))))}return C.useEffect(()=>{if(t){const S=tr(()=>{y(),v(!0)});let L;return typeof ResizeObserver<"u"&&(L=new ResizeObserver(y),L.observe(t)),()=>{tr.cancel(S),L==null||L.disconnect()}}},[]),m?C.createElement(hd,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(S,L)=>{var E;if(L.deadline||L.propertyName==="opacity"){const D=(E=n.current)===null||E===void 0?void 0:E.parentElement;t_e(D).then(()=>{var k;(k=D.parentElement)===null||k===void 0||k.removeChild(D)})}return!1}},S=>{let{className:L}=S;return C.createElement("div",{ref:n,className:De(e,L),style:_})}):null};function wWe(i,e){const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",i==null||i.insertBefore(t,i==null?void 0:i.firstChild),Hq(C.createElement(yWe,{target:i,className:e}),t)}function SWe(i,e){function t(){const n=i.current;wWe(n,e)}return t}const xWe=i=>{const{children:e,disabled:t}=i,{getPrefixCls:n}=C.useContext(Pn),r=C.useRef(null),o=n("wave"),[,s]=_We(o),a=SWe(r,De(o,s));if(qe.useEffect(()=>{const c=r.current;if(!c||c.nodeType!==1||t)return;const u=d=>{d.target.tagName==="INPUT"||!qk(d.target)||!c.getAttribute||c.getAttribute("disabled")||c.disabled||c.className.includes("disabled")||c.className.includes("-leave")||a()};return c.addEventListener("click",u,!0),()=>{c.removeEventListener("click",u,!0)}},[t]),!qe.isValidElement(e))return e??null;const l=D_(e)?pu(e.ref,r):r;return ta(e,{ref:l})},LWe=xWe,EWe=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},DWe=EWe,IWe=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"}}}},n_e=yo("Space",i=>[IWe(i),DWe(i)],()=>({}),{resetStyle:!1});var i_e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(T4),n=C.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return De({[`${i}-compact${a}item`]:!0,[`${i}-compact${a}first-item`]:o,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},Fw=i=>{let{children:e}=i;return C.createElement(T4.Provider,{value:null},e)},kWe=i=>{var{children:e}=i,t=i_e(i,["children"]);return C.createElement(T4.Provider,{value:t},e)},TWe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{size:n="middle",direction:r,block:o,prefixCls:s,className:a,rootClassName:l,children:c}=i,u=i_e(i,["size","direction","block","prefixCls","className","rootClassName","children"]),d=e("space-compact",s),[h,f]=n_e(d),g=De(d,f,{[`${d}-rtl`]:t==="rtl",[`${d}-block`]:o,[`${d}-vertical`]:r==="vertical"},a,l),p=C.useContext(T4),m=od(c),v=C.useMemo(()=>m.map((_,y)=>{const S=_&&_.key||`${d}-item-${y}`;return C.createElement(kWe,{key:S,compactSize:n,compactDirection:r,isFirstItem:y===0&&(!p||(p==null?void 0:p.isFirstItem)),isLastItem:y===m.length-1&&(!p||(p==null?void 0:p.isLastItem))},_)}),[n,m,p]);return m.length===0?null:h(C.createElement("div",Object.assign({className:g},u),v))},NWe=TWe,S6=()=>({width:0,opacity:0,transform:"scale(0)"}),x6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),RWe=i=>{let{prefixCls:e,loading:t,existIcon:n}=i;const r=!!t;return n?qe.createElement("span",{className:`${e}-loading-icon`},qe.createElement(AD,null)):qe.createElement(hd,{visible:r,motionName:`${e}-loading-icon-motion`,removeOnLeave:!0,onAppearStart:S6,onAppearActive:x6,onEnterStart:S6,onEnterActive:x6,onLeaveStart:x6,onLeaveActive:S6},(o,s)=>{let{className:a,style:l}=o;return qe.createElement("span",{className:`${e}-loading-icon`,style:l,ref:s},qe.createElement(AD,{className:a}))})},MWe=RWe;var PWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,size:r,className:o}=i,s=PWe(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=vC();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=De(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return C.createElement(r_e.Provider,{value:r},C.createElement("div",Object.assign({},s,{className:u})))},OWe=AWe,ore=/^[\u4e00-\u9fa5]{2}$/,cH=ore.test.bind(ore);function FWe(i){return typeof i=="string"}function L6(i){return i==="text"||i==="link"}function BWe(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&FWe(i.type)&&cH(i.props.children)?ta(i,{children:i.props.children.split("").join(t)}):typeof i=="string"?cH(i)?qe.createElement("span",null,i.split("").join(t)):qe.createElement("span",null,i):Yve(i)?qe.createElement("span",null,i):i}function WWe(i,e){let t=!1;const n=[];return qe.Children.forEach(i,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${r}`}else n.push(r);t=s}),qe.Children.map(n,r=>BWe(r,e))}const sre=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),$We=i=>{const{componentCls:e,fontSize:t,lineWidth:n,colorPrimaryHover:r,colorErrorHover:o}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-n,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, &:focus, - &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},sre(`${e}-primary`,r),sre(`${e}-danger`,o)]}},HWe=$We;function VWe(i,e,t){const{focusElCls:n,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-i.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function zWe(i,e,t){const{borderElCls:n}=t,r=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function N4(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},VWe(i,n,e)),zWe(t,n,e))}}function UWe(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-i.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function jWe(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function KWe(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},UWe(i,e)),jWe(i.componentCls,e))}}const GWe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:400,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:i.lineHeight,color:i.colorText,"> span":{display:"inline-block"},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},zD(i)),[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:i.lineWidth,height:`calc(100% + ${i.lineWidth*2}px)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:`calc(100% + ${i.lineWidth*2}px)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}},Rp=(i,e)=>({"&:not(:disabled)":{"&:hover":i,"&:active":e}}),qWe=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),XWe=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.controlHeight/2,paddingInlineEnd:i.controlHeight/2}),uH=i=>({cursor:"not-allowed",borderColor:i.colorBorder,color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,boxShadow:"none"}),eA=(i,e,t,n,r,o,s)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:e||void 0,backgroundColor:"transparent",borderColor:t||void 0,boxShadow:"none"},Rp(Object.assign({backgroundColor:"transparent"},o),Object.assign({backgroundColor:"transparent"},s))),{"&:disabled":{cursor:"not-allowed",color:n||void 0,borderColor:r||void 0}})}),Vq=i=>({"&:disabled":Object.assign({},uH(i))}),o_e=i=>Object.assign({},Vq(i)),tA=i=>({"&:disabled":{cursor:"not-allowed",color:i.colorTextDisabled}}),s_e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o_e(i)),{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`}),Rp({color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),eA(i.componentCls,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},Rp({color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),eA(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),Vq(i))}),YWe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o_e(i)),{color:i.colorTextLightSolid,backgroundColor:i.colorPrimary,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`}),Rp({color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryHover},{color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryActive})),eA(i.componentCls,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:i.colorError,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`},Rp({backgroundColor:i.colorErrorHover},{backgroundColor:i.colorErrorActive})),eA(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),Vq(i))}),ZWe=i=>Object.assign(Object.assign({},s_e(i)),{borderStyle:"dashed"}),QWe=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},Rp({color:i.colorLinkHover},{color:i.colorLinkActive})),tA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},Rp({color:i.colorErrorHover},{color:i.colorErrorActive})),tA(i))}),JWe=i=>Object.assign(Object.assign(Object.assign({},Rp({color:i.colorText,backgroundColor:i.colorBgTextHover},{color:i.colorText,backgroundColor:i.colorBgTextActive})),tA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},tA(i)),Rp({color:i.colorErrorHover,backgroundColor:i.colorErrorBg},{color:i.colorErrorHover,backgroundColor:i.colorErrorBg}))}),e$e=i=>Object.assign(Object.assign({},uH(i)),{[`&${i.componentCls}:hover`]:Object.assign({},uH(i))}),t$e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:s_e(i),[`${e}-primary`]:YWe(i),[`${e}-dashed`]:ZWe(i),[`${e}-link`]:QWe(i),[`${e}-text`]:JWe(i),[`${e}-disabled`]:e$e(i)}},zq=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,iconCls:n,controlHeight:r,fontSize:o,lineHeight:s,lineWidth:a,borderRadius:l,buttonPaddingHorizontal:c}=i,u=Math.max(0,(r-o*s)/2-a),d=c-a,h=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,height:r,padding:`${u}px ${d}px`,borderRadius:l,[`&${h}`]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},"> span":{transform:"scale(1.143)"}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`&:not(${h}) ${t}-loading-icon > ${n}`]:{marginInlineEnd:i.marginXS}}},{[`${t}${t}-circle${e}`]:qWe(i)},{[`${t}${t}-round${e}`]:XWe(i)}]},n$e=i=>zq(i),i$e=i=>{const e=Bi(i,{controlHeight:i.controlHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:8,borderRadius:i.borderRadiusSM});return zq(e,`${i.componentCls}-sm`)},r$e=i=>{const e=Bi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG});return zq(e,`${i.componentCls}-lg`)},o$e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},s$e=yo("Button",i=>{const{controlTmpOutline:e,paddingContentHorizontal:t}=i,n=Bi(i,{colorOutlineDefault:e,buttonPaddingHorizontal:t});return[GWe(n),i$e(n),n$e(n),r$e(n),o$e(n),t$e(n),HWe(n),N4(i),KWe(i)]});var a$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{loading:t=!1,prefixCls:n,type:r="default",danger:o,shape:s="default",size:a,disabled:l,className:c,rootClassName:u,children:d,icon:h,ghost:f=!1,block:g=!1,htmlType:p="button"}=i,m=a$e(i,["loading","prefixCls","type","danger","shape","size","disabled","className","rootClassName","children","icon","ghost","block","htmlType"]),{getPrefixCls:v,autoInsertSpaceInButton:_,direction:y}=C.useContext(Pn),S=v("btn",n),[L,E]=s$e(S),D=C.useContext(Eh),k=C.useContext(D_),T=l??k,M=C.useContext(r_e),P=C.useMemo(()=>l$e(t),[t]),[N,R]=C.useState(P.loading),[O,B]=C.useState(!1),$=e||C.createRef(),G=()=>C.Children.count(d)===1&&!h&&!L6(r),U=()=>{if(!$||!$.current||_===!1)return;const Le=$.current.textContent;G()&&cH(Le)?O||B(!0):O&&B(!1)};C.useEffect(()=>{let Le=null;P.delay>0?Le=window.setTimeout(()=>{Le=null,R(!0)},P.delay):R(P.loading);function Pe(){Le&&(window.clearTimeout(Le),Le=null)}return Pe},[P]),C.useEffect(U,[$]);const j=Le=>{const{onClick:Pe}=i;if(N||T){Le.preventDefault();return}Pe==null||Pe(Le)},ie=_!==!1,{compactSize:Y,compactItemClassnames:J}=FS(S,y),Q={large:"lg",small:"sm",middle:void 0},he=Y||M||a||D,ge=he&&Q[he]||"",ye=N?"loading":h,be=cl(m,["navigate"]),Ge=be.href!==void 0&&T,nt=De(S,E,{[`${S}-${s}`]:s!=="default"&&s,[`${S}-${r}`]:r,[`${S}-${ge}`]:ge,[`${S}-icon-only`]:!d&&d!==0&&!!ye,[`${S}-background-ghost`]:f&&!L6(r),[`${S}-loading`]:N,[`${S}-two-chinese-chars`]:O&&ie&&!N,[`${S}-block`]:g,[`${S}-dangerous`]:!!o,[`${S}-rtl`]:y==="rtl",[`${S}-disabled`]:Ge},J,c,u),je=h&&!N?h:C.createElement(MWe,{existIcon:!!h,prefixCls:S,loading:!!N}),_e=d||d===0?WWe(d,G()&&ie):null;if(be.href!==void 0)return L(C.createElement("a",Object.assign({},be,{className:nt,onClick:j,ref:$}),je,_e));let Ve=C.createElement("button",Object.assign({},m,{type:p,className:nt,onClick:j,disabled:T,ref:$}),je,_e);return L6(r)||(Ve=C.createElement(LWe,{disabled:!!N},Ve)),L(Ve)},Uq=C.forwardRef(c$e);Uq.Group=OWe;Uq.__ANT_BUTTON=!0;const ed=Uq;function are(i){return!!(i&&i.then)}const u$e=i=>{const{type:e,children:t,prefixCls:n,buttonProps:r,close:o,autoFocus:s,emitEvent:a,quitOnNullishReturnValue:l,actionFn:c}=i,u=C.useRef(!1),d=C.useRef(null),[h,f]=Cv(!1),g=function(){o==null||o.apply(void 0,arguments)};C.useEffect(()=>{let v=null;return s&&(v=setTimeout(()=>{var _;(_=d.current)===null||_===void 0||_.focus()})),()=>{v&&clearTimeout(v)}},[]);const p=v=>{are(v)&&(f(!0),v.then(function(){f(!1,!0),g.apply(void 0,arguments),u.current=!1},_=>(f(!1,!0),u.current=!1,Promise.reject(_))))},m=v=>{if(u.current)return;if(u.current=!0,!c){g();return}let _;if(a){if(_=c(v),l&&!are(_)){u.current=!1,g(v);return}}else if(c.length)_=c(o),u.current=!1;else if(_=c(),!_){g();return}p(_)};return C.createElement(ed,Object.assign({},a_e(e),{onClick:m,loading:h,prefixCls:n},r,{ref:d}),t)},lre=u$e,E6=()=>({height:0,opacity:0}),cre=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},d$e=i=>({height:i?i.offsetHeight:0}),D6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",l_e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:E6,onEnterStart:E6,onAppearActive:cre,onEnterActive:cre,onLeaveStart:d$e,onLeaveActive:E6,onAppearEnd:D6,onEnterEnd:D6,onLeaveEnd:D6,motionDeadline:500}},h$e=i=>i!==void 0&&(i==="topLeft"||i==="topRight")?"slide-down":"slide-up",Nb=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var c_e=C.createContext(null),Cr=ea()?C.useLayoutEffect:C.useEffect,IE=function(e,t){var n=C.useRef(!0);Cr(function(){if(!n.current)return e()},t),Cr(function(){return n.current=!1,function(){n.current=!0}},[])},ure=[];function f$e(i,e){var t=C.useState(function(){if(!ea())return null;var g=document.createElement("div");return g}),n=$e(t,1),r=n[0],o=C.useRef(!1),s=C.useContext(c_e),a=C.useState(ure),l=$e(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(p){var m=[g].concat(gt(p));return m})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return Cr(function(){return i?s?s(h):h():f(),f},[i]),Cr(function(){c.length&&(c.forEach(function(g){return g()}),u(ure))},[c]),[r,d]}var I6;function nA(i){if(typeof document>"u")return 0;if(i||I6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),I6=r-o}return I6}function dre(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?nA():t}function hre(i){if(typeof document>"u"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:dre(t),height:dre(n)}}function g$e(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var p$e="rc-util-locker-".concat(Date.now()),fre=0;function m$e(i){var e=!!i,t=C.useState(function(){return fre+=1,"".concat(p$e,"_").concat(fre)}),n=$e(t,1),r=n[0];Cr(function(){if(e){var o=nA(),s=g$e();Mw(` + &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},sre(`${e}-primary`,r),sre(`${e}-danger`,o)]}},HWe=$We;function VWe(i,e,t){const{focusElCls:n,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-i.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function zWe(i,e,t){const{borderElCls:n}=t,r=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function N4(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},VWe(i,n,e)),zWe(t,n,e))}}function UWe(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-i.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function jWe(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function KWe(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},UWe(i,e)),jWe(i.componentCls,e))}}const GWe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:400,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:i.lineHeight,color:i.colorText,"> span":{display:"inline-block"},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},zD(i)),[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:i.lineWidth,height:`calc(100% + ${i.lineWidth*2}px)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:`calc(100% + ${i.lineWidth*2}px)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}},Rp=(i,e)=>({"&:not(:disabled)":{"&:hover":i,"&:active":e}}),qWe=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),XWe=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.controlHeight/2,paddingInlineEnd:i.controlHeight/2}),uH=i=>({cursor:"not-allowed",borderColor:i.colorBorder,color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,boxShadow:"none"}),eA=(i,e,t,n,r,o,s)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:e||void 0,backgroundColor:"transparent",borderColor:t||void 0,boxShadow:"none"},Rp(Object.assign({backgroundColor:"transparent"},o),Object.assign({backgroundColor:"transparent"},s))),{"&:disabled":{cursor:"not-allowed",color:n||void 0,borderColor:r||void 0}})}),Vq=i=>({"&:disabled":Object.assign({},uH(i))}),o_e=i=>Object.assign({},Vq(i)),tA=i=>({"&:disabled":{cursor:"not-allowed",color:i.colorTextDisabled}}),s_e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o_e(i)),{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`}),Rp({color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),eA(i.componentCls,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},Rp({color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),eA(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),Vq(i))}),YWe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o_e(i)),{color:i.colorTextLightSolid,backgroundColor:i.colorPrimary,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`}),Rp({color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryHover},{color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryActive})),eA(i.componentCls,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:i.colorError,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`},Rp({backgroundColor:i.colorErrorHover},{backgroundColor:i.colorErrorActive})),eA(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),Vq(i))}),ZWe=i=>Object.assign(Object.assign({},s_e(i)),{borderStyle:"dashed"}),QWe=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},Rp({color:i.colorLinkHover},{color:i.colorLinkActive})),tA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},Rp({color:i.colorErrorHover},{color:i.colorErrorActive})),tA(i))}),JWe=i=>Object.assign(Object.assign(Object.assign({},Rp({color:i.colorText,backgroundColor:i.colorBgTextHover},{color:i.colorText,backgroundColor:i.colorBgTextActive})),tA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},tA(i)),Rp({color:i.colorErrorHover,backgroundColor:i.colorErrorBg},{color:i.colorErrorHover,backgroundColor:i.colorErrorBg}))}),e$e=i=>Object.assign(Object.assign({},uH(i)),{[`&${i.componentCls}:hover`]:Object.assign({},uH(i))}),t$e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:s_e(i),[`${e}-primary`]:YWe(i),[`${e}-dashed`]:ZWe(i),[`${e}-link`]:QWe(i),[`${e}-text`]:JWe(i),[`${e}-disabled`]:e$e(i)}},zq=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,iconCls:n,controlHeight:r,fontSize:o,lineHeight:s,lineWidth:a,borderRadius:l,buttonPaddingHorizontal:c}=i,u=Math.max(0,(r-o*s)/2-a),d=c-a,h=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,height:r,padding:`${u}px ${d}px`,borderRadius:l,[`&${h}`]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},"> span":{transform:"scale(1.143)"}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`&:not(${h}) ${t}-loading-icon > ${n}`]:{marginInlineEnd:i.marginXS}}},{[`${t}${t}-circle${e}`]:qWe(i)},{[`${t}${t}-round${e}`]:XWe(i)}]},n$e=i=>zq(i),i$e=i=>{const e=Bi(i,{controlHeight:i.controlHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:8,borderRadius:i.borderRadiusSM});return zq(e,`${i.componentCls}-sm`)},r$e=i=>{const e=Bi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG});return zq(e,`${i.componentCls}-lg`)},o$e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},s$e=yo("Button",i=>{const{controlTmpOutline:e,paddingContentHorizontal:t}=i,n=Bi(i,{colorOutlineDefault:e,buttonPaddingHorizontal:t});return[GWe(n),i$e(n),n$e(n),r$e(n),o$e(n),t$e(n),HWe(n),N4(i),KWe(i)]});var a$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{loading:t=!1,prefixCls:n,type:r="default",danger:o,shape:s="default",size:a,disabled:l,className:c,rootClassName:u,children:d,icon:h,ghost:f=!1,block:g=!1,htmlType:p="button"}=i,m=a$e(i,["loading","prefixCls","type","danger","shape","size","disabled","className","rootClassName","children","icon","ghost","block","htmlType"]),{getPrefixCls:v,autoInsertSpaceInButton:_,direction:y}=C.useContext(Pn),S=v("btn",n),[L,E]=s$e(S),D=C.useContext(Eh),k=C.useContext(I_),T=l??k,M=C.useContext(r_e),P=C.useMemo(()=>l$e(t),[t]),[N,R]=C.useState(P.loading),[O,B]=C.useState(!1),$=e||C.createRef(),G=()=>C.Children.count(d)===1&&!h&&!L6(r),U=()=>{if(!$||!$.current||_===!1)return;const Le=$.current.textContent;G()&&cH(Le)?O||B(!0):O&&B(!1)};C.useEffect(()=>{let Le=null;P.delay>0?Le=window.setTimeout(()=>{Le=null,R(!0)},P.delay):R(P.loading);function Pe(){Le&&(window.clearTimeout(Le),Le=null)}return Pe},[P]),C.useEffect(U,[$]);const j=Le=>{const{onClick:Pe}=i;if(N||T){Le.preventDefault();return}Pe==null||Pe(Le)},ie=_!==!1,{compactSize:Y,compactItemClassnames:J}=FS(S,y),Q={large:"lg",small:"sm",middle:void 0},he=Y||M||a||D,ge=he&&Q[he]||"",ye=N?"loading":h,be=cl(m,["navigate"]),Ge=be.href!==void 0&&T,nt=De(S,E,{[`${S}-${s}`]:s!=="default"&&s,[`${S}-${r}`]:r,[`${S}-${ge}`]:ge,[`${S}-icon-only`]:!d&&d!==0&&!!ye,[`${S}-background-ghost`]:f&&!L6(r),[`${S}-loading`]:N,[`${S}-two-chinese-chars`]:O&&ie&&!N,[`${S}-block`]:g,[`${S}-dangerous`]:!!o,[`${S}-rtl`]:y==="rtl",[`${S}-disabled`]:Ge},J,c,u),je=h&&!N?h:C.createElement(MWe,{existIcon:!!h,prefixCls:S,loading:!!N}),_e=d||d===0?WWe(d,G()&&ie):null;if(be.href!==void 0)return L(C.createElement("a",Object.assign({},be,{className:nt,onClick:j,ref:$}),je,_e));let Ve=C.createElement("button",Object.assign({},m,{type:p,className:nt,onClick:j,disabled:T,ref:$}),je,_e);return L6(r)||(Ve=C.createElement(LWe,{disabled:!!N},Ve)),L(Ve)},Uq=C.forwardRef(c$e);Uq.Group=OWe;Uq.__ANT_BUTTON=!0;const ed=Uq;function are(i){return!!(i&&i.then)}const u$e=i=>{const{type:e,children:t,prefixCls:n,buttonProps:r,close:o,autoFocus:s,emitEvent:a,quitOnNullishReturnValue:l,actionFn:c}=i,u=C.useRef(!1),d=C.useRef(null),[h,f]=Cv(!1),g=function(){o==null||o.apply(void 0,arguments)};C.useEffect(()=>{let v=null;return s&&(v=setTimeout(()=>{var _;(_=d.current)===null||_===void 0||_.focus()})),()=>{v&&clearTimeout(v)}},[]);const p=v=>{are(v)&&(f(!0),v.then(function(){f(!1,!0),g.apply(void 0,arguments),u.current=!1},_=>(f(!1,!0),u.current=!1,Promise.reject(_))))},m=v=>{if(u.current)return;if(u.current=!0,!c){g();return}let _;if(a){if(_=c(v),l&&!are(_)){u.current=!1,g(v);return}}else if(c.length)_=c(o),u.current=!1;else if(_=c(),!_){g();return}p(_)};return C.createElement(ed,Object.assign({},a_e(e),{onClick:m,loading:h,prefixCls:n},r,{ref:d}),t)},lre=u$e,E6=()=>({height:0,opacity:0}),cre=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},d$e=i=>({height:i?i.offsetHeight:0}),D6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",l_e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:E6,onEnterStart:E6,onAppearActive:cre,onEnterActive:cre,onLeaveStart:d$e,onLeaveActive:E6,onAppearEnd:D6,onEnterEnd:D6,onLeaveEnd:D6,motionDeadline:500}},h$e=i=>i!==void 0&&(i==="topLeft"||i==="topRight")?"slide-down":"slide-up",Rb=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var c_e=C.createContext(null),Cr=ea()?C.useLayoutEffect:C.useEffect,IE=function(e,t){var n=C.useRef(!0);Cr(function(){if(!n.current)return e()},t),Cr(function(){return n.current=!1,function(){n.current=!0}},[])},ure=[];function f$e(i,e){var t=C.useState(function(){if(!ea())return null;var g=document.createElement("div");return g}),n=$e(t,1),r=n[0],o=C.useRef(!1),s=C.useContext(c_e),a=C.useState(ure),l=$e(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(p){var m=[g].concat(gt(p));return m})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return Cr(function(){return i?s?s(h):h():f(),f},[i]),Cr(function(){c.length&&(c.forEach(function(g){return g()}),u(ure))},[c]),[r,d]}var I6;function nA(i){if(typeof document>"u")return 0;if(i||I6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),I6=r-o}return I6}function dre(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?nA():t}function hre(i){if(typeof document>"u"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:dre(t),height:dre(n)}}function g$e(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var p$e="rc-util-locker-".concat(Date.now()),fre=0;function m$e(i){var e=!!i,t=C.useState(function(){return fre+=1,"".concat(p$e,"_").concat(fre)}),n=$e(t,1),r=n[0];Cr(function(){if(e){var o=nA(),s=g$e();Mw(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` -}`),r)}else UP(r);return function(){UP(r)}},[e,r])}var gre=!1;function v$e(i){return typeof i=="boolean"&&(gre=i),gre}var pre=function(e){return e===!1?!1:!ea()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},jq=C.forwardRef(function(i,e){var t=i.open,n=i.autoLock,r=i.getContainer;i.debug;var o=i.autoDestroy,s=o===void 0?!0:o,a=i.children,l=C.useState(t),c=$e(l,2),u=c[0],d=c[1],h=u||t;C.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=C.useState(function(){return pre(r)}),g=$e(f,2),p=g[0],m=g[1];C.useEffect(function(){var P=pre(r);m(P??null)});var v=f$e(h&&!p),_=$e(v,2),y=_[0],S=_[1],L=p??y;m$e(n&&t&&ea()&&(L===y||L===document.body));var E=null;if(a&&E_(a)&&e){var D=a;E=D.ref}var k=y4(E,e);if(!h||!ea()||p===void 0)return null;var T=L===!1||v$e(),M=a;return e&&(M=C.cloneElement(a,{ref:k})),C.createElement(c_e.Provider,{value:S},T?M:lh.createPortal(M,L))});function _$e(){var i=te({},pD);return i.useId}var mre=0;function u_e(i){var e=C.useState("ssr-id"),t=$e(e,2),n=t[0],r=t[1],o=_$e(),s=o==null?void 0:o();return C.useEffect(function(){if(!o){var a=mre;mre+=1,r("rc_unique_".concat(a))}},[]),i||s||n}var b$e=`accept acceptCharset accessKey action allowFullScreen allowTransparency +}`),r)}else UP(r);return function(){UP(r)}},[e,r])}var gre=!1;function v$e(i){return typeof i=="boolean"&&(gre=i),gre}var pre=function(e){return e===!1?!1:!ea()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},jq=C.forwardRef(function(i,e){var t=i.open,n=i.autoLock,r=i.getContainer;i.debug;var o=i.autoDestroy,s=o===void 0?!0:o,a=i.children,l=C.useState(t),c=$e(l,2),u=c[0],d=c[1],h=u||t;C.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=C.useState(function(){return pre(r)}),g=$e(f,2),p=g[0],m=g[1];C.useEffect(function(){var P=pre(r);m(P??null)});var v=f$e(h&&!p),_=$e(v,2),y=_[0],S=_[1],L=p??y;m$e(n&&t&&ea()&&(L===y||L===document.body));var E=null;if(a&&D_(a)&&e){var D=a;E=D.ref}var k=y4(E,e);if(!h||!ea()||p===void 0)return null;var T=L===!1||v$e(),M=a;return e&&(M=C.cloneElement(a,{ref:k})),C.createElement(c_e.Provider,{value:S},T?M:lh.createPortal(M,L))});function _$e(){var i=te({},pD);return i.useId}var mre=0;function u_e(i){var e=C.useState("ssr-id"),t=$e(e,2),n=t[0],r=t[1],o=_$e(),s=o==null?void 0:o();return C.useEffect(function(){if(!o){var a=mre;mre+=1,r("rc_unique_".concat(a))}},[]),i||s||n}var b$e=`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 @@ -259,7 +259,7 @@ html body { 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`,y$e="".concat(b$e," ").concat(C$e).split(/[\s\n]+/),w$e="aria-",S$e="data-";function vre(i,e){return i.indexOf(e)===0}function Mp(i){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=te({},e);var n={};return Object.keys(i).forEach(function(r){(t.aria&&(r==="role"||vre(r,w$e))||t.data&&vre(r,S$e)||t.attr&&y$e.includes(r))&&(n[r]=i[r])}),n}function _re(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function bre(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var r=i.document;t=r.documentElement[n],typeof t!="number"&&(t=r.body[n])}return t}function x$e(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=bre(r),t.top+=bre(r,!0),t}const L$e=C.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t});var Cre={width:0,height:0,overflow:"hidden",outline:"none"},d_e=qe.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,r=i.style,o=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,u=i.onClose,d=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,m=i.onMouseUp,v=i.holderRef,_=i.visible,y=i.forceRender,S=i.width,L=i.height,E=C.useRef(),D=C.useRef();qe.useImperativeHandle(e,function(){return{focus:function(){var O;(O=E.current)===null||O===void 0||O.focus()},changeActive:function(O){var B=document,$=B.activeElement;O&&$===D.current?E.current.focus():!O&&$===E.current&&D.current.focus()}}});var k={};S!==void 0&&(k.width=S),L!==void 0&&(k.height=L);var T;a&&(T=qe.createElement("div",{className:"".concat(t,"-footer")},a));var M;o&&(M=qe.createElement("div",{className:"".concat(t,"-header")},qe.createElement("div",{className:"".concat(t,"-title"),id:s},o)));var P;l&&(P=qe.createElement("button",{type:"button",onClick:u,"aria-label":"Close",className:"".concat(t,"-close")},c||qe.createElement("span",{className:"".concat(t,"-close-x")})));var N=qe.createElement("div",{className:"".concat(t,"-content")},P,M,qe.createElement("div",It({className:"".concat(t,"-body"),style:h},f),d),T);return qe.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:v,style:te(te({},r),k),className:De(t,n),onMouseDown:p,onMouseUp:m},qe.createElement("div",{tabIndex:0,ref:E,style:Cre,"aria-hidden":"true"}),qe.createElement(L$e,{shouldUpdate:_||y},g?g(N):N),qe.createElement("div",{tabIndex:0,ref:D,style:Cre,"aria-hidden":"true"}))}),h_e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,r=i.style,o=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,u=i.ariaId,d=i.onVisibleChanged,h=i.mousePosition,f=C.useRef(),g=C.useState(),p=$e(g,2),m=p[0],v=p[1],_={};m&&(_.transformOrigin=m);function y(){var S=x$e(f.current);v(h?"".concat(h.x-S.left,"px ").concat(h.y-S.top,"px"):"")}return C.createElement(hd,{visible:s,onVisibleChanged:d,onAppearPrepare:y,onEnterPrepare:y,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(S,L){var E=S.className,D=S.style;return C.createElement(d_e,It({},i,{ref:e,title:n,ariaId:u,prefixCls:t,holderRef:L,style:te(te(te({},D),r),_),className:De(o,E)}))})});h_e.displayName="Content";function E$e(i){var e=i.prefixCls,t=i.style,n=i.visible,r=i.maskProps,o=i.motionName;return C.createElement(hd,{key:"mask",visible:n,motionName:o,leavedClassName:"".concat(e,"-mask-hidden")},function(s,a){var l=s.className,c=s.style;return C.createElement("div",It({ref:a,style:te(te({},c),t),className:De("".concat(e,"-mask"),l)},r))})}function D$e(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,r=i.visible,o=r===void 0?!1:r,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,u=i.wrapStyle,d=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,m=i.transitionName,v=i.animation,_=i.closable,y=_===void 0?!0:_,S=i.mask,L=S===void 0?!0:S,E=i.maskTransitionName,D=i.maskAnimation,k=i.maskClosable,T=k===void 0?!0:k,M=i.maskStyle,P=i.maskProps,N=i.rootClassName,R=C.useRef(),O=C.useRef(),B=C.useRef(),$=C.useState(o),G=$e($,2),U=G[0],j=G[1],ie=u_e();function Y(){sb(O.current,document.activeElement)||(R.current=document.activeElement)}function J(){if(!sb(O.current,document.activeElement)){var _e;(_e=B.current)===null||_e===void 0||_e.focus()}}function Q(_e){if(_e)J();else{if(j(!1),L&&R.current&&c){try{R.current.focus({preventScroll:!0})}catch{}R.current=null}U&&(p==null||p())}g==null||g(_e)}function he(_e){f==null||f(_e)}var ge=C.useRef(!1),ye=C.useRef(),be=function(){clearTimeout(ye.current),ge.current=!0},Ge=function(){ye.current=setTimeout(function(){ge.current=!1})},nt=null;T&&(nt=function(Ve){ge.current?ge.current=!1:O.current===Ve.target&&he(Ve)});function je(_e){if(a&&_e.keyCode===_t.ESC){_e.stopPropagation(),he(_e);return}o&&_e.keyCode===_t.TAB&&B.current.changeActive(!_e.shiftKey)}return C.useEffect(function(){o&&(j(!0),Y())},[o]),C.useEffect(function(){return function(){clearTimeout(ye.current)}},[]),C.createElement("div",It({className:De("".concat(t,"-root"),N)},Mp(i,{data:!0})),C.createElement(E$e,{prefixCls:t,visible:L&&o,motionName:_re(t,E,D),style:te({zIndex:n},M),maskProps:P}),C.createElement("div",It({tabIndex:-1,onKeyDown:je,className:De("".concat(t,"-wrap"),d),ref:O,onClick:nt,style:te(te({zIndex:n},u),{},{display:U?null:"none"})},h),C.createElement(h_e,It({},i,{onMouseDown:be,onMouseUp:Ge,ref:B,closable:y,ariaId:ie,prefixCls:t,visible:o&&U,onClose:he,onVisibleChanged:Q,motionName:_re(t,m,v)}))))}var f_e=function(e){var t=e.visible,n=e.getContainer,r=e.forceRender,o=e.destroyOnClose,s=o===void 0?!1:o,a=e.afterClose,l=C.useState(t),c=$e(l,2),u=c[0],d=c[1];return C.useEffect(function(){t&&d(!0)},[t]),!r&&s&&!u?null:C.createElement(jq,{open:t||r||u,autoDestroy:!1,getContainer:n,autoLock:t||u},C.createElement(D$e,It({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),d(!1)}})))};f_e.displayName="Dialog";const Vf=C.createContext({}),UD=i=>{let{children:e,status:t,override:n}=i;const r=C.useContext(Vf),o=C.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return C.createElement(Vf.Provider,{value:o},e)};var g_e=function(e){if(ea()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(r){return r in n.style})}return!1},I$e=function(e,t){if(!g_e(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function k$e(i,e){return!Array.isArray(i)&&e!==void 0?I$e(i,e):g_e(i)}const p_e=()=>ea()&&window.document.documentElement;let bR;const T$e=()=>{if(!p_e())return!1;if(bR!==void 0)return bR;const i=document.createElement("div");return i.style.display="flex",i.style.flexDirection="column",i.style.rowGap="1px",i.appendChild(document.createElement("div")),i.appendChild(document.createElement("div")),document.body.appendChild(i),bR=i.scrollHeight===1,document.body.removeChild(i),bR},N$e=i=>({animationDuration:i,animationFillMode:"both"}),R$e=i=>({animationDuration:i,animationFillMode:"both"}),R4=function(i,e,t,n){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,y$e="".concat(b$e," ").concat(C$e).split(/[\s\n]+/),w$e="aria-",S$e="data-";function vre(i,e){return i.indexOf(e)===0}function Mp(i){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=te({},e);var n={};return Object.keys(i).forEach(function(r){(t.aria&&(r==="role"||vre(r,w$e))||t.data&&vre(r,S$e)||t.attr&&y$e.includes(r))&&(n[r]=i[r])}),n}function _re(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function bre(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var r=i.document;t=r.documentElement[n],typeof t!="number"&&(t=r.body[n])}return t}function x$e(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=bre(r),t.top+=bre(r,!0),t}const L$e=C.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t});var Cre={width:0,height:0,overflow:"hidden",outline:"none"},d_e=qe.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,r=i.style,o=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,u=i.onClose,d=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,m=i.onMouseUp,v=i.holderRef,_=i.visible,y=i.forceRender,S=i.width,L=i.height,E=C.useRef(),D=C.useRef();qe.useImperativeHandle(e,function(){return{focus:function(){var O;(O=E.current)===null||O===void 0||O.focus()},changeActive:function(O){var B=document,$=B.activeElement;O&&$===D.current?E.current.focus():!O&&$===E.current&&D.current.focus()}}});var k={};S!==void 0&&(k.width=S),L!==void 0&&(k.height=L);var T;a&&(T=qe.createElement("div",{className:"".concat(t,"-footer")},a));var M;o&&(M=qe.createElement("div",{className:"".concat(t,"-header")},qe.createElement("div",{className:"".concat(t,"-title"),id:s},o)));var P;l&&(P=qe.createElement("button",{type:"button",onClick:u,"aria-label":"Close",className:"".concat(t,"-close")},c||qe.createElement("span",{className:"".concat(t,"-close-x")})));var N=qe.createElement("div",{className:"".concat(t,"-content")},P,M,qe.createElement("div",It({className:"".concat(t,"-body"),style:h},f),d),T);return qe.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:v,style:te(te({},r),k),className:De(t,n),onMouseDown:p,onMouseUp:m},qe.createElement("div",{tabIndex:0,ref:E,style:Cre,"aria-hidden":"true"}),qe.createElement(L$e,{shouldUpdate:_||y},g?g(N):N),qe.createElement("div",{tabIndex:0,ref:D,style:Cre,"aria-hidden":"true"}))}),h_e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,r=i.style,o=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,u=i.ariaId,d=i.onVisibleChanged,h=i.mousePosition,f=C.useRef(),g=C.useState(),p=$e(g,2),m=p[0],v=p[1],_={};m&&(_.transformOrigin=m);function y(){var S=x$e(f.current);v(h?"".concat(h.x-S.left,"px ").concat(h.y-S.top,"px"):"")}return C.createElement(hd,{visible:s,onVisibleChanged:d,onAppearPrepare:y,onEnterPrepare:y,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(S,L){var E=S.className,D=S.style;return C.createElement(d_e,It({},i,{ref:e,title:n,ariaId:u,prefixCls:t,holderRef:L,style:te(te(te({},D),r),_),className:De(o,E)}))})});h_e.displayName="Content";function E$e(i){var e=i.prefixCls,t=i.style,n=i.visible,r=i.maskProps,o=i.motionName;return C.createElement(hd,{key:"mask",visible:n,motionName:o,leavedClassName:"".concat(e,"-mask-hidden")},function(s,a){var l=s.className,c=s.style;return C.createElement("div",It({ref:a,style:te(te({},c),t),className:De("".concat(e,"-mask"),l)},r))})}function D$e(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,r=i.visible,o=r===void 0?!1:r,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,u=i.wrapStyle,d=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,m=i.transitionName,v=i.animation,_=i.closable,y=_===void 0?!0:_,S=i.mask,L=S===void 0?!0:S,E=i.maskTransitionName,D=i.maskAnimation,k=i.maskClosable,T=k===void 0?!0:k,M=i.maskStyle,P=i.maskProps,N=i.rootClassName,R=C.useRef(),O=C.useRef(),B=C.useRef(),$=C.useState(o),G=$e($,2),U=G[0],j=G[1],ie=u_e();function Y(){ab(O.current,document.activeElement)||(R.current=document.activeElement)}function J(){if(!ab(O.current,document.activeElement)){var _e;(_e=B.current)===null||_e===void 0||_e.focus()}}function Q(_e){if(_e)J();else{if(j(!1),L&&R.current&&c){try{R.current.focus({preventScroll:!0})}catch{}R.current=null}U&&(p==null||p())}g==null||g(_e)}function he(_e){f==null||f(_e)}var ge=C.useRef(!1),ye=C.useRef(),be=function(){clearTimeout(ye.current),ge.current=!0},Ge=function(){ye.current=setTimeout(function(){ge.current=!1})},nt=null;T&&(nt=function(Ve){ge.current?ge.current=!1:O.current===Ve.target&&he(Ve)});function je(_e){if(a&&_e.keyCode===_t.ESC){_e.stopPropagation(),he(_e);return}o&&_e.keyCode===_t.TAB&&B.current.changeActive(!_e.shiftKey)}return C.useEffect(function(){o&&(j(!0),Y())},[o]),C.useEffect(function(){return function(){clearTimeout(ye.current)}},[]),C.createElement("div",It({className:De("".concat(t,"-root"),N)},Mp(i,{data:!0})),C.createElement(E$e,{prefixCls:t,visible:L&&o,motionName:_re(t,E,D),style:te({zIndex:n},M),maskProps:P}),C.createElement("div",It({tabIndex:-1,onKeyDown:je,className:De("".concat(t,"-wrap"),d),ref:O,onClick:nt,style:te(te({zIndex:n},u),{},{display:U?null:"none"})},h),C.createElement(h_e,It({},i,{onMouseDown:be,onMouseUp:Ge,ref:B,closable:y,ariaId:ie,prefixCls:t,visible:o&&U,onClose:he,onVisibleChanged:Q,motionName:_re(t,m,v)}))))}var f_e=function(e){var t=e.visible,n=e.getContainer,r=e.forceRender,o=e.destroyOnClose,s=o===void 0?!1:o,a=e.afterClose,l=C.useState(t),c=$e(l,2),u=c[0],d=c[1];return C.useEffect(function(){t&&d(!0)},[t]),!r&&s&&!u?null:C.createElement(jq,{open:t||r||u,autoDestroy:!1,getContainer:n,autoLock:t||u},C.createElement(D$e,It({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),d(!1)}})))};f_e.displayName="Dialog";const Vf=C.createContext({}),UD=i=>{let{children:e,status:t,override:n}=i;const r=C.useContext(Vf),o=C.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return C.createElement(Vf.Provider,{value:o},e)};var g_e=function(e){if(ea()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(r){return r in n.style})}return!1},I$e=function(e,t){if(!g_e(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function k$e(i,e){return!Array.isArray(i)&&e!==void 0?I$e(i,e):g_e(i)}const p_e=()=>ea()&&window.document.documentElement;let bR;const T$e=()=>{if(!p_e())return!1;if(bR!==void 0)return bR;const i=document.createElement("div");return i.style.display="flex",i.style.flexDirection="column",i.style.rowGap="1px",i.appendChild(document.createElement("div")),i.appendChild(document.createElement("div")),document.body.appendChild(i),bR=i.scrollHeight===1,document.body.removeChild(i),bR},N$e=i=>({animationDuration:i,animationFillMode:"both"}),R$e=i=>({animationDuration:i,animationFillMode:"both"}),R4=function(i,e,t,n){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${o}${i}-enter, ${o}${i}-appear `]:Object.assign(Object.assign({},N$e(n)),{animationPlayState:"paused"}),[`${o}${i}-leave`]:Object.assign(Object.assign({},R$e(n)),{animationPlayState:"paused"}),[` @@ -282,15 +282,15 @@ html body { opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}}),m_e=aHe;function Sre(i){return{position:i,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const lHe=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},Sre("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},Sre("fixed")),{overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${e}-root`]:A$e(i)}]},cHe=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap`]:{zIndex:i.zIndexPopupBase,position:"fixed",inset:0,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax})`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${i.marginXS} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Vr(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${i.margin*2}px)`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.modalHeadingColor,fontWeight:i.fontWeightStrong,fontSize:i.modalHeaderTitleFontSize,lineHeight:i.modalHeaderTitleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.modalContentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:`${i.paddingMD}px ${i.paddingContentHorizontalLG}px`},[`${e}-close`]:Object.assign({position:"absolute",top:(i.modalHeaderCloseSize-i.modalCloseBtnSize)/2,insetInlineEnd:(i.modalHeaderCloseSize-i.modalCloseBtnSize)/2,zIndex:i.zIndexPopupBase+10,padding:0,color:i.modalCloseColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalConfirmIconSize,height:i.modalConfirmIconSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"block",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${i.modalCloseBtnSize}px`,textAlign:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.wireframe?"transparent":i.colorFillContent,textDecoration:"none"},"&:active":{backgroundColor:i.wireframe?"transparent":i.colorFillContentHover}},zD(i)),[`${e}-header`]:{color:i.colorText,background:i.modalHeaderBg,borderRadius:`${i.borderRadiusLG}px ${i.borderRadiusLG}px 0 0`,marginBottom:i.marginXS},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word"},[`${e}-footer`]:{textAlign:"end",background:i.modalFooterBg,marginTop:i.marginSM,[`${i.antCls}-btn + ${i.antCls}-btn:not(${i.antCls}-dropdown-trigger)`]:{marginBottom:0,marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, ${e}-body, ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},uHe=i=>{const{componentCls:e}=i,t=`${e}-confirm`;return{[t]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${t}-body-wrapper`]:Object.assign({},VD()),[`${t}-body`]:{display:"flex",flexWrap:"wrap",alignItems:"center",[`${t}-title`]:{flex:"0 0 100%",display:"block",overflow:"hidden",color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:i.modalHeaderTitleFontSize,lineHeight:i.modalHeaderTitleLineHeight,[`+ ${t}-content`]:{marginBlockStart:i.marginXS,flexBasis:"100%",maxWidth:`calc(100% - ${i.modalConfirmIconSize+i.marginSM}px)`}},[`${t}-content`]:{color:i.colorText,fontSize:i.fontSize},[`> ${i.iconCls}`]:{flex:"none",marginInlineEnd:i.marginSM,fontSize:i.modalConfirmIconSize,[`+ ${t}-title`]:{flex:1},[`+ ${t}-title + ${t}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.marginSM}}},[`${t}-btns`]:{textAlign:"end",marginTop:i.marginSM,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${t}-error ${t}-body > ${i.iconCls}`]:{color:i.colorError},[`${t}-warning ${t}-body > ${i.iconCls}, - ${t}-confirm ${t}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${t}-info ${t}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${t}-success ${t}-body > ${i.iconCls}`]:{color:i.colorSuccess}}},dHe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},hHe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-confirm`;return{[e]:{[`${e}-content`]:{padding:0},[`${e}-header`]:{padding:i.modalHeaderPadding,borderBottom:`${i.modalHeaderBorderWidth}px ${i.modalHeaderBorderStyle} ${i.modalHeaderBorderColorSplit}`,marginBottom:0},[`${e}-body`]:{padding:i.modalBodyPadding},[`${e}-footer`]:{padding:`${i.modalFooterPaddingVertical}px ${i.modalFooterPaddingHorizontal}px`,borderTop:`${i.modalFooterBorderWidth}px ${i.modalFooterBorderStyle} ${i.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px`,marginTop:0}},[n]:{[`${t}-modal-body`]:{padding:`${i.padding*2}px ${i.padding*2}px ${i.paddingLG}px`},[`${n}-body`]:{[`> ${i.iconCls}`]:{marginInlineEnd:i.margin,[`+ ${n}-title + ${n}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.margin}}},[`${n}-btns`]:{marginTop:i.marginLG}}}},v_e=yo("Modal",i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5,r=Bi(i,{modalBodyPadding:i.paddingLG,modalHeaderBg:i.colorBgElevated,modalHeaderPadding:`${e}px ${i.paddingLG}px`,modalHeaderBorderWidth:i.lineWidth,modalHeaderBorderStyle:i.lineType,modalHeaderTitleLineHeight:n,modalHeaderTitleFontSize:t,modalHeaderBorderColorSplit:i.colorSplit,modalHeaderCloseSize:n*t+e*2,modalContentBg:i.colorBgElevated,modalHeadingColor:i.colorTextHeading,modalCloseColor:i.colorTextDescription,modalFooterBg:"transparent",modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterPaddingVertical:i.paddingXS,modalFooterPaddingHorizontal:i.padding,modalFooterBorderWidth:i.lineWidth,modalConfirmTitleFontSize:i.fontSizeLG,modalIconHoverColor:i.colorIconHover,modalConfirmIconSize:i.fontSize*i.lineHeight,modalCloseBtnSize:i.controlHeightLG*.55});return[cHe(r),uHe(r),dHe(r),lHe(r),i.wireframe&&hHe(r),Xk(r,"zoom")]});var fHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:r,onOk:o,onCancel:s,okButtonProps:a,cancelButtonProps:l}=i,[c]=jk("Modal",Nve());return C.createElement(C.Fragment,null,C.createElement(ed,Object.assign({onClick:s},l),n||(c==null?void 0:c.cancelText)),C.createElement(ed,Object.assign({},a_e(t),{loading:r,onClick:o},a),e||(c==null?void 0:c.okText)))},gHe=i=>{const{prefixCls:e,className:t,closeIcon:n,closable:r,type:o,title:s,children:a}=i,l=fHe(i,["prefixCls","className","closeIcon","closable","type","title","children"]),{getPrefixCls:c}=C.useContext(Pn),u=c(),d=e||c("modal"),[,h]=v_e(d),f=`${d}-confirm`;let g={};return o?g={closable:r??!1,title:"",footer:"",children:C.createElement(y_e,Object.assign({},i,{confirmPrefixCls:f,rootPrefixCls:u,content:a}))}:g={closable:r??!0,title:s,footer:i.footer===void 0?C.createElement(b_e,Object.assign({},i)):i.footer,children:a},C.createElement(d_e,Object.assign({prefixCls:d,className:De(h,`${d}-pure-panel`,o&&f,o&&`${f}-${o}`,t)},l,{closeIcon:__e(d,n),closable:r},g))},pHe=gHe;var mHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{dH={x:i.pageX,y:i.pageY},setTimeout(()=>{dH=null},100)};p_e()&&document.documentElement.addEventListener("click",vHe,!0);const _He=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:r}=C.useContext(Pn),o=M=>{const{onCancel:P}=i;P==null||P(M)},s=M=>{const{onOk:P}=i;P==null||P(M)},{prefixCls:a,className:l,rootClassName:c,open:u,wrapClassName:d,centered:h,getContainer:f,closeIcon:g,focusTriggerAfterClose:p=!0,visible:m,width:v=520,footer:_}=i,y=mHe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose","visible","width","footer"]),S=n("modal",a),L=n(),[E,D]=v_e(S),k=De(d,{[`${S}-centered`]:!!h,[`${S}-wrap-rtl`]:r==="rtl"}),T=_===void 0?C.createElement(b_e,Object.assign({},i,{onOk:s,onCancel:o})):_;return E(C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},C.createElement(f_e,Object.assign({width:v},y,{getContainer:f===void 0?t:f,prefixCls:S,rootClassName:De(D,c),wrapClassName:k,footer:T,visible:u??m,mousePosition:(e=y.mousePosition)!==null&&e!==void 0?e:dH,onClose:o,closeIcon:__e(S,g),focusTriggerAfterClose:p,transitionName:Nb(L,"zoom",i.transitionName),maskTransitionName:Nb(L,"fade",i.maskTransitionName),className:De(D,l)})))))},C_e=_He;function y_e(i){const{icon:e,onCancel:t,onOk:n,close:r,okText:o,okButtonProps:s,cancelText:a,cancelButtonProps:l,confirmPrefixCls:c,rootPrefixCls:u,type:d,okCancel:h,footer:f,locale:g}=i;let p=e;if(!e&&e!==null)switch(d){case"info":p=C.createElement($me,null);break;case"success":p=C.createElement(Eq,null);break;case"error":p=C.createElement(PS,null);break;default:p=C.createElement(Eme,null)}const m=i.okType||"primary",v=h??d==="confirm",_=i.autoFocusButton===null?!1:i.autoFocusButton||"ok",[y]=jk("Modal"),S=g||y,L=v&&C.createElement(lre,{actionFn:t,close:r,autoFocus:_==="cancel",buttonProps:l,prefixCls:`${u}-btn`},a||(S==null?void 0:S.cancelText));return C.createElement("div",{className:`${c}-body-wrapper`},C.createElement("div",{className:`${c}-body`},p,i.title===void 0?null:C.createElement("span",{className:`${c}-title`},i.title),C.createElement("div",{className:`${c}-content`},i.content)),f===void 0?C.createElement("div",{className:`${c}-btns`},L,C.createElement(lre,{type:m,actionFn:n,close:r,autoFocus:_==="ok",buttonProps:s,prefixCls:`${u}-btn`},o||(v?S==null?void 0:S.okText:S==null?void 0:S.justOkText))):f)}const w_e=i=>{const{close:e,zIndex:t,afterClose:n,visible:r,open:o,keyboard:s,centered:a,getContainer:l,maskStyle:c,direction:u,prefixCls:d,wrapClassName:h,rootPrefixCls:f,iconPrefixCls:g,bodyStyle:p,closable:m=!1,closeIcon:v,modalRender:_,focusTriggerAfterClose:y}=i,S=`${d}-confirm`,L=i.width||416,E=i.style||{},D=i.mask===void 0?!0:i.mask,k=i.maskClosable===void 0?!1:i.maskClosable,T=De(S,`${S}-${i.type}`,{[`${S}-rtl`]:u==="rtl"},i.className);return C.createElement(I4,{prefixCls:f,iconPrefixCls:g,direction:u},C.createElement(C_e,{prefixCls:d,className:T,wrapClassName:De({[`${S}-centered`]:!!i.centered},h),onCancel:()=>e==null?void 0:e({triggerCancel:!0}),open:o,title:"",footer:null,transitionName:Nb(f,"zoom",i.transitionName),maskTransitionName:Nb(f,"fade",i.maskTransitionName),mask:D,maskClosable:k,maskStyle:c,style:E,bodyStyle:p,width:L,zIndex:t,afterClose:n,keyboard:s,centered:a,getContainer:l,closable:m,closeIcon:v,modalRender:_,focusTriggerAfterClose:y},C.createElement(y_e,Object.assign({},i,{confirmPrefixCls:S}))))},bHe=[],U0=bHe;var CHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);rh&&h.triggerCancel);i.onCancel&&d&&i.onCancel.apply(i,[()=>{}].concat(gt(c.slice(1))));for(let h=0;h{const f=Nve(),{getPrefixCls:g,getIconPrefixCls:p}=Fq(),m=g(void 0,yHe()),v=d||`${m}-modal`,_=p();Hq(C.createElement(w_e,Object.assign({},h,{prefixCls:v,rootPrefixCls:m,iconPrefixCls:_,okText:c,locale:f,cancelText:u||f.cancelText})),e)})}function s(){for(var l=arguments.length,c=new Array(l),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,c)}}),t.visible&&delete t.visible,o(t)}function a(l){typeof l=="function"?t=l(t):t=Object.assign(Object.assign({},t),l),o(t)}return o(t),U0.push(s),{destroy:s,update:a}}function x_e(i){return Object.assign(Object.assign({},i),{type:"warning"})}function L_e(i){return Object.assign(Object.assign({},i),{type:"info"})}function E_e(i){return Object.assign(Object.assign({},i),{type:"success"})}function D_e(i){return Object.assign(Object.assign({},i),{type:"error"})}function I_e(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function wHe(i){let{rootPrefixCls:e}=i;S_e=e}const SHe=(i,e)=>{let{afterClose:t,config:n}=i;var r;const[o,s]=C.useState(!0),[a,l]=C.useState(n),{direction:c,getPrefixCls:u}=C.useContext(Pn),d=u("modal"),h=u(),f=()=>{var v;t(),(v=a.afterClose)===null||v===void 0||v.call(a)},g=function(){s(!1);for(var v=arguments.length,_=new Array(v),y=0;yL&&L.triggerCancel);a.onCancel&&S&&a.onCancel.apply(a,[()=>{}].concat(gt(_.slice(1))))};C.useImperativeHandle(e,()=>({destroy:g,update:v=>{l(_=>Object.assign(Object.assign({},_),v))}}));const p=(r=a.okCancel)!==null&&r!==void 0?r:a.type==="confirm",[m]=jk("Modal",Tb.Modal);return C.createElement(w_e,Object.assign({prefixCls:d,rootPrefixCls:h},a,{close:g,open:o,afterClose:f,okText:a.okText||(p?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:a.direction||c,cancelText:a.cancelText||(m==null?void 0:m.cancelText)}))},xHe=C.forwardRef(SHe);let xre=0;const LHe=C.memo(C.forwardRef((i,e)=>{const[t,n]=lWe();return C.useImperativeHandle(e,()=>({patchElement:n}),[]),C.createElement(C.Fragment,null,t)}));function EHe(){const i=C.useRef(null),[e,t]=C.useState([]);C.useEffect(()=>{e.length&&(gt(e).forEach(s=>{s()}),t([]))},[e]);const n=C.useCallback(o=>function(a){var l;xre+=1;const c=C.createRef();let u;const d=C.createElement(xHe,{key:`modal-${xre}`,config:o(a),ref:c,afterClose:()=>{u==null||u()}});return u=(l=i.current)===null||l===void 0?void 0:l.patchElement(d),u&&U0.push(u),{destroy:()=>{function h(){var f;(f=c.current)===null||f===void 0||f.destroy()}c.current?h():t(f=>[].concat(gt(f),[h]))},update:h=>{function f(){var g;(g=c.current)===null||g===void 0||g.update(h)}c.current?f():t(g=>[].concat(gt(g),[f]))}}},[]);return[C.useMemo(()=>({info:n(L_e),success:n(E_e),error:n(D_e),warning:n(x_e),confirm:n(I_e)}),[]),C.createElement(LHe,{key:"modal-holder",ref:i})]}function k6(i){return i!==void 0}function nl(i,e){var t=e||{},n=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=Cv(function(){return k6(r)?r:k6(n)?typeof n=="function"?n():n:typeof i=="function"?i():i}),l=$e(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=rc(o),g=Cv([d]),p=$e(g,2),m=p[0],v=p[1];IE(function(){var y=m[0];c!==y&&f(c,y)},[m]),IE(function(){k6(r)||u(r)},[r]);var _=rc(function(y,S){u(y,S),v([d],S)});return[h,_]}const M4=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var i=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(i)||/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(i==null?void 0:i.substr(0,4))};var k_e=C.createContext(null);function DHe(){return C.useContext(k_e)}function IHe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=C.useState(!1),t=$e(e,2),n=t[0],r=t[1],o=C.useRef(null),s=function(){window.clearTimeout(o.current)};C.useEffect(function(){return s},[]);var a=function(c,u){s(),o.current=window.setTimeout(function(){r(c),u&&u()},i)};return[n,a,s]}function T_e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=C.useRef(null),t=C.useRef(null);C.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function kHe(i,e,t,n){var r=C.useRef(null);r.current={open:e,triggerOpen:t,customizedTrigger:n},C.useEffect(function(){function o(s){var a;if(!((a=r.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),r.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var THe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],t1=void 0;function NHe(i,e){var t=i.prefixCls,n=i.invalidate,r=i.item,o=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,m=p===void 0?"div":p,v=Mn(i,THe),_=s&&!f;function y(k){l(c,k)}C.useEffect(function(){return function(){y(null)}},[]);var S=o&&r!==t1?o(r):h,L;n||(L={opacity:_?0:1,height:_?0:t1,overflowY:_?"hidden":t1,order:s?g:t1,pointerEvents:_?"none":t1,position:_?"absolute":t1});var E={};_&&(E["aria-hidden"]=!0);var D=C.createElement(m,It({className:De(!n&&t,u),style:te(te({},L),d)},E,v,{ref:e}),S);return s&&(D=C.createElement(Lh,{onResize:function(T){var M=T.offsetWidth;y(M)},disabled:a},D)),D}var kE=C.forwardRef(NHe);kE.displayName="Item";function RHe(i){if(typeof MessageChannel>"u")er(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function MHe(){var i=C.useRef(null),e=function(n){i.current||(i.current=[],RHe(function(){lh.unstable_batchedUpdates(function(){i.current.forEach(function(r){r()}),i.current=null})})),i.current.push(n)};return e}function Ux(i,e){var t=C.useState(e),n=$e(t,2),r=n[0],o=n[1],s=rc(function(a){i(function(){o(a)})});return[r,s]}var PHe=["component"],AHe=["className"],OHe=["className"],FHe=function(e,t){var n=C.useContext(rA);if(!n){var r=e.component,o=r===void 0?"div":r,s=Mn(e,PHe);return C.createElement(o,It({},s,{ref:t}))}var a=n.className,l=Mn(n,AHe),c=e.className,u=Mn(e,OHe);return C.createElement(rA.Provider,{value:null},C.createElement(kE,It({ref:t,className:De(a,c)},l,u)))},N_e=C.forwardRef(FHe);N_e.displayName="RawItem";var BHe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],rA=C.createContext(null),R_e="responsive",M_e="invalidate";function WHe(i){return"+ ".concat(i.length," ...")}function $He(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,r=i.data,o=r===void 0?[]:r,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,m=i.renderRawRest,v=i.suffix,_=i.component,y=_===void 0?"div":_,S=i.itemComponent,L=i.onVisibleChange,E=Mn(i,BHe),D=d==="full",k=MHe(),T=Ux(k,null),M=$e(T,2),P=M[0],N=M[1],R=P||0,O=Ux(k,new Map),B=$e(O,2),$=B[0],G=B[1],U=Ux(k,0),j=$e(U,2),ie=j[0],Y=j[1],J=Ux(k,0),Q=$e(J,2),he=Q[0],ge=Q[1],ye=Ux(k,0),be=$e(ye,2),Ge=be[0],nt=be[1],je=C.useState(null),_e=$e(je,2),Ve=_e[0],Le=_e[1],Pe=C.useState(null),Be=$e(Pe,2),Qe=Be[0],Ye=Be[1],We=C.useMemo(function(){return Qe===null&&D?Number.MAX_SAFE_INTEGER:Qe||0},[Qe,P]),dt=C.useState(!1),re=$e(dt,2),ue=re[0],de=re[1],z="".concat(n,"-item"),q=Math.max(ie,he),se=g===R_e,ne=o.length&&se,pe=g===M_e,ke=ne||typeof g=="number"&&o.length>g,oe=C.useMemo(function(){var at=o;return ne?P===null&&D?at=o:at=o.slice(0,Math.min(o.length,R/u)):typeof g=="number"&&(at=o.slice(0,g)),at},[o,u,P,g,ne]),ce=C.useMemo(function(){return ne?o.slice(We+1):o.slice(oe.length)},[o,oe,ne,We]),fe=C.useCallback(function(at,ut){var ht;return typeof l=="function"?l(at):(ht=l&&(at==null?void 0:at[l]))!==null&&ht!==void 0?ht:ut},[l]),Ie=C.useCallback(s||function(at){return at},[s]);function Te(at,ut,ht){Qe===at&&(ut===void 0||ut===Ve)||(Ye(at),ht||(de(atR){Te(Lt-1,at-At-Ge+he);break}}v&&Ht(0)+Ge>R&&Le(null)}},[R,$,he,Ge,fe,oe]);var Ue=ue&&!!ce.length,Ct={};Ve!==null&&ne&&(Ct={position:"absolute",left:Ve,top:0});var Dt={prefixCls:z,responsive:ne,component:S,invalidate:pe},St=a?function(at,ut){var ht=fe(at,ut);return C.createElement(rA.Provider,{key:ht,value:te(te({},Dt),{},{order:ut,item:at,itemKey:ht,registerSize:Me,display:ut<=We})},a(at,ut))}:function(at,ut){var ht=fe(at,ut);return C.createElement(kE,It({},Dt,{order:ut,key:ht,item:at,renderItem:Ie,itemKey:ht,registerSize:Me,display:ut<=We}))},Kt,_n={order:Ue?We:Number.MAX_SAFE_INTEGER,className:"".concat(z,"-rest"),registerSize:bt,display:Ue};if(m)m&&(Kt=C.createElement(rA.Provider,{value:te(te({},Dt),_n)},m(ce)));else{var zt=p||WHe;Kt=C.createElement(kE,It({},Dt,_n),typeof zt=="function"?zt(ce):zt)}var Yt=C.createElement(y,It({className:De(!pe&&n,f),style:h,ref:e},E),oe.map(St),ke?Kt:null,v&&C.createElement(kE,It({},Dt,{responsive:se,responsiveDisabled:!ne,order:We,className:"".concat(z,"-suffix"),registerSize:rt,display:!0,style:Ct}),v));return se&&(Yt=C.createElement(Lh,{onResize:He,disabled:!ne},Yt)),Yt}var Nf=C.forwardRef($He);Nf.displayName="Overflow";Nf.Item=N_e;Nf.RESPONSIVE=R_e;Nf.INVALIDATE=M_e;var oA=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,o=e.onMouseDown,s=e.onClick,a=e.children,l;return typeof n=="function"?l=n(r):l=n,C.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),o&&o(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},l!==void 0?l:C.createElement("span",{className:De(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},a))},HHe=function(e,t){var n,r,o=e.prefixCls,s=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,u=e.autoFocus,d=e.autoComplete,h=e.editable,f=e.activeDescendantId,g=e.value,p=e.maxLength,m=e.onKeyDown,v=e.onMouseDown,_=e.onChange,y=e.onPaste,S=e.onCompositionStart,L=e.onCompositionEnd,E=e.open,D=e.attrs,k=a||C.createElement("input",null),T=k,M=T.ref,P=T.props,N=P.onKeyDown,R=P.onChange,O=P.onMouseDown,B=P.onCompositionStart,$=P.onCompositionEnd,G=P.style;return"maxLength"in k.props,k=C.cloneElement(k,te(te(te({type:"search"},P),{},{id:s,ref:pu(t,M),disabled:l,tabIndex:c,autoComplete:d||"off",autoFocus:u,className:De("".concat(o,"-selection-search-input"),(n=k)===null||n===void 0||(r=n.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":f},D),{},{value:h?g:"",maxLength:p,readOnly:!h,unselectable:h?null:"on",style:te(te({},G),{},{opacity:h?null:0}),onKeyDown:function(j){m(j),N&&N(j)},onMouseDown:function(j){v(j),O&&O(j)},onChange:function(j){_(j),R&&R(j)},onCompositionStart:function(j){S(j),B&&B(j)},onCompositionEnd:function(j){L(j),$&&$(j)},onPaste:y})),k},Yq=C.forwardRef(HHe);Yq.displayName="Input";function P_e(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var VHe=typeof window<"u"&&window.document&&window.document.documentElement,zHe=VHe;function UHe(i){return i!=null}function Lre(i){return["string","number"].includes(Un(i))}function A_e(i){var e=void 0;return i&&(Lre(i.title)?e=i.title.toString():Lre(i.label)&&(e=i.label.toString())),e}function jHe(i,e){zHe?C.useLayoutEffect(i,e):C.useEffect(i,e)}function KHe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Ere=function(e){e.preventDefault(),e.stopPropagation()},GHe=function(e){var t=e.id,n=e.prefixCls,r=e.values,o=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,m=e.tabIndex,v=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,S=e.maxTagPlaceholder,L=S===void 0?function(Le){return"+ ".concat(Le.length," ...")}:S,E=e.tagRender,D=e.onToggleOpen,k=e.onRemove,T=e.onInputChange,M=e.onInputPaste,P=e.onInputKeyDown,N=e.onInputMouseDown,R=e.onInputCompositionStart,O=e.onInputCompositionEnd,B=C.useRef(null),$=C.useState(0),G=$e($,2),U=G[0],j=G[1],ie=C.useState(!1),Y=$e(ie,2),J=Y[0],Q=Y[1],he="".concat(n,"-selection"),ge=o||d==="multiple"&&a===!1||d==="tags"?s:"",ye=d==="tags"||d==="multiple"&&a===!1||h&&(o||J);jHe(function(){j(B.current.scrollWidth)},[ge]);function be(Le,Pe,Be,Qe,Ye){return C.createElement("span",{className:De("".concat(he,"-item"),we({},"".concat(he,"-item-disabled"),Be)),title:A_e(Le)},C.createElement("span",{className:"".concat(he,"-item-content")},Pe),Qe&&C.createElement(oA,{className:"".concat(he,"-item-remove"),onMouseDown:Ere,onClick:Ye,customizeIcon:v},"×"))}function Ge(Le,Pe,Be,Qe,Ye){var We=function(re){Ere(re),D(!o)};return C.createElement("span",{onMouseDown:We},E({label:Pe,value:Le,disabled:Be,closable:Qe,onClose:Ye}))}function nt(Le){var Pe=Le.disabled,Be=Le.label,Qe=Le.value,Ye=!u&&!Pe,We=Be;if(typeof y=="number"&&(typeof Be=="string"||typeof Be=="number")){var dt=String(We);dt.length>y&&(We="".concat(dt.slice(0,y),"..."))}var re=function(de){de&&de.stopPropagation(),k(Le)};return typeof E=="function"?Ge(Qe,We,Pe,Ye,re):be(Le,We,Pe,Ye,re)}function je(Le){var Pe=typeof L=="function"?L(Le):L;return be({title:Pe},Pe,!1)}var _e=C.createElement("div",{className:"".concat(he,"-search"),style:{width:U},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},C.createElement(Yq,{ref:l,open:o,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:ye,activeDescendantId:p,value:ge,onKeyDown:P,onMouseDown:N,onChange:T,onPaste:M,onCompositionStart:R,onCompositionEnd:O,tabIndex:m,attrs:Mp(e,!0)}),C.createElement("span",{ref:B,className:"".concat(he,"-search-mirror"),"aria-hidden":!0},ge," ")),Ve=C.createElement(Nf,{prefixCls:"".concat(he,"-overflow"),data:r,renderItem:nt,renderRest:je,suffix:_e,itemKey:KHe,maxCount:_});return C.createElement(C.Fragment,null,Ve,!r.length&&!ge&&C.createElement("span",{className:"".concat(he,"-placeholder")},c))},qHe=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,m=e.searchValue,v=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,S=e.onInputMouseDown,L=e.onInputChange,E=e.onInputPaste,D=e.onInputCompositionStart,k=e.onInputCompositionEnd,T=e.title,M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=u==="combobox",B=O||p,$=h[0],G=m||"";O&&v&&!N&&(G=v),C.useEffect(function(){O&&R(!1)},[O,v]);var U=u!=="combobox"&&!d&&!p?!1:!!G,j=T===void 0?A_e($):T,ie=function(){if($)return null;var J=U?{visibility:"hidden"}:void 0;return C.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:J},f)};return C.createElement(C.Fragment,null,C.createElement("span",{className:"".concat(n,"-selection-search")},C.createElement(Yq,{ref:o,prefixCls:n,id:r,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:B,activeDescendantId:c,value:G,onKeyDown:y,onMouseDown:S,onChange:function(J){R(!0),L(J)},onPaste:E,onCompositionStart:D,onCompositionEnd:k,tabIndex:g,attrs:Mp(e,!0),maxLength:O?_:void 0})),!O&&$?C.createElement("span",{className:"".concat(n,"-selection-item"),title:j,style:U?{visibility:"hidden"}:void 0},$.label):null,ie())};function XHe(i){return![_t.ESC,_t.SHIFT,_t.BACKSPACE,_t.TAB,_t.WIN_KEY,_t.ALT,_t.META,_t.WIN_KEY_RIGHT,_t.CTRL,_t.SEMICOLON,_t.EQUALS,_t.CAPS_LOCK,_t.CONTEXT_MENU,_t.F1,_t.F2,_t.F3,_t.F4,_t.F5,_t.F6,_t.F7,_t.F8,_t.F9,_t.F10,_t.F11,_t.F12].includes(i)}var YHe=function(e,t){var n=C.useRef(null),r=C.useRef(!1),o=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;C.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var m=T_e(0),v=$e(m,2),_=v[0],y=v[1],S=function(G){var U=G.which;(U===_t.UP||U===_t.DOWN)&&G.preventDefault(),g&&g(G),U===_t.ENTER&&a==="tags"&&!r.current&&!s&&(h==null||h(G.target.value)),XHe(U)&&f(!0)},L=function(){y(!0)},E=C.useRef(null),D=function(G){d(G,!0,r.current)!==!1&&f(!0)},k=function(){r.current=!0},T=function(G){r.current=!1,a!=="combobox"&&D(G.target.value)},M=function(G){var U=G.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var j=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(j,E.current)}E.current=null,D(U)},P=function(G){var U=G.clipboardData,j=U.getData("text");E.current=j},N=function(G){var U=G.target;if(U!==n.current){var j=document.body.style.msTouchAction!==void 0;j?setTimeout(function(){n.current.focus()}):n.current.focus()}},R=function(G){var U=_();G.target!==n.current&&!U&&a!=="combobox"&&G.preventDefault(),(a!=="combobox"&&(!l||!U)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},O={inputRef:n,onInputKeyDown:S,onInputMouseDown:L,onInputChange:M,onInputPaste:P,onInputCompositionStart:k,onInputCompositionEnd:T},B=a==="multiple"||a==="tags"?C.createElement(GHe,It({},e,O)):C.createElement(qHe,It({},e,O));return C.createElement("div",{ref:p,className:"".concat(o,"-selector"),onClick:N,onMouseDown:R},B)},O_e=C.forwardRef(YHe);O_e.displayName="Selector";var Dre=C.createContext(null);function Ire(i){return i?Array.isArray(i)?i:[i]:[]}function ZHe(i,e,t,n){return C.useMemo(function(){var r=Ire(t??e),o=Ire(n??e),s=new Set(r),a=new Set(o);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function QHe(){var i=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?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function JHe(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function n1(i,e){var t=e[0],n=e[1],r,o;return t==="t"?o=i.y:t==="b"?o=i.y+i.height:o=i.y+i.height/2,n==="l"?r=i.x:n==="r"?r=i.x+i.width:r=i.x+i.width/2,{x:r,y:o}}function cm(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,r){return r===e?t[n]||"c":n}).join("")}function tVe(i,e,t,n,r,o,s){var a=C.useState({ready:!1,offsetX:0,offsetY:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[n]||{}}),l=$e(a,2),c=l[0],u=l[1],d=C.useRef(0),h=C.useMemo(function(){return e?hH(e):[]},[e]),f=C.useRef({}),g=function(){f.current={}};i||g();var p=rc(function(){if(e&&t&&i){let Uo=function(Fa,Ba){var Vl=M.x+Fa,fl=M.y+Ba,zl=Vl+J,yu=fl+Y,wu=Math.max(Vl,ge.left),Ic=Math.max(fl,ge.top),Wa=Math.min(zl,ge.right),$a=Math.min(yu,ge.bottom);return Math.max(0,(Wa-wu)*($a-Ic))},wo=function(){_n=M.y+Ie,zt=_n+Y,Yt=M.x+fe,at=Yt+J};var _=e,y=_.style.left,S=_.style.top,L=_.ownerDocument,E=Zk(_),D=te(te({},r[n]),o);_.style.left="0",_.style.top="0";var k;if(Array.isArray(t))k={x:t[0],y:t[1],width:0,height:0};else{var T=t.getBoundingClientRect();k={x:T.x,y:T.y,width:T.width,height:T.height}}var M=_.getBoundingClientRect(),P=E.getComputedStyle(_),N=P.width,R=P.height,O=L.documentElement,B=O.clientWidth,$=O.clientHeight,G=O.scrollWidth,U=O.scrollHeight,j=O.scrollTop,ie=O.scrollLeft,Y=M.height,J=M.width,Q=k.height,he=k.width,ge=D.htmlRegion==="scroll"?{left:-ie,top:-j,right:G-ie,bottom:U-j}:{left:0,top:0,right:B,bottom:$};ge=eVe(ge,h),_.style.left=y,_.style.top=S;var ye=sA(Math.round(J/parseFloat(N)*1e3)/1e3),be=sA(Math.round(Y/parseFloat(R)*1e3)/1e3);if(ye===0||be===0||KP(t)&&!qk(t))return;var Ge=D.offset,nt=D.targetOffset,je=Ge||[],_e=$e(je,2),Ve=_e[0],Le=Ve===void 0?0:Ve,Pe=_e[1],Be=Pe===void 0?0:Pe,Qe=nt||[],Ye=$e(Qe,2),We=Ye[0],dt=We===void 0?0:We,re=Ye[1],ue=re===void 0?0:re;k.x+=dt,k.y+=ue;var de=D.points||[],z=$e(de,2),q=z[0],se=z[1],ne=Tre(se),pe=Tre(q),ke=n1(k,ne),oe=n1(M,pe),ce=te({},D),fe=ke.x-oe.x+Le,Ie=ke.y-oe.y+Be,Te=Uo(fe,Ie),He=n1(k,["t","l"]),Me=n1(M,["t","l"]),bt=n1(k,["b","r"]),rt=n1(M,["b","r"]),Ht=D.overflow||{},Ue=Ht.adjustX,Ct=Ht.adjustY,Dt=Ht.shiftX,St=Ht.shiftY,Kt=function(Ba){return typeof Ba=="boolean"?Ba:Ba>=0},_n,zt,Yt,at;wo();var ut=Kt(Ct),ht=pe[0]===ne[0];if(ut&&pe[0]==="t"&&(zt>ge.bottom||f.current.bt)){var Lt=Ie;ht?Lt-=Y-Q:Lt=He.y-rt.y-Be,Uo(fe,Lt)>=Te?(f.current.bt=!0,Ie=Lt,ce.points=[cm(pe,0),cm(ne,0)]):f.current.bt=!1}if(ut&&pe[0]==="b"&&(_n=Te?(f.current.tb=!0,Ie=At,ce.points=[cm(pe,0),cm(ne,0)]):f.current.tb=!1}var ln=Kt(Ue),Si=pe[1]===ne[1];if(ln&&pe[1]==="l"&&(at>ge.right||f.current.rl)){var Xi=fe;Si?Xi-=J-he:Xi=He.x-rt.x-Le,Uo(Xi,Ie)>=Te?(f.current.rl=!0,fe=Xi,ce.points=[cm(pe,1),cm(ne,1)]):f.current.rl=!1}if(ln&&pe[1]==="r"&&(Yt=Te?(f.current.lr=!0,fe=Ir,ce.points=[cm(pe,1),cm(ne,1)]):f.current.lr=!1}wo();var En=Dt===!0?0:Dt;typeof En=="number"&&(Ytge.right&&(fe-=at-ge.right,k.x>ge.right-En&&(fe+=k.x-ge.right+En)));var fi=St===!0?0:St;typeof fi=="number"&&(_nge.bottom&&(Ie-=zt-ge.bottom,k.y>ge.bottom-fi&&(Ie+=k.y-ge.bottom+fi)));var Ur=M.x+fe,go=Ur+J,ys=M.y+Ie,ws=ys+Y,Ut=k.x,Ee=Ut+he,wt=k.y,kt=wt+Q,qn=Math.max(Ur,Ut),dr=Math.min(go,Ee),jr=(qn+dr)/2,ei=jr-Ur,to=Math.max(ys,wt),$s=Math.min(ws,kt),Hl=(to+$s)/2,Oa=Hl-ys;s==null||s(e,ce),u({ready:!0,offsetX:fe/ye,offsetY:Ie/be,arrowX:ei/ye,arrowY:Oa/be,scaleX:ye,scaleY:be,align:ce})}}),m=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&p()})},v=function(){u(function(y){return te(te({},y),{},{ready:!1})})};return Cr(v,[n]),Cr(function(){i||v()},[i]),[c.ready,c.offsetX,c.offsetY,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,m]}function nVe(i,e,t,n){Cr(function(){if(i&&e&&t){let u=function(){n()};var r=e,o=t,s=hH(r),a=hH(o),l=Zk(o),c=new Set([l].concat(gt(s),gt(a)));return c.forEach(function(d){d.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),n(),function(){c.forEach(function(d){d.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[i,e,t])}function iVe(i){var e=i.prefixCls,t=i.align,n=i.arrowX,r=n===void 0?0:n,o=i.arrowY,s=o===void 0?0:o,a=C.useRef();if(!t||!t.points)return null;var l={position:"absolute"};if(t.autoArrow!==!1){var c=t.points[0],u=t.points[1],d=c[0],h=c[1],f=u[0],g=u[1];d===f||!["t","b"].includes(d)?l.top=s:d==="t"?l.top=0:l.bottom=0,h===g||!["l","r"].includes(h)?l.left=r:h==="l"?l.left=0:l.right=0}return C.createElement("div",{ref:a,className:"".concat(e,"-arrow"),style:l})}function rVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,r=i.mask,o=i.motion;return r?React.createElement(hd,It({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return React.createElement("div",{style:{zIndex:n},className:De("".concat(e,"-mask"),a)})}):null}var oVe=C.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),sVe=C.forwardRef(function(i,e){var t=i.popup,n=i.className,r=i.prefixCls,o=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.onClick,d=i.mask,h=i.arrow,f=i.align,g=i.arrowX,p=i.arrowY,m=i.motion,v=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,S=i.autoDestroy,L=i.portal,E=i.zIndex,D=i.onMouseEnter,k=i.onMouseLeave,T=i.ready,M=i.offsetX,P=i.offsetY,N=i.onAlign,R=i.onPrepare,O=i.stretch,B=i.targetWidth,$=i.targetHeight,G=typeof t=="function"?t():t,U=l||c,j=(y==null?void 0:y.length)>0,ie=C.useState(!y||!j),Y=$e(ie,2),J=Y[0],Q=Y[1];if(Cr(function(){!J&&j&&s&&Q(!0)},[J,j,s]),!J)return null;var he=T||!l?{left:M,top:P}:{left:"-1000vw",top:"-1000vh"},ge={};return O&&(O.includes("height")&&$?ge.height=$:O.includes("minHeight")&&$&&(ge.minHeight=$),O.includes("width")&&B?ge.width=B:O.includes("minWidth")&&B&&(ge.minWidth=B)),l||(ge.pointerEvents="none"),C.createElement(L,{open:_||U,getContainer:y&&function(){return y(s)},autoDestroy:S},C.createElement(rVe,{prefixCls:r,open:l,zIndex:E,mask:d,motion:v}),C.createElement(Lh,{onResize:N,disabled:!l},function(ye){return C.createElement(hd,It({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(r,"-hidden")},m,{onAppearPrepare:R,onEnterPrepare:R,visible:l,onVisibleChanged:function(Ge){var nt;m==null||(nt=m.onVisibleChanged)===null||nt===void 0||nt.call(m,Ge),a(Ge)}}),function(be,Ge){var nt=be.className,je=be.style,_e=De(r,nt,n);return C.createElement("div",{ref:pu(ye,e,Ge),className:_e,style:te(te(te(te({},he),ge),je),{},{boxSizing:"border-box",zIndex:E},o),onMouseEnter:D,onMouseLeave:k,onClick:u},h&&C.createElement(iVe,{prefixCls:r,align:f,arrowX:g,arrowY:p}),C.createElement(oVe,{cache:!l},G))})}))}),aVe=C.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,r=E_(t),o=C.useCallback(function(a){OD(e,n?n(a):a)},[n]),s=y4(o,t.ref);return r?C.cloneElement(t,{ref:s}):t}),lVe=["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","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function cVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jq,e=C.forwardRef(function(t,n){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,m=t.mouseLeaveDelay,v=m===void 0?.1:m,_=t.focusDelay,y=t.blurDelay,S=t.mask,L=t.maskClosable,E=L===void 0?!0:L,D=t.getPopupContainer,k=t.forceRender,T=t.autoDestroy,M=t.destroyPopupOnHide,P=t.popup,N=t.popupClassName,R=t.popupStyle,O=t.popupPlacement,B=t.builtinPlacements,$=B===void 0?{}:B,G=t.popupAlign,U=t.zIndex,j=t.stretch,ie=t.getPopupClassNameFromAlign,Y=t.alignPoint,J=t.onPopupClick,Q=t.onPopupAlign,he=t.arrow,ge=t.popupMotion,ye=t.maskMotion,be=t.popupTransitionName,Ge=t.popupAnimation,nt=t.maskTransitionName,je=t.maskAnimation,_e=t.className,Ve=t.getTriggerDOMNode,Le=Mn(t,lVe),Pe=T||M||!1,Be=C.useState(!1),Qe=$e(Be,2),Ye=Qe[0],We=Qe[1];Cr(function(){We(M4())},[]);var dt=C.useRef({}),re=C.useContext(Dre),ue=C.useMemo(function(){return{registerSubPopup:function(Zn,tr){dt.current[Zn]=tr,re==null||re.registerSubPopup(Zn,tr)}}},[re]),de=u_e(),z=C.useState(null),q=$e(z,2),se=q[0],ne=q[1],pe=rc(function(pn){KP(pn)&&se!==pn&&ne(pn),re==null||re.registerSubPopup(de,pn)}),ke=C.useState(null),oe=$e(ke,2),ce=oe[0],fe=oe[1],Ie=rc(function(pn){KP(pn)&&ce!==pn&&fe(pn)}),Te=C.Children.only(s),He=(Te==null?void 0:Te.props)||{},Me={},bt=rc(function(pn){var Zn,tr,Fr=ce;return(Fr==null?void 0:Fr.contains(pn))||(Fr==null||(Zn=Fr.getRootNode())===null||Zn===void 0?void 0:Zn.host)===pn||pn===Fr||(se==null?void 0:se.contains(pn))||(se==null||(tr=se.getRootNode())===null||tr===void 0?void 0:tr.host)===pn||pn===se||Object.values(dt.current).some(function(Kr){return(Kr==null?void 0:Kr.contains(pn))||pn===Kr})}),rt=kre(o,ge,Ge,be),Ht=kre(o,ye,je,nt),Ue=C.useState(h||!1),Ct=$e(Ue,2),Dt=Ct[0],St=Ct[1],Kt=d??Dt,_n=rc(function(pn){d===void 0&&St(pn)});Cr(function(){St(d||!1)},[d]);var zt=C.useRef(Kt);zt.current=Kt;var Yt=rc(function(pn){Kt!==pn&&(_n(pn),f==null||f(pn))}),at=C.useRef(),ut=function(){clearTimeout(at.current)},ht=function(Zn){var tr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),tr===0?Yt(Zn):at.current=setTimeout(function(){Yt(Zn)},tr*1e3)};C.useEffect(function(){return ut},[]);var Lt=C.useState(!1),At=$e(Lt,2),ln=At[0],Si=At[1],Xi=C.useRef(!0);Cr(function(){(!Xi.current||Kt)&&Si(!0),Xi.current=!0},[Kt]);var Ir=C.useState(null),En=$e(Ir,2),fi=En[0],Ur=En[1],go=C.useState([0,0]),ys=$e(go,2),ws=ys[0],Ut=ys[1],Ee=function(Zn){Ut([Zn.clientX,Zn.clientY])},wt=tVe(Kt,se,Y?ws:ce,O,$,G,Q),kt=$e(wt,9),qn=kt[0],dr=kt[1],jr=kt[2],ei=kt[3],to=kt[4],$s=kt[5],Hl=kt[6],Oa=kt[7],Uo=kt[8],wo=rc(function(){ln||Uo()});nVe(Kt,ce,se,wo),Cr(function(){wo()},[ws]),Cr(function(){Kt&&!($!=null&&$[O])&&wo()},[JSON.stringify(G)]);var Fa=C.useMemo(function(){var pn=JHe($,o,Oa,Y);return De(pn,ie==null?void 0:ie(Oa))},[Oa,ie,$,o,Y]);C.useImperativeHandle(n,function(){return{forceAlign:wo}});var Ba=function(Zn){Si(!1),Uo(),g==null||g(Zn)},Vl=function(){return new Promise(function(Zn){Ur(function(){return Zn})})};Cr(function(){fi&&(Uo(),fi(),Ur(null))},[fi]);var fl=C.useState(0),zl=$e(fl,2),yu=zl[0],wu=zl[1],Ic=C.useState(0),Wa=$e(Ic,2),$a=Wa[0],Qt=Wa[1],$t=function(Zn,tr){if(wo(),j){var Fr=tr.getBoundingClientRect();wu(Fr.width),Qt(Fr.height)}},On=ZHe(Ye,l,c,u),Jt=$e(On,2),Zt=Jt[0],oi=Jt[1],Wi=function(Zn,tr,Fr,Kr){Me[Zn]=function(AC){var lg;Kr==null||Kr(AC),ht(tr,Fr);for(var px=arguments.length,iN=new Array(px>1?px-1:0),OC=1;OC1?tr-1:0),Kr=1;Kr1?tr-1:0),Kr=1;Kr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,r=[],o=W_e(t,!1),s=o.label,a=o.value,l=o.options;function c(u,d){u.forEach(function(h){var f=h[s];if(d||!(l in h)){var g=h[a];r.push({key:Nre(h,r.length),groupOption:d,data:h,label:f,value:g})}else{var p=f;p===void 0&&n&&(p=h.label),r.push({key:Nre(h,r.length),group:!0,data:h,label:p}),c(h[l],!0)}})}return c(i,!1),r}function fH(i){var e=te({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return uo(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}function gVe(i,e){if(!e||!e.length)return null;var t=!1;function n(o,s){var a=yve(s),l=a[0],c=a.slice(1);if(!l)return[o];var u=o.split(l);return t=t||u.length>1,u.reduce(function(d,h){return[].concat(gt(d),gt(n(h,c)))},[]).filter(function(d){return d})}var r=n(i,e);return t?r:null}var pVe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],mVe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function gH(i){return i==="tags"||i==="multiple"}var vVe=C.forwardRef(function(i,e){var t,n,r=i.id,o=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,m=i.onClear,v=i.mode,_=i.disabled,y=i.loading,S=i.getInputElement,L=i.getRawInputElement,E=i.open,D=i.defaultOpen,k=i.onDropdownVisibleChange,T=i.activeValue,M=i.onActiveValueChange,P=i.activeDescendantId,N=i.searchValue,R=i.autoClearSearchValue,O=i.onSearch,B=i.onSearchSplit,$=i.tokenSeparators,G=i.allowClear,U=i.showArrow,j=i.inputIcon,ie=i.clearIcon,Y=i.OptionList,J=i.animation,Q=i.transitionName,he=i.dropdownStyle,ge=i.dropdownClassName,ye=i.dropdownMatchSelectWidth,be=i.dropdownRender,Ge=i.dropdownAlign,nt=i.placement,je=i.builtinPlacements,_e=i.getPopupContainer,Ve=i.showAction,Le=Ve===void 0?[]:Ve,Pe=i.onFocus,Be=i.onBlur,Qe=i.onKeyUp,Ye=i.onKeyDown,We=i.onMouseDown,dt=Mn(i,pVe),re=gH(v),ue=(a!==void 0?a:re)||v==="combobox",de=te({},dt);mVe.forEach(function(Qt){delete de[Qt]}),u==null||u.forEach(function(Qt){delete de[Qt]});var z=C.useState(!1),q=$e(z,2),se=q[0],ne=q[1];C.useEffect(function(){ne(M4())},[]);var pe=C.useRef(null),ke=C.useRef(null),oe=C.useRef(null),ce=C.useRef(null),fe=C.useRef(null),Ie=IHe(),Te=$e(Ie,3),He=Te[0],Me=Te[1],bt=Te[2];C.useImperativeHandle(e,function(){var Qt,$t;return{focus:(Qt=ce.current)===null||Qt===void 0?void 0:Qt.focus,blur:($t=ce.current)===null||$t===void 0?void 0:$t.blur,scrollTo:function(Jt){var Zt;return(Zt=fe.current)===null||Zt===void 0?void 0:Zt.scrollTo(Jt)}}});var rt=C.useMemo(function(){var Qt;if(v!=="combobox")return N;var $t=(Qt=d[0])===null||Qt===void 0?void 0:Qt.value;return typeof $t=="string"||typeof $t=="number"?String($t):""},[N,v,d]),Ht=v==="combobox"&&typeof S=="function"&&S()||null,Ue=typeof L=="function"&&L(),Ct=y4(ke,Ue==null||(t=Ue.props)===null||t===void 0?void 0:t.ref),Dt=C.useState(!1),St=$e(Dt,2),Kt=St[0],_n=St[1];Cr(function(){_n(!0)},[]);var zt=nl(!1,{defaultValue:D,value:E}),Yt=$e(zt,2),at=Yt[0],ut=Yt[1],ht=Kt?at:!1,Lt=!p&&f;(_||Lt&&ht&&v==="combobox")&&(ht=!1);var At=Lt?!1:ht,ln=C.useCallback(function(Qt){var $t=Qt!==void 0?Qt:!ht;_||(ut($t),ht!==$t&&(k==null||k($t)))},[_,ht,ut,k]),Si=C.useMemo(function(){return($||[]).some(function(Qt){return[` + ${t}-confirm ${t}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${t}-info ${t}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${t}-success ${t}-body > ${i.iconCls}`]:{color:i.colorSuccess}}},dHe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},hHe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-confirm`;return{[e]:{[`${e}-content`]:{padding:0},[`${e}-header`]:{padding:i.modalHeaderPadding,borderBottom:`${i.modalHeaderBorderWidth}px ${i.modalHeaderBorderStyle} ${i.modalHeaderBorderColorSplit}`,marginBottom:0},[`${e}-body`]:{padding:i.modalBodyPadding},[`${e}-footer`]:{padding:`${i.modalFooterPaddingVertical}px ${i.modalFooterPaddingHorizontal}px`,borderTop:`${i.modalFooterBorderWidth}px ${i.modalFooterBorderStyle} ${i.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px`,marginTop:0}},[n]:{[`${t}-modal-body`]:{padding:`${i.padding*2}px ${i.padding*2}px ${i.paddingLG}px`},[`${n}-body`]:{[`> ${i.iconCls}`]:{marginInlineEnd:i.margin,[`+ ${n}-title + ${n}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.margin}}},[`${n}-btns`]:{marginTop:i.marginLG}}}},v_e=yo("Modal",i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5,r=Bi(i,{modalBodyPadding:i.paddingLG,modalHeaderBg:i.colorBgElevated,modalHeaderPadding:`${e}px ${i.paddingLG}px`,modalHeaderBorderWidth:i.lineWidth,modalHeaderBorderStyle:i.lineType,modalHeaderTitleLineHeight:n,modalHeaderTitleFontSize:t,modalHeaderBorderColorSplit:i.colorSplit,modalHeaderCloseSize:n*t+e*2,modalContentBg:i.colorBgElevated,modalHeadingColor:i.colorTextHeading,modalCloseColor:i.colorTextDescription,modalFooterBg:"transparent",modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterPaddingVertical:i.paddingXS,modalFooterPaddingHorizontal:i.padding,modalFooterBorderWidth:i.lineWidth,modalConfirmTitleFontSize:i.fontSizeLG,modalIconHoverColor:i.colorIconHover,modalConfirmIconSize:i.fontSize*i.lineHeight,modalCloseBtnSize:i.controlHeightLG*.55});return[cHe(r),uHe(r),dHe(r),lHe(r),i.wireframe&&hHe(r),Xk(r,"zoom")]});var fHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:r,onOk:o,onCancel:s,okButtonProps:a,cancelButtonProps:l}=i,[c]=jk("Modal",Nve());return C.createElement(C.Fragment,null,C.createElement(ed,Object.assign({onClick:s},l),n||(c==null?void 0:c.cancelText)),C.createElement(ed,Object.assign({},a_e(t),{loading:r,onClick:o},a),e||(c==null?void 0:c.okText)))},gHe=i=>{const{prefixCls:e,className:t,closeIcon:n,closable:r,type:o,title:s,children:a}=i,l=fHe(i,["prefixCls","className","closeIcon","closable","type","title","children"]),{getPrefixCls:c}=C.useContext(Pn),u=c(),d=e||c("modal"),[,h]=v_e(d),f=`${d}-confirm`;let g={};return o?g={closable:r??!1,title:"",footer:"",children:C.createElement(y_e,Object.assign({},i,{confirmPrefixCls:f,rootPrefixCls:u,content:a}))}:g={closable:r??!0,title:s,footer:i.footer===void 0?C.createElement(b_e,Object.assign({},i)):i.footer,children:a},C.createElement(d_e,Object.assign({prefixCls:d,className:De(h,`${d}-pure-panel`,o&&f,o&&`${f}-${o}`,t)},l,{closeIcon:__e(d,n),closable:r},g))},pHe=gHe;var mHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{dH={x:i.pageX,y:i.pageY},setTimeout(()=>{dH=null},100)};p_e()&&document.documentElement.addEventListener("click",vHe,!0);const _He=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:r}=C.useContext(Pn),o=M=>{const{onCancel:P}=i;P==null||P(M)},s=M=>{const{onOk:P}=i;P==null||P(M)},{prefixCls:a,className:l,rootClassName:c,open:u,wrapClassName:d,centered:h,getContainer:f,closeIcon:g,focusTriggerAfterClose:p=!0,visible:m,width:v=520,footer:_}=i,y=mHe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose","visible","width","footer"]),S=n("modal",a),L=n(),[E,D]=v_e(S),k=De(d,{[`${S}-centered`]:!!h,[`${S}-wrap-rtl`]:r==="rtl"}),T=_===void 0?C.createElement(b_e,Object.assign({},i,{onOk:s,onCancel:o})):_;return E(C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},C.createElement(f_e,Object.assign({width:v},y,{getContainer:f===void 0?t:f,prefixCls:S,rootClassName:De(D,c),wrapClassName:k,footer:T,visible:u??m,mousePosition:(e=y.mousePosition)!==null&&e!==void 0?e:dH,onClose:o,closeIcon:__e(S,g),focusTriggerAfterClose:p,transitionName:Rb(L,"zoom",i.transitionName),maskTransitionName:Rb(L,"fade",i.maskTransitionName),className:De(D,l)})))))},C_e=_He;function y_e(i){const{icon:e,onCancel:t,onOk:n,close:r,okText:o,okButtonProps:s,cancelText:a,cancelButtonProps:l,confirmPrefixCls:c,rootPrefixCls:u,type:d,okCancel:h,footer:f,locale:g}=i;let p=e;if(!e&&e!==null)switch(d){case"info":p=C.createElement($me,null);break;case"success":p=C.createElement(Eq,null);break;case"error":p=C.createElement(PS,null);break;default:p=C.createElement(Eme,null)}const m=i.okType||"primary",v=h??d==="confirm",_=i.autoFocusButton===null?!1:i.autoFocusButton||"ok",[y]=jk("Modal"),S=g||y,L=v&&C.createElement(lre,{actionFn:t,close:r,autoFocus:_==="cancel",buttonProps:l,prefixCls:`${u}-btn`},a||(S==null?void 0:S.cancelText));return C.createElement("div",{className:`${c}-body-wrapper`},C.createElement("div",{className:`${c}-body`},p,i.title===void 0?null:C.createElement("span",{className:`${c}-title`},i.title),C.createElement("div",{className:`${c}-content`},i.content)),f===void 0?C.createElement("div",{className:`${c}-btns`},L,C.createElement(lre,{type:m,actionFn:n,close:r,autoFocus:_==="ok",buttonProps:s,prefixCls:`${u}-btn`},o||(v?S==null?void 0:S.okText:S==null?void 0:S.justOkText))):f)}const w_e=i=>{const{close:e,zIndex:t,afterClose:n,visible:r,open:o,keyboard:s,centered:a,getContainer:l,maskStyle:c,direction:u,prefixCls:d,wrapClassName:h,rootPrefixCls:f,iconPrefixCls:g,bodyStyle:p,closable:m=!1,closeIcon:v,modalRender:_,focusTriggerAfterClose:y}=i,S=`${d}-confirm`,L=i.width||416,E=i.style||{},D=i.mask===void 0?!0:i.mask,k=i.maskClosable===void 0?!1:i.maskClosable,T=De(S,`${S}-${i.type}`,{[`${S}-rtl`]:u==="rtl"},i.className);return C.createElement(I4,{prefixCls:f,iconPrefixCls:g,direction:u},C.createElement(C_e,{prefixCls:d,className:T,wrapClassName:De({[`${S}-centered`]:!!i.centered},h),onCancel:()=>e==null?void 0:e({triggerCancel:!0}),open:o,title:"",footer:null,transitionName:Rb(f,"zoom",i.transitionName),maskTransitionName:Rb(f,"fade",i.maskTransitionName),mask:D,maskClosable:k,maskStyle:c,style:E,bodyStyle:p,width:L,zIndex:t,afterClose:n,keyboard:s,centered:a,getContainer:l,closable:m,closeIcon:v,modalRender:_,focusTriggerAfterClose:y},C.createElement(y_e,Object.assign({},i,{confirmPrefixCls:S}))))},bHe=[],j0=bHe;var CHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);rh&&h.triggerCancel);i.onCancel&&d&&i.onCancel.apply(i,[()=>{}].concat(gt(c.slice(1))));for(let h=0;h{const f=Nve(),{getPrefixCls:g,getIconPrefixCls:p}=Fq(),m=g(void 0,yHe()),v=d||`${m}-modal`,_=p();Hq(C.createElement(w_e,Object.assign({},h,{prefixCls:v,rootPrefixCls:m,iconPrefixCls:_,okText:c,locale:f,cancelText:u||f.cancelText})),e)})}function s(){for(var l=arguments.length,c=new Array(l),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,c)}}),t.visible&&delete t.visible,o(t)}function a(l){typeof l=="function"?t=l(t):t=Object.assign(Object.assign({},t),l),o(t)}return o(t),j0.push(s),{destroy:s,update:a}}function x_e(i){return Object.assign(Object.assign({},i),{type:"warning"})}function L_e(i){return Object.assign(Object.assign({},i),{type:"info"})}function E_e(i){return Object.assign(Object.assign({},i),{type:"success"})}function D_e(i){return Object.assign(Object.assign({},i),{type:"error"})}function I_e(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function wHe(i){let{rootPrefixCls:e}=i;S_e=e}const SHe=(i,e)=>{let{afterClose:t,config:n}=i;var r;const[o,s]=C.useState(!0),[a,l]=C.useState(n),{direction:c,getPrefixCls:u}=C.useContext(Pn),d=u("modal"),h=u(),f=()=>{var v;t(),(v=a.afterClose)===null||v===void 0||v.call(a)},g=function(){s(!1);for(var v=arguments.length,_=new Array(v),y=0;yL&&L.triggerCancel);a.onCancel&&S&&a.onCancel.apply(a,[()=>{}].concat(gt(_.slice(1))))};C.useImperativeHandle(e,()=>({destroy:g,update:v=>{l(_=>Object.assign(Object.assign({},_),v))}}));const p=(r=a.okCancel)!==null&&r!==void 0?r:a.type==="confirm",[m]=jk("Modal",Nb.Modal);return C.createElement(w_e,Object.assign({prefixCls:d,rootPrefixCls:h},a,{close:g,open:o,afterClose:f,okText:a.okText||(p?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:a.direction||c,cancelText:a.cancelText||(m==null?void 0:m.cancelText)}))},xHe=C.forwardRef(SHe);let xre=0;const LHe=C.memo(C.forwardRef((i,e)=>{const[t,n]=lWe();return C.useImperativeHandle(e,()=>({patchElement:n}),[]),C.createElement(C.Fragment,null,t)}));function EHe(){const i=C.useRef(null),[e,t]=C.useState([]);C.useEffect(()=>{e.length&&(gt(e).forEach(s=>{s()}),t([]))},[e]);const n=C.useCallback(o=>function(a){var l;xre+=1;const c=C.createRef();let u;const d=C.createElement(xHe,{key:`modal-${xre}`,config:o(a),ref:c,afterClose:()=>{u==null||u()}});return u=(l=i.current)===null||l===void 0?void 0:l.patchElement(d),u&&j0.push(u),{destroy:()=>{function h(){var f;(f=c.current)===null||f===void 0||f.destroy()}c.current?h():t(f=>[].concat(gt(f),[h]))},update:h=>{function f(){var g;(g=c.current)===null||g===void 0||g.update(h)}c.current?f():t(g=>[].concat(gt(g),[f]))}}},[]);return[C.useMemo(()=>({info:n(L_e),success:n(E_e),error:n(D_e),warning:n(x_e),confirm:n(I_e)}),[]),C.createElement(LHe,{key:"modal-holder",ref:i})]}function k6(i){return i!==void 0}function nl(i,e){var t=e||{},n=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=Cv(function(){return k6(r)?r:k6(n)?typeof n=="function"?n():n:typeof i=="function"?i():i}),l=$e(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=rc(o),g=Cv([d]),p=$e(g,2),m=p[0],v=p[1];IE(function(){var y=m[0];c!==y&&f(c,y)},[m]),IE(function(){k6(r)||u(r)},[r]);var _=rc(function(y,S){u(y,S),v([d],S)});return[h,_]}const M4=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var i=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(i)||/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(i==null?void 0:i.substr(0,4))};var k_e=C.createContext(null);function DHe(){return C.useContext(k_e)}function IHe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=C.useState(!1),t=$e(e,2),n=t[0],r=t[1],o=C.useRef(null),s=function(){window.clearTimeout(o.current)};C.useEffect(function(){return s},[]);var a=function(c,u){s(),o.current=window.setTimeout(function(){r(c),u&&u()},i)};return[n,a,s]}function T_e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=C.useRef(null),t=C.useRef(null);C.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function kHe(i,e,t,n){var r=C.useRef(null);r.current={open:e,triggerOpen:t,customizedTrigger:n},C.useEffect(function(){function o(s){var a;if(!((a=r.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),r.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var THe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],t1=void 0;function NHe(i,e){var t=i.prefixCls,n=i.invalidate,r=i.item,o=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,m=p===void 0?"div":p,v=Mn(i,THe),_=s&&!f;function y(k){l(c,k)}C.useEffect(function(){return function(){y(null)}},[]);var S=o&&r!==t1?o(r):h,L;n||(L={opacity:_?0:1,height:_?0:t1,overflowY:_?"hidden":t1,order:s?g:t1,pointerEvents:_?"none":t1,position:_?"absolute":t1});var E={};_&&(E["aria-hidden"]=!0);var D=C.createElement(m,It({className:De(!n&&t,u),style:te(te({},L),d)},E,v,{ref:e}),S);return s&&(D=C.createElement(Lh,{onResize:function(T){var M=T.offsetWidth;y(M)},disabled:a},D)),D}var kE=C.forwardRef(NHe);kE.displayName="Item";function RHe(i){if(typeof MessageChannel>"u")tr(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function MHe(){var i=C.useRef(null),e=function(n){i.current||(i.current=[],RHe(function(){lh.unstable_batchedUpdates(function(){i.current.forEach(function(r){r()}),i.current=null})})),i.current.push(n)};return e}function Ux(i,e){var t=C.useState(e),n=$e(t,2),r=n[0],o=n[1],s=rc(function(a){i(function(){o(a)})});return[r,s]}var PHe=["component"],AHe=["className"],OHe=["className"],FHe=function(e,t){var n=C.useContext(rA);if(!n){var r=e.component,o=r===void 0?"div":r,s=Mn(e,PHe);return C.createElement(o,It({},s,{ref:t}))}var a=n.className,l=Mn(n,AHe),c=e.className,u=Mn(e,OHe);return C.createElement(rA.Provider,{value:null},C.createElement(kE,It({ref:t,className:De(a,c)},l,u)))},N_e=C.forwardRef(FHe);N_e.displayName="RawItem";var BHe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],rA=C.createContext(null),R_e="responsive",M_e="invalidate";function WHe(i){return"+ ".concat(i.length," ...")}function $He(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,r=i.data,o=r===void 0?[]:r,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,m=i.renderRawRest,v=i.suffix,_=i.component,y=_===void 0?"div":_,S=i.itemComponent,L=i.onVisibleChange,E=Mn(i,BHe),D=d==="full",k=MHe(),T=Ux(k,null),M=$e(T,2),P=M[0],N=M[1],R=P||0,O=Ux(k,new Map),B=$e(O,2),$=B[0],G=B[1],U=Ux(k,0),j=$e(U,2),ie=j[0],Y=j[1],J=Ux(k,0),Q=$e(J,2),he=Q[0],ge=Q[1],ye=Ux(k,0),be=$e(ye,2),Ge=be[0],nt=be[1],je=C.useState(null),_e=$e(je,2),Ve=_e[0],Le=_e[1],Pe=C.useState(null),Be=$e(Pe,2),Qe=Be[0],Ye=Be[1],We=C.useMemo(function(){return Qe===null&&D?Number.MAX_SAFE_INTEGER:Qe||0},[Qe,P]),dt=C.useState(!1),re=$e(dt,2),ue=re[0],de=re[1],z="".concat(n,"-item"),q=Math.max(ie,he),se=g===R_e,ne=o.length&&se,pe=g===M_e,ke=ne||typeof g=="number"&&o.length>g,oe=C.useMemo(function(){var at=o;return ne?P===null&&D?at=o:at=o.slice(0,Math.min(o.length,R/u)):typeof g=="number"&&(at=o.slice(0,g)),at},[o,u,P,g,ne]),ce=C.useMemo(function(){return ne?o.slice(We+1):o.slice(oe.length)},[o,oe,ne,We]),fe=C.useCallback(function(at,ut){var ht;return typeof l=="function"?l(at):(ht=l&&(at==null?void 0:at[l]))!==null&&ht!==void 0?ht:ut},[l]),Ie=C.useCallback(s||function(at){return at},[s]);function Te(at,ut,ht){Qe===at&&(ut===void 0||ut===Ve)||(Ye(at),ht||(de(atR){Te(Lt-1,at-At-Ge+he);break}}v&&Ht(0)+Ge>R&&Le(null)}},[R,$,he,Ge,fe,oe]);var Ue=ue&&!!ce.length,Ct={};Ve!==null&&ne&&(Ct={position:"absolute",left:Ve,top:0});var Dt={prefixCls:z,responsive:ne,component:S,invalidate:pe},St=a?function(at,ut){var ht=fe(at,ut);return C.createElement(rA.Provider,{key:ht,value:te(te({},Dt),{},{order:ut,item:at,itemKey:ht,registerSize:Me,display:ut<=We})},a(at,ut))}:function(at,ut){var ht=fe(at,ut);return C.createElement(kE,It({},Dt,{order:ut,key:ht,item:at,renderItem:Ie,itemKey:ht,registerSize:Me,display:ut<=We}))},Kt,_n={order:Ue?We:Number.MAX_SAFE_INTEGER,className:"".concat(z,"-rest"),registerSize:bt,display:Ue};if(m)m&&(Kt=C.createElement(rA.Provider,{value:te(te({},Dt),_n)},m(ce)));else{var zt=p||WHe;Kt=C.createElement(kE,It({},Dt,_n),typeof zt=="function"?zt(ce):zt)}var Yt=C.createElement(y,It({className:De(!pe&&n,f),style:h,ref:e},E),oe.map(St),ke?Kt:null,v&&C.createElement(kE,It({},Dt,{responsive:se,responsiveDisabled:!ne,order:We,className:"".concat(z,"-suffix"),registerSize:rt,display:!0,style:Ct}),v));return se&&(Yt=C.createElement(Lh,{onResize:He,disabled:!ne},Yt)),Yt}var Nf=C.forwardRef($He);Nf.displayName="Overflow";Nf.Item=N_e;Nf.RESPONSIVE=R_e;Nf.INVALIDATE=M_e;var oA=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,o=e.onMouseDown,s=e.onClick,a=e.children,l;return typeof n=="function"?l=n(r):l=n,C.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),o&&o(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},l!==void 0?l:C.createElement("span",{className:De(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},a))},HHe=function(e,t){var n,r,o=e.prefixCls,s=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,u=e.autoFocus,d=e.autoComplete,h=e.editable,f=e.activeDescendantId,g=e.value,p=e.maxLength,m=e.onKeyDown,v=e.onMouseDown,_=e.onChange,y=e.onPaste,S=e.onCompositionStart,L=e.onCompositionEnd,E=e.open,D=e.attrs,k=a||C.createElement("input",null),T=k,M=T.ref,P=T.props,N=P.onKeyDown,R=P.onChange,O=P.onMouseDown,B=P.onCompositionStart,$=P.onCompositionEnd,G=P.style;return"maxLength"in k.props,k=C.cloneElement(k,te(te(te({type:"search"},P),{},{id:s,ref:pu(t,M),disabled:l,tabIndex:c,autoComplete:d||"off",autoFocus:u,className:De("".concat(o,"-selection-search-input"),(n=k)===null||n===void 0||(r=n.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":f},D),{},{value:h?g:"",maxLength:p,readOnly:!h,unselectable:h?null:"on",style:te(te({},G),{},{opacity:h?null:0}),onKeyDown:function(j){m(j),N&&N(j)},onMouseDown:function(j){v(j),O&&O(j)},onChange:function(j){_(j),R&&R(j)},onCompositionStart:function(j){S(j),B&&B(j)},onCompositionEnd:function(j){L(j),$&&$(j)},onPaste:y})),k},Yq=C.forwardRef(HHe);Yq.displayName="Input";function P_e(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var VHe=typeof window<"u"&&window.document&&window.document.documentElement,zHe=VHe;function UHe(i){return i!=null}function Lre(i){return["string","number"].includes(Un(i))}function A_e(i){var e=void 0;return i&&(Lre(i.title)?e=i.title.toString():Lre(i.label)&&(e=i.label.toString())),e}function jHe(i,e){zHe?C.useLayoutEffect(i,e):C.useEffect(i,e)}function KHe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Ere=function(e){e.preventDefault(),e.stopPropagation()},GHe=function(e){var t=e.id,n=e.prefixCls,r=e.values,o=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,m=e.tabIndex,v=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,S=e.maxTagPlaceholder,L=S===void 0?function(Le){return"+ ".concat(Le.length," ...")}:S,E=e.tagRender,D=e.onToggleOpen,k=e.onRemove,T=e.onInputChange,M=e.onInputPaste,P=e.onInputKeyDown,N=e.onInputMouseDown,R=e.onInputCompositionStart,O=e.onInputCompositionEnd,B=C.useRef(null),$=C.useState(0),G=$e($,2),U=G[0],j=G[1],ie=C.useState(!1),Y=$e(ie,2),J=Y[0],Q=Y[1],he="".concat(n,"-selection"),ge=o||d==="multiple"&&a===!1||d==="tags"?s:"",ye=d==="tags"||d==="multiple"&&a===!1||h&&(o||J);jHe(function(){j(B.current.scrollWidth)},[ge]);function be(Le,Pe,Be,Qe,Ye){return C.createElement("span",{className:De("".concat(he,"-item"),we({},"".concat(he,"-item-disabled"),Be)),title:A_e(Le)},C.createElement("span",{className:"".concat(he,"-item-content")},Pe),Qe&&C.createElement(oA,{className:"".concat(he,"-item-remove"),onMouseDown:Ere,onClick:Ye,customizeIcon:v},"×"))}function Ge(Le,Pe,Be,Qe,Ye){var We=function(re){Ere(re),D(!o)};return C.createElement("span",{onMouseDown:We},E({label:Pe,value:Le,disabled:Be,closable:Qe,onClose:Ye}))}function nt(Le){var Pe=Le.disabled,Be=Le.label,Qe=Le.value,Ye=!u&&!Pe,We=Be;if(typeof y=="number"&&(typeof Be=="string"||typeof Be=="number")){var dt=String(We);dt.length>y&&(We="".concat(dt.slice(0,y),"..."))}var re=function(de){de&&de.stopPropagation(),k(Le)};return typeof E=="function"?Ge(Qe,We,Pe,Ye,re):be(Le,We,Pe,Ye,re)}function je(Le){var Pe=typeof L=="function"?L(Le):L;return be({title:Pe},Pe,!1)}var _e=C.createElement("div",{className:"".concat(he,"-search"),style:{width:U},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},C.createElement(Yq,{ref:l,open:o,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:ye,activeDescendantId:p,value:ge,onKeyDown:P,onMouseDown:N,onChange:T,onPaste:M,onCompositionStart:R,onCompositionEnd:O,tabIndex:m,attrs:Mp(e,!0)}),C.createElement("span",{ref:B,className:"".concat(he,"-search-mirror"),"aria-hidden":!0},ge," ")),Ve=C.createElement(Nf,{prefixCls:"".concat(he,"-overflow"),data:r,renderItem:nt,renderRest:je,suffix:_e,itemKey:KHe,maxCount:_});return C.createElement(C.Fragment,null,Ve,!r.length&&!ge&&C.createElement("span",{className:"".concat(he,"-placeholder")},c))},qHe=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,m=e.searchValue,v=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,S=e.onInputMouseDown,L=e.onInputChange,E=e.onInputPaste,D=e.onInputCompositionStart,k=e.onInputCompositionEnd,T=e.title,M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=u==="combobox",B=O||p,$=h[0],G=m||"";O&&v&&!N&&(G=v),C.useEffect(function(){O&&R(!1)},[O,v]);var U=u!=="combobox"&&!d&&!p?!1:!!G,j=T===void 0?A_e($):T,ie=function(){if($)return null;var J=U?{visibility:"hidden"}:void 0;return C.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:J},f)};return C.createElement(C.Fragment,null,C.createElement("span",{className:"".concat(n,"-selection-search")},C.createElement(Yq,{ref:o,prefixCls:n,id:r,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:B,activeDescendantId:c,value:G,onKeyDown:y,onMouseDown:S,onChange:function(J){R(!0),L(J)},onPaste:E,onCompositionStart:D,onCompositionEnd:k,tabIndex:g,attrs:Mp(e,!0),maxLength:O?_:void 0})),!O&&$?C.createElement("span",{className:"".concat(n,"-selection-item"),title:j,style:U?{visibility:"hidden"}:void 0},$.label):null,ie())};function XHe(i){return![_t.ESC,_t.SHIFT,_t.BACKSPACE,_t.TAB,_t.WIN_KEY,_t.ALT,_t.META,_t.WIN_KEY_RIGHT,_t.CTRL,_t.SEMICOLON,_t.EQUALS,_t.CAPS_LOCK,_t.CONTEXT_MENU,_t.F1,_t.F2,_t.F3,_t.F4,_t.F5,_t.F6,_t.F7,_t.F8,_t.F9,_t.F10,_t.F11,_t.F12].includes(i)}var YHe=function(e,t){var n=C.useRef(null),r=C.useRef(!1),o=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;C.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var m=T_e(0),v=$e(m,2),_=v[0],y=v[1],S=function(G){var U=G.which;(U===_t.UP||U===_t.DOWN)&&G.preventDefault(),g&&g(G),U===_t.ENTER&&a==="tags"&&!r.current&&!s&&(h==null||h(G.target.value)),XHe(U)&&f(!0)},L=function(){y(!0)},E=C.useRef(null),D=function(G){d(G,!0,r.current)!==!1&&f(!0)},k=function(){r.current=!0},T=function(G){r.current=!1,a!=="combobox"&&D(G.target.value)},M=function(G){var U=G.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var j=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(j,E.current)}E.current=null,D(U)},P=function(G){var U=G.clipboardData,j=U.getData("text");E.current=j},N=function(G){var U=G.target;if(U!==n.current){var j=document.body.style.msTouchAction!==void 0;j?setTimeout(function(){n.current.focus()}):n.current.focus()}},R=function(G){var U=_();G.target!==n.current&&!U&&a!=="combobox"&&G.preventDefault(),(a!=="combobox"&&(!l||!U)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},O={inputRef:n,onInputKeyDown:S,onInputMouseDown:L,onInputChange:M,onInputPaste:P,onInputCompositionStart:k,onInputCompositionEnd:T},B=a==="multiple"||a==="tags"?C.createElement(GHe,It({},e,O)):C.createElement(qHe,It({},e,O));return C.createElement("div",{ref:p,className:"".concat(o,"-selector"),onClick:N,onMouseDown:R},B)},O_e=C.forwardRef(YHe);O_e.displayName="Selector";var Dre=C.createContext(null);function Ire(i){return i?Array.isArray(i)?i:[i]:[]}function ZHe(i,e,t,n){return C.useMemo(function(){var r=Ire(t??e),o=Ire(n??e),s=new Set(r),a=new Set(o);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function QHe(){var i=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?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function JHe(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function n1(i,e){var t=e[0],n=e[1],r,o;return t==="t"?o=i.y:t==="b"?o=i.y+i.height:o=i.y+i.height/2,n==="l"?r=i.x:n==="r"?r=i.x+i.width:r=i.x+i.width/2,{x:r,y:o}}function cm(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,r){return r===e?t[n]||"c":n}).join("")}function tVe(i,e,t,n,r,o,s){var a=C.useState({ready:!1,offsetX:0,offsetY:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[n]||{}}),l=$e(a,2),c=l[0],u=l[1],d=C.useRef(0),h=C.useMemo(function(){return e?hH(e):[]},[e]),f=C.useRef({}),g=function(){f.current={}};i||g();var p=rc(function(){if(e&&t&&i){let Uo=function(Fa,Ba){var Vl=M.x+Fa,fl=M.y+Ba,zl=Vl+J,yu=fl+Y,wu=Math.max(Vl,ge.left),Ic=Math.max(fl,ge.top),Wa=Math.min(zl,ge.right),$a=Math.min(yu,ge.bottom);return Math.max(0,(Wa-wu)*($a-Ic))},wo=function(){_n=M.y+Ie,zt=_n+Y,Yt=M.x+fe,at=Yt+J};var _=e,y=_.style.left,S=_.style.top,L=_.ownerDocument,E=Zk(_),D=te(te({},r[n]),o);_.style.left="0",_.style.top="0";var k;if(Array.isArray(t))k={x:t[0],y:t[1],width:0,height:0};else{var T=t.getBoundingClientRect();k={x:T.x,y:T.y,width:T.width,height:T.height}}var M=_.getBoundingClientRect(),P=E.getComputedStyle(_),N=P.width,R=P.height,O=L.documentElement,B=O.clientWidth,$=O.clientHeight,G=O.scrollWidth,U=O.scrollHeight,j=O.scrollTop,ie=O.scrollLeft,Y=M.height,J=M.width,Q=k.height,he=k.width,ge=D.htmlRegion==="scroll"?{left:-ie,top:-j,right:G-ie,bottom:U-j}:{left:0,top:0,right:B,bottom:$};ge=eVe(ge,h),_.style.left=y,_.style.top=S;var ye=sA(Math.round(J/parseFloat(N)*1e3)/1e3),be=sA(Math.round(Y/parseFloat(R)*1e3)/1e3);if(ye===0||be===0||KP(t)&&!qk(t))return;var Ge=D.offset,nt=D.targetOffset,je=Ge||[],_e=$e(je,2),Ve=_e[0],Le=Ve===void 0?0:Ve,Pe=_e[1],Be=Pe===void 0?0:Pe,Qe=nt||[],Ye=$e(Qe,2),We=Ye[0],dt=We===void 0?0:We,re=Ye[1],ue=re===void 0?0:re;k.x+=dt,k.y+=ue;var de=D.points||[],z=$e(de,2),q=z[0],se=z[1],ne=Tre(se),pe=Tre(q),ke=n1(k,ne),oe=n1(M,pe),ce=te({},D),fe=ke.x-oe.x+Le,Ie=ke.y-oe.y+Be,Te=Uo(fe,Ie),He=n1(k,["t","l"]),Me=n1(M,["t","l"]),bt=n1(k,["b","r"]),rt=n1(M,["b","r"]),Ht=D.overflow||{},Ue=Ht.adjustX,Ct=Ht.adjustY,Dt=Ht.shiftX,St=Ht.shiftY,Kt=function(Ba){return typeof Ba=="boolean"?Ba:Ba>=0},_n,zt,Yt,at;wo();var ut=Kt(Ct),ht=pe[0]===ne[0];if(ut&&pe[0]==="t"&&(zt>ge.bottom||f.current.bt)){var Lt=Ie;ht?Lt-=Y-Q:Lt=He.y-rt.y-Be,Uo(fe,Lt)>=Te?(f.current.bt=!0,Ie=Lt,ce.points=[cm(pe,0),cm(ne,0)]):f.current.bt=!1}if(ut&&pe[0]==="b"&&(_n=Te?(f.current.tb=!0,Ie=At,ce.points=[cm(pe,0),cm(ne,0)]):f.current.tb=!1}var ln=Kt(Ue),Si=pe[1]===ne[1];if(ln&&pe[1]==="l"&&(at>ge.right||f.current.rl)){var Xi=fe;Si?Xi-=J-he:Xi=He.x-rt.x-Le,Uo(Xi,Ie)>=Te?(f.current.rl=!0,fe=Xi,ce.points=[cm(pe,1),cm(ne,1)]):f.current.rl=!1}if(ln&&pe[1]==="r"&&(Yt=Te?(f.current.lr=!0,fe=Ir,ce.points=[cm(pe,1),cm(ne,1)]):f.current.lr=!1}wo();var En=Dt===!0?0:Dt;typeof En=="number"&&(Ytge.right&&(fe-=at-ge.right,k.x>ge.right-En&&(fe+=k.x-ge.right+En)));var fi=St===!0?0:St;typeof fi=="number"&&(_nge.bottom&&(Ie-=zt-ge.bottom,k.y>ge.bottom-fi&&(Ie+=k.y-ge.bottom+fi)));var Ur=M.x+fe,go=Ur+J,ys=M.y+Ie,ws=ys+Y,Ut=k.x,Ee=Ut+he,wt=k.y,kt=wt+Q,qn=Math.max(Ur,Ut),dr=Math.min(go,Ee),jr=(qn+dr)/2,ei=jr-Ur,to=Math.max(ys,wt),$s=Math.min(ws,kt),Hl=(to+$s)/2,Oa=Hl-ys;s==null||s(e,ce),u({ready:!0,offsetX:fe/ye,offsetY:Ie/be,arrowX:ei/ye,arrowY:Oa/be,scaleX:ye,scaleY:be,align:ce})}}),m=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&p()})},v=function(){u(function(y){return te(te({},y),{},{ready:!1})})};return Cr(v,[n]),Cr(function(){i||v()},[i]),[c.ready,c.offsetX,c.offsetY,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,m]}function nVe(i,e,t,n){Cr(function(){if(i&&e&&t){let u=function(){n()};var r=e,o=t,s=hH(r),a=hH(o),l=Zk(o),c=new Set([l].concat(gt(s),gt(a)));return c.forEach(function(d){d.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),n(),function(){c.forEach(function(d){d.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[i,e,t])}function iVe(i){var e=i.prefixCls,t=i.align,n=i.arrowX,r=n===void 0?0:n,o=i.arrowY,s=o===void 0?0:o,a=C.useRef();if(!t||!t.points)return null;var l={position:"absolute"};if(t.autoArrow!==!1){var c=t.points[0],u=t.points[1],d=c[0],h=c[1],f=u[0],g=u[1];d===f||!["t","b"].includes(d)?l.top=s:d==="t"?l.top=0:l.bottom=0,h===g||!["l","r"].includes(h)?l.left=r:h==="l"?l.left=0:l.right=0}return C.createElement("div",{ref:a,className:"".concat(e,"-arrow"),style:l})}function rVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,r=i.mask,o=i.motion;return r?React.createElement(hd,It({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return React.createElement("div",{style:{zIndex:n},className:De("".concat(e,"-mask"),a)})}):null}var oVe=C.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),sVe=C.forwardRef(function(i,e){var t=i.popup,n=i.className,r=i.prefixCls,o=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.onClick,d=i.mask,h=i.arrow,f=i.align,g=i.arrowX,p=i.arrowY,m=i.motion,v=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,S=i.autoDestroy,L=i.portal,E=i.zIndex,D=i.onMouseEnter,k=i.onMouseLeave,T=i.ready,M=i.offsetX,P=i.offsetY,N=i.onAlign,R=i.onPrepare,O=i.stretch,B=i.targetWidth,$=i.targetHeight,G=typeof t=="function"?t():t,U=l||c,j=(y==null?void 0:y.length)>0,ie=C.useState(!y||!j),Y=$e(ie,2),J=Y[0],Q=Y[1];if(Cr(function(){!J&&j&&s&&Q(!0)},[J,j,s]),!J)return null;var he=T||!l?{left:M,top:P}:{left:"-1000vw",top:"-1000vh"},ge={};return O&&(O.includes("height")&&$?ge.height=$:O.includes("minHeight")&&$&&(ge.minHeight=$),O.includes("width")&&B?ge.width=B:O.includes("minWidth")&&B&&(ge.minWidth=B)),l||(ge.pointerEvents="none"),C.createElement(L,{open:_||U,getContainer:y&&function(){return y(s)},autoDestroy:S},C.createElement(rVe,{prefixCls:r,open:l,zIndex:E,mask:d,motion:v}),C.createElement(Lh,{onResize:N,disabled:!l},function(ye){return C.createElement(hd,It({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(r,"-hidden")},m,{onAppearPrepare:R,onEnterPrepare:R,visible:l,onVisibleChanged:function(Ge){var nt;m==null||(nt=m.onVisibleChanged)===null||nt===void 0||nt.call(m,Ge),a(Ge)}}),function(be,Ge){var nt=be.className,je=be.style,_e=De(r,nt,n);return C.createElement("div",{ref:pu(ye,e,Ge),className:_e,style:te(te(te(te({},he),ge),je),{},{boxSizing:"border-box",zIndex:E},o),onMouseEnter:D,onMouseLeave:k,onClick:u},h&&C.createElement(iVe,{prefixCls:r,align:f,arrowX:g,arrowY:p}),C.createElement(oVe,{cache:!l},G))})}))}),aVe=C.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,r=D_(t),o=C.useCallback(function(a){OD(e,n?n(a):a)},[n]),s=y4(o,t.ref);return r?C.cloneElement(t,{ref:s}):t}),lVe=["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","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function cVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jq,e=C.forwardRef(function(t,n){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,m=t.mouseLeaveDelay,v=m===void 0?.1:m,_=t.focusDelay,y=t.blurDelay,S=t.mask,L=t.maskClosable,E=L===void 0?!0:L,D=t.getPopupContainer,k=t.forceRender,T=t.autoDestroy,M=t.destroyPopupOnHide,P=t.popup,N=t.popupClassName,R=t.popupStyle,O=t.popupPlacement,B=t.builtinPlacements,$=B===void 0?{}:B,G=t.popupAlign,U=t.zIndex,j=t.stretch,ie=t.getPopupClassNameFromAlign,Y=t.alignPoint,J=t.onPopupClick,Q=t.onPopupAlign,he=t.arrow,ge=t.popupMotion,ye=t.maskMotion,be=t.popupTransitionName,Ge=t.popupAnimation,nt=t.maskTransitionName,je=t.maskAnimation,_e=t.className,Ve=t.getTriggerDOMNode,Le=Mn(t,lVe),Pe=T||M||!1,Be=C.useState(!1),Qe=$e(Be,2),Ye=Qe[0],We=Qe[1];Cr(function(){We(M4())},[]);var dt=C.useRef({}),re=C.useContext(Dre),ue=C.useMemo(function(){return{registerSubPopup:function(Zn,nr){dt.current[Zn]=nr,re==null||re.registerSubPopup(Zn,nr)}}},[re]),de=u_e(),z=C.useState(null),q=$e(z,2),se=q[0],ne=q[1],pe=rc(function(pn){KP(pn)&&se!==pn&&ne(pn),re==null||re.registerSubPopup(de,pn)}),ke=C.useState(null),oe=$e(ke,2),ce=oe[0],fe=oe[1],Ie=rc(function(pn){KP(pn)&&ce!==pn&&fe(pn)}),Te=C.Children.only(s),He=(Te==null?void 0:Te.props)||{},Me={},bt=rc(function(pn){var Zn,nr,Fr=ce;return(Fr==null?void 0:Fr.contains(pn))||(Fr==null||(Zn=Fr.getRootNode())===null||Zn===void 0?void 0:Zn.host)===pn||pn===Fr||(se==null?void 0:se.contains(pn))||(se==null||(nr=se.getRootNode())===null||nr===void 0?void 0:nr.host)===pn||pn===se||Object.values(dt.current).some(function(Kr){return(Kr==null?void 0:Kr.contains(pn))||pn===Kr})}),rt=kre(o,ge,Ge,be),Ht=kre(o,ye,je,nt),Ue=C.useState(h||!1),Ct=$e(Ue,2),Dt=Ct[0],St=Ct[1],Kt=d??Dt,_n=rc(function(pn){d===void 0&&St(pn)});Cr(function(){St(d||!1)},[d]);var zt=C.useRef(Kt);zt.current=Kt;var Yt=rc(function(pn){Kt!==pn&&(_n(pn),f==null||f(pn))}),at=C.useRef(),ut=function(){clearTimeout(at.current)},ht=function(Zn){var nr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),nr===0?Yt(Zn):at.current=setTimeout(function(){Yt(Zn)},nr*1e3)};C.useEffect(function(){return ut},[]);var Lt=C.useState(!1),At=$e(Lt,2),ln=At[0],Si=At[1],Xi=C.useRef(!0);Cr(function(){(!Xi.current||Kt)&&Si(!0),Xi.current=!0},[Kt]);var Ir=C.useState(null),En=$e(Ir,2),fi=En[0],Ur=En[1],go=C.useState([0,0]),ys=$e(go,2),ws=ys[0],Ut=ys[1],Ee=function(Zn){Ut([Zn.clientX,Zn.clientY])},wt=tVe(Kt,se,Y?ws:ce,O,$,G,Q),kt=$e(wt,9),qn=kt[0],dr=kt[1],jr=kt[2],ei=kt[3],to=kt[4],$s=kt[5],Hl=kt[6],Oa=kt[7],Uo=kt[8],wo=rc(function(){ln||Uo()});nVe(Kt,ce,se,wo),Cr(function(){wo()},[ws]),Cr(function(){Kt&&!($!=null&&$[O])&&wo()},[JSON.stringify(G)]);var Fa=C.useMemo(function(){var pn=JHe($,o,Oa,Y);return De(pn,ie==null?void 0:ie(Oa))},[Oa,ie,$,o,Y]);C.useImperativeHandle(n,function(){return{forceAlign:wo}});var Ba=function(Zn){Si(!1),Uo(),g==null||g(Zn)},Vl=function(){return new Promise(function(Zn){Ur(function(){return Zn})})};Cr(function(){fi&&(Uo(),fi(),Ur(null))},[fi]);var fl=C.useState(0),zl=$e(fl,2),yu=zl[0],wu=zl[1],Ic=C.useState(0),Wa=$e(Ic,2),$a=Wa[0],Qt=Wa[1],$t=function(Zn,nr){if(wo(),j){var Fr=nr.getBoundingClientRect();wu(Fr.width),Qt(Fr.height)}},On=ZHe(Ye,l,c,u),Jt=$e(On,2),Zt=Jt[0],oi=Jt[1],Wi=function(Zn,nr,Fr,Kr){Me[Zn]=function(AC){var lg;Kr==null||Kr(AC),ht(nr,Fr);for(var px=arguments.length,iN=new Array(px>1?px-1:0),OC=1;OC1?nr-1:0),Kr=1;Kr1?nr-1:0),Kr=1;Kr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,r=[],o=W_e(t,!1),s=o.label,a=o.value,l=o.options;function c(u,d){u.forEach(function(h){var f=h[s];if(d||!(l in h)){var g=h[a];r.push({key:Nre(h,r.length),groupOption:d,data:h,label:f,value:g})}else{var p=f;p===void 0&&n&&(p=h.label),r.push({key:Nre(h,r.length),group:!0,data:h,label:p}),c(h[l],!0)}})}return c(i,!1),r}function fH(i){var e=te({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return uo(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}function gVe(i,e){if(!e||!e.length)return null;var t=!1;function n(o,s){var a=yve(s),l=a[0],c=a.slice(1);if(!l)return[o];var u=o.split(l);return t=t||u.length>1,u.reduce(function(d,h){return[].concat(gt(d),gt(n(h,c)))},[]).filter(function(d){return d})}var r=n(i,e);return t?r:null}var pVe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],mVe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function gH(i){return i==="tags"||i==="multiple"}var vVe=C.forwardRef(function(i,e){var t,n,r=i.id,o=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,m=i.onClear,v=i.mode,_=i.disabled,y=i.loading,S=i.getInputElement,L=i.getRawInputElement,E=i.open,D=i.defaultOpen,k=i.onDropdownVisibleChange,T=i.activeValue,M=i.onActiveValueChange,P=i.activeDescendantId,N=i.searchValue,R=i.autoClearSearchValue,O=i.onSearch,B=i.onSearchSplit,$=i.tokenSeparators,G=i.allowClear,U=i.showArrow,j=i.inputIcon,ie=i.clearIcon,Y=i.OptionList,J=i.animation,Q=i.transitionName,he=i.dropdownStyle,ge=i.dropdownClassName,ye=i.dropdownMatchSelectWidth,be=i.dropdownRender,Ge=i.dropdownAlign,nt=i.placement,je=i.builtinPlacements,_e=i.getPopupContainer,Ve=i.showAction,Le=Ve===void 0?[]:Ve,Pe=i.onFocus,Be=i.onBlur,Qe=i.onKeyUp,Ye=i.onKeyDown,We=i.onMouseDown,dt=Mn(i,pVe),re=gH(v),ue=(a!==void 0?a:re)||v==="combobox",de=te({},dt);mVe.forEach(function(Qt){delete de[Qt]}),u==null||u.forEach(function(Qt){delete de[Qt]});var z=C.useState(!1),q=$e(z,2),se=q[0],ne=q[1];C.useEffect(function(){ne(M4())},[]);var pe=C.useRef(null),ke=C.useRef(null),oe=C.useRef(null),ce=C.useRef(null),fe=C.useRef(null),Ie=IHe(),Te=$e(Ie,3),He=Te[0],Me=Te[1],bt=Te[2];C.useImperativeHandle(e,function(){var Qt,$t;return{focus:(Qt=ce.current)===null||Qt===void 0?void 0:Qt.focus,blur:($t=ce.current)===null||$t===void 0?void 0:$t.blur,scrollTo:function(Jt){var Zt;return(Zt=fe.current)===null||Zt===void 0?void 0:Zt.scrollTo(Jt)}}});var rt=C.useMemo(function(){var Qt;if(v!=="combobox")return N;var $t=(Qt=d[0])===null||Qt===void 0?void 0:Qt.value;return typeof $t=="string"||typeof $t=="number"?String($t):""},[N,v,d]),Ht=v==="combobox"&&typeof S=="function"&&S()||null,Ue=typeof L=="function"&&L(),Ct=y4(ke,Ue==null||(t=Ue.props)===null||t===void 0?void 0:t.ref),Dt=C.useState(!1),St=$e(Dt,2),Kt=St[0],_n=St[1];Cr(function(){_n(!0)},[]);var zt=nl(!1,{defaultValue:D,value:E}),Yt=$e(zt,2),at=Yt[0],ut=Yt[1],ht=Kt?at:!1,Lt=!p&&f;(_||Lt&&ht&&v==="combobox")&&(ht=!1);var At=Lt?!1:ht,ln=C.useCallback(function(Qt){var $t=Qt!==void 0?Qt:!ht;_||(ut($t),ht!==$t&&(k==null||k($t)))},[_,ht,ut,k]),Si=C.useMemo(function(){return($||[]).some(function(Qt){return[` `,`\r -`].includes(Qt)})},[$]),Xi=function($t,On,Jt){var Zt=!0,oi=$t;M==null||M(null);var Wi=Jt?null:gVe($t,$);return v!=="combobox"&&Wi&&(oi="",B==null||B(Wi),ln(!1),Zt=!1),O&&rt!==oi&&O(oi,{source:On?"typing":"effect"}),Zt},Ir=function($t){!$t||!$t.trim()||O($t,{source:"submit"})};C.useEffect(function(){!ht&&!re&&v!=="combobox"&&Xi("",!1,!1)},[ht]),C.useEffect(function(){at&&_&&ut(!1),_&&Me(!1)},[_]);var En=T_e(),fi=$e(En,2),Ur=fi[0],go=fi[1],ys=function($t){var On=Ur(),Jt=$t.which;if(Jt===_t.ENTER&&(v!=="combobox"&&$t.preventDefault(),ht||ln(!0)),go(!!rt),Jt===_t.BACKSPACE&&!On&&re&&!rt&&d.length){for(var Zt=gt(d),oi=null,Wi=Zt.length-1;Wi>=0;Wi-=1){var So=Zt[Wi];if(!So.disabled){Zt.splice(Wi,1),oi=So;break}}oi&&h(Zt,{type:"remove",values:[oi]})}for(var Hs=arguments.length,gl=new Array(Hs>1?Hs-1:0),Vs=1;Vs1?On-1:0),Zt=1;Zt1?Wi-1:0),Hs=1;Hs1&&arguments[1]!==void 0?arguments[1]:!1;return od(i).map(function(t,n){if(!C.isValidElement(t)||!t.type)return null;var r=t,o=r.type.isSelectOptGroup,s=r.key,a=r.props,l=a.children,c=Mn(a,xVe);return e||!o?LVe(t):te(te({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:$_e(l)})}).filter(function(t){return t})}function EVe(i,e,t,n,r){return C.useMemo(function(){var o=i,s=!i;s&&(o=$_e(e));var a=new Map,l=new Map,c=function(h,f,g){g&&typeof g=="string"&&h.set(f[g],f)};function u(d){for(var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=0;fl},n}return Cs(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(r){r.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var r=this.state,o=r.dragging,s=r.visible,a=this.props.prefixCls,l=this.getSpinHeight(),c=this.getTop(),u=this.showScroll(),d=u&&s;return C.createElement("div",{ref:this.scrollbarRef,className:De("".concat(a,"-scrollbar"),we({},"".concat(a,"-scrollbar-show"),u)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:d?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},C.createElement("div",{ref:this.thumbRef,className:De("".concat(a,"-scrollbar-thumb"),we({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:l,top:c,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(C.Component);function kVe(i){var e=i.children,t=i.setRef,n=C.useCallback(function(r){t(r)},[]);return C.cloneElement(e,{ref:n})}function TVe(i,e,t,n,r,o){var s=o.getKey;return i.slice(e,t+1).map(function(a,l){var c=e+l,u=r(a,c,{}),d=s(a);return C.createElement(kVe,{key:d,setRef:function(f){return n(a,f)}},u)})}var NVe=function(){function i(){bs(this,i),this.maps=void 0,this.maps=Object.create(null)}return Cs(i,[{key:"set",value:function(t,n){this.maps[t]=n}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function RVe(i,e,t){var n=C.useState(0),r=$e(n,2),o=r[0],s=r[1],a=C.useRef(new Map),l=C.useRef(new NVe),c=C.useRef();function u(){er.cancel(c.current)}function d(){u(),c.current=er(function(){a.current.forEach(function(f,g){if(f&&f.offsetParent){var p=FD(f),m=p.offsetHeight;l.current.get(g)!==m&&l.current.set(g,p.offsetHeight)}}),s(function(f){return f+1})})}function h(f,g){var p=i(f),m=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!m!=!g&&(g?e==null||e(f):t==null||t(f))}return C.useEffect(function(){return u},[]),[h,d,l.current,o]}function MVe(i,e,t,n,r,o,s,a){var l=C.useRef();return function(c){if(c==null){a();return}if(er.cancel(l.current),typeof c=="number")s(c);else if(c&&Un(c)==="object"){var u,d=c.align;"index"in c?u=c.index:u=e.findIndex(function(p){return r(p)===c.key});var h=c.offset,f=h===void 0?0:h,g=function p(m,v){if(!(m<0||!i.current)){var _=i.current.clientHeight,y=!1,S=v;if(_){for(var L=v||d,E=0,D=0,k=0,T=Math.min(e.length,u),M=0;M<=T;M+=1){var P=r(e[M]);D=E;var N=t.get(P);k=D+(N===void 0?n:N),E=k,M===u&&N===void 0&&(y=!0)}var R=null;switch(L){case"top":R=D-f;break;case"bottom":R=k-_+f;break;default:{var O=i.current.scrollTop,B=O+_;DB&&(S="bottom")}}R!==null&&R!==i.current.scrollTop&&s(R)}l.current=er(function(){y&&o(),p(m-1,S)},2)}};g(3)}}}function PVe(i,e,t){var n=i.length,r=e.length,o,s;if(n===0&&r===0)return null;n"u"?"undefined":Un(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const V_e=function(i,e){var t=C.useRef(!1),n=C.useRef(null);function r(){clearTimeout(n.current),t.current=!0,n.current=setTimeout(function(){t.current=!1},50)}var o=C.useRef({top:i,bottom:e});return o.current.top=i,o.current.bottom=e,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&o.current.top||s>0&&o.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&r(),!t.current&&l}};function FVe(i,e,t,n){var r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a=C.useRef(!1),l=V_e(e,t);function c(d){if(i){er.cancel(o.current);var h=d.deltaY;r.current+=h,s.current=h,!l(h)&&(OVe||d.preventDefault(),o.current=er(function(){var f=a.current?10:1;n(r.current*f),r.current=0}))}}function u(d){i&&(a.current=d.detail===s.current)}return[c,u]}var BVe=14/15;function WVe(i,e,t){var n=C.useRef(!1),r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=r.current-f;r.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=BVe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,r.current=Math.ceil(h.touches[0].pageY),o.current=h.target,o.current.addEventListener("touchmove",l),o.current.addEventListener("touchend",c))};a=function(){o.current&&(o.current.removeEventListener("touchmove",l),o.current.removeEventListener("touchend",c))},Cr(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var $Ve=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],HVe=[],VVe={overflowY:"auto",overflowAnchor:"none"};function zVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-virtual-list":t,r=i.className,o=i.height,s=i.itemHeight,a=i.fullHeight,l=a===void 0?!0:a,c=i.style,u=i.data,d=i.children,h=i.itemKey,f=i.virtual,g=i.component,p=g===void 0?"div":g,m=i.onScroll,v=i.onVisibleChange,_=i.innerProps,y=Mn(i,$Ve),S=!!(f!==!1&&o&&s),L=S&&u&&s*u.length>o,E=C.useState(0),D=$e(E,2),k=D[0],T=D[1],M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=De(n,r),B=u||HVe,$=C.useRef(),G=C.useRef(),U=C.useRef(),j=C.useCallback(function(Te){return typeof h=="function"?h(Te):Te==null?void 0:Te[h]},[h]),ie={getKey:j};function Y(Te){T(function(He){var Me;typeof Te=="function"?Me=Te(He):Me=Te;var bt=re(Me);return $.current.scrollTop=bt,bt})}var J=C.useRef({start:0,end:B.length}),Q=C.useRef(),he=AVe(B,j),ge=$e(he,1),ye=ge[0];Q.current=ye;var be=RVe(j,null,null),Ge=$e(be,4),nt=Ge[0],je=Ge[1],_e=Ge[2],Ve=Ge[3],Le=C.useMemo(function(){if(!S)return{scrollHeight:void 0,start:0,end:B.length-1,offset:void 0};if(!L){var Te;return{scrollHeight:((Te=G.current)===null||Te===void 0?void 0:Te.offsetHeight)||0,start:0,end:B.length-1,offset:void 0}}for(var He=0,Me,bt,rt,Ht=B.length,Ue=0;Ue=k&&Me===void 0&&(Me=Ue,bt=He),Kt>k+o&&rt===void 0&&(rt=Ue),He=Kt}return Me===void 0&&(Me=0,bt=0,rt=Math.ceil(o/s)),rt===void 0&&(rt=B.length-1),rt=Math.min(rt+1,B.length),{scrollHeight:He,start:Me,end:rt,offset:bt}},[L,S,k,B,Ve,o]),Pe=Le.scrollHeight,Be=Le.start,Qe=Le.end,Ye=Le.offset;J.current.start=Be,J.current.end=Qe;var We=Pe-o,dt=C.useRef(We);dt.current=We;function re(Te){var He=Te;return Number.isNaN(dt.current)||(He=Math.min(He,dt.current)),He=Math.max(He,0),He}var ue=k<=0,de=k>=We,z=V_e(ue,de);function q(Te){var He=Te;Y(He)}function se(Te){var He=Te.currentTarget.scrollTop;He!==k&&Y(He),m==null||m(Te)}var ne=FVe(S,ue,de,function(Te){Y(function(He){var Me=He+Te;return Me})}),pe=$e(ne,2),ke=pe[0],oe=pe[1];WVe(S,$,function(Te,He){return z(Te,He)?!1:(ke({preventDefault:function(){},deltaY:Te}),!0)}),Cr(function(){function Te(He){S&&He.preventDefault()}return $.current.addEventListener("wheel",ke),$.current.addEventListener("DOMMouseScroll",oe),$.current.addEventListener("MozMousePixelScroll",Te),function(){$.current&&($.current.removeEventListener("wheel",ke),$.current.removeEventListener("DOMMouseScroll",oe),$.current.removeEventListener("MozMousePixelScroll",Te))}},[S]);var ce=MVe($,B,_e,s,j,je,Y,function(){var Te;(Te=U.current)===null||Te===void 0||Te.delayHidden()});C.useImperativeHandle(e,function(){return{scrollTo:ce}}),Cr(function(){if(v){var Te=B.slice(Be,Qe+1);v(Te,B)}},[Be,Qe,B]);var fe=TVe(B,Be,Qe,nt,d,ie),Ie=null;return o&&(Ie=te(we({},l?"height":"maxHeight",o),VVe),S&&(Ie.overflowY="hidden",N&&(Ie.pointerEvents="none"))),C.createElement("div",It({style:te(te({},c),{},{position:"relative"}),className:O},y),C.createElement(p,{className:"".concat(n,"-holder"),style:Ie,ref:$,onScroll:se},C.createElement(H_e,{prefixCls:n,height:Pe,offset:Ye,onInnerResize:je,ref:G,innerProps:_},fe)),S&&C.createElement(IVe,{ref:U,prefixCls:n,scrollTop:k,height:o,scrollHeight:Pe,count:B.length,onScroll:q,onStartMove:function(){R(!0)},onStopMove:function(){R(!1)}}))}var Jq=C.forwardRef(zVe);Jq.displayName="List";var z_e=C.createContext(null);function UVe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var jVe=["disabled","title","children","style","className"];function Are(i){return typeof i=="string"||typeof i=="number"}var KVe=function(e,t){var n=DHe(),r=n.prefixCls,o=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=C.useContext(z_e),g=f.flattenOptions,p=f.onActiveValue,m=f.defaultActiveFirstOption,v=f.onSelect,_=f.menuItemSelectedIcon,y=f.rawValues,S=f.fieldNames,L=f.virtual,E=f.listHeight,D=f.listItemHeight,k="".concat(r,"-item"),T=gC(function(){return g},[s,g],function(ye,be){return be[0]&&ye[1]!==be[1]}),M=C.useRef(null),P=function(be){be.preventDefault()},N=function(be){M.current&&M.current.scrollTo(typeof be=="number"?{index:be}:be)},R=function(be){for(var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,nt=T.length,je=0;je1&&arguments[1]!==void 0?arguments[1]:!1;G(be);var nt={source:Ge?"keyboard":"mouse"},je=T[be];if(!je){p(null,-1,nt);return}p(je.value,be,nt)};C.useEffect(function(){U(m!==!1?R(0):-1)},[T.length,c]);var j=C.useCallback(function(ye){return y.has(ye)&&l!=="combobox"},[l,gt(y).toString(),y.size]);C.useEffect(function(){var ye=setTimeout(function(){if(!a&&s&&y.size===1){var Ge=Array.from(y)[0],nt=T.findIndex(function(je){var _e=je.data;return _e.value===Ge});nt!==-1&&(U(nt),N(nt))}});if(s){var be;(be=M.current)===null||be===void 0||be.scrollTo(void 0)}return function(){return clearTimeout(ye)}},[s,c,g.length]);var ie=function(be){be!==void 0&&v(be,{selected:!y.has(be)}),a||u(!1)};if(C.useImperativeHandle(t,function(){return{onKeyDown:function(be){var Ge=be.which,nt=be.ctrlKey;switch(Ge){case _t.N:case _t.P:case _t.UP:case _t.DOWN:{var je=0;if(Ge===_t.UP?je=-1:Ge===_t.DOWN?je=1:UVe()&&nt&&(Ge===_t.N?je=1:Ge===_t.P&&(je=-1)),je!==0){var _e=R($+je,je);N(_e),U(_e,!0)}break}case _t.ENTER:{var Ve=T[$];Ve&&!Ve.data.disabled?ie(Ve.value):ie(void 0),s&&be.preventDefault();break}case _t.ESC:u(!1),s&&be.stopPropagation()}},onKeyUp:function(){},scrollTo:function(be){N(be)}}}),T.length===0)return C.createElement("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(k,"-empty"),onMouseDown:P},d);var Y=Object.keys(S).map(function(ye){return S[ye]}),J=function(be){return be.label};function Q(ye,be){var Ge=ye.group;return{role:Ge?"presentation":"option",id:"".concat(o,"_list_").concat(be)}}var he=function(be){var Ge=T[be];if(!Ge)return null;var nt=Ge.data||{},je=nt.value,_e=Ge.group,Ve=Mp(nt,!0),Le=J(Ge);return Ge?C.createElement("div",It({"aria-label":typeof Le=="string"&&!_e?Le:null},Ve,{key:be},Q(Ge,be),{"aria-selected":j(je)}),je):null},ge={role:"listbox",id:"".concat(o,"_list")};return C.createElement(C.Fragment,null,L&&C.createElement("div",It({},ge,{style:{height:0,width:0,overflow:"hidden"}}),he($-1),he($),he($+1)),C.createElement(Jq,{itemKey:"key",ref:M,data:T,height:E,itemHeight:D,fullHeight:!1,onMouseDown:P,onScroll:h,virtual:L,innerProps:L?null:ge},function(ye,be){var Ge,nt=ye.group,je=ye.groupOption,_e=ye.data,Ve=ye.label,Le=ye.value,Pe=_e.key;if(nt){var Be,Qe=(Be=_e.title)!==null&&Be!==void 0?Be:Are(Ve)?Ve.toString():void 0;return C.createElement("div",{className:De(k,"".concat(k,"-group")),title:Qe},Ve!==void 0?Ve:Pe)}var Ye=_e.disabled,We=_e.title;_e.children;var dt=_e.style,re=_e.className,ue=Mn(_e,jVe),de=cl(ue,Y),z=j(Le),q="".concat(k,"-option"),se=De(k,q,re,(Ge={},we(Ge,"".concat(q,"-grouped"),je),we(Ge,"".concat(q,"-active"),$===be&&!Ye),we(Ge,"".concat(q,"-disabled"),Ye),we(Ge,"".concat(q,"-selected"),z),Ge)),ne=J(ye),pe=!_||typeof _=="function"||z,ke=typeof ne=="number"?ne:ne||Le,oe=Are(ke)?ke.toString():void 0;return We!==void 0&&(oe=We),C.createElement("div",It({},Mp(de),L?{}:Q(ye,be),{"aria-selected":z,className:se,title:oe,onMouseMove:function(){$===be||Ye||U(be)},onClick:function(){Ye||ie(Le)},style:dt}),C.createElement("div",{className:"".concat(q,"-content")},ke),C.isValidElement(_)||z,pe&&C.createElement(oA,{className:"".concat(k,"-option-state"),customizeIcon:_,customizeIconProps:{isSelected:z}},z?"✓":null))}))},U_e=C.forwardRef(KVe);U_e.displayName="OptionList";var GVe=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],qVe=["inputValue"];function XVe(i){return!i||Un(i)!=="object"}var YVe=C.forwardRef(function(i,e){var t=i.id,n=i.mode,r=i.prefixCls,o=r===void 0?"rc-select":r,s=i.backfill,a=i.fieldNames,l=i.inputValue,c=i.searchValue,u=i.onSearch,d=i.autoClearSearchValue,h=d===void 0?!0:d,f=i.onSelect,g=i.onDeselect,p=i.dropdownMatchSelectWidth,m=p===void 0?!0:p,v=i.filterOption,_=i.filterSort,y=i.optionFilterProp,S=i.optionLabelProp,L=i.options,E=i.children,D=i.defaultActiveFirstOption,k=i.menuItemSelectedIcon,T=i.virtual,M=i.listHeight,P=M===void 0?200:M,N=i.listItemHeight,R=N===void 0?20:N,O=i.value,B=i.defaultValue,$=i.labelInValue,G=i.onChange,U=Mn(i,GVe),j=wVe(t),ie=gH(n),Y=!!(!L&&E),J=C.useMemo(function(){return v===void 0&&n==="combobox"?!1:v},[v,n]),Q=C.useMemo(function(){return W_e(a,Y)},[JSON.stringify(a),Y]),he=nl("",{value:c!==void 0?c:l,postState:function(ut){return ut||""}}),ge=$e(he,2),ye=ge[0],be=ge[1],Ge=EVe(L,E,Q,y,S),nt=Ge.valueOptions,je=Ge.labelOptions,_e=Ge.options,Ve=C.useCallback(function(at){var ut=P_e(at);return ut.map(function(ht){var Lt,At,ln,Si,Xi;if(XVe(ht))Lt=ht;else{var Ir;ln=ht.key,At=ht.label,Lt=(Ir=ht.value)!==null&&Ir!==void 0?Ir:ln}var En=nt.get(Lt);if(En){var fi;At===void 0&&(At=En==null?void 0:En[S||Q.label]),ln===void 0&&(ln=(fi=En==null?void 0:En.key)!==null&&fi!==void 0?fi:Lt),Si=En==null?void 0:En.disabled,Xi=En==null?void 0:En.title}return{label:At,value:Lt,key:ln,disabled:Si,title:Xi}})},[Q,S,nt]),Le=nl(B,{value:O}),Pe=$e(Le,2),Be=Pe[0],Qe=Pe[1],Ye=C.useMemo(function(){var at,ut=Ve(Be);return n==="combobox"&&!((at=ut[0])!==null&&at!==void 0&&at.value)?[]:ut},[Be,Ve,n]),We=_Ve(Ye,nt),dt=$e(We,2),re=dt[0],ue=dt[1],de=C.useMemo(function(){if(!n&&re.length===1){var at=re[0];if(at.value===null&&(at.label===null||at.label===void 0))return[]}return re.map(function(ut){var ht;return te(te({},ut),{},{label:(ht=ut.label)!==null&&ht!==void 0?ht:ut.value})})},[n,re]),z=C.useMemo(function(){return new Set(re.map(function(at){return at.value}))},[re]);C.useEffect(function(){if(n==="combobox"){var at,ut=(at=re[0])===null||at===void 0?void 0:at.value;be(UHe(ut)?String(ut):"")}},[re]);var q=Mre(function(at,ut){var ht,Lt=ut??at;return ht={},we(ht,Q.value,at),we(ht,Q.label,Lt),ht}),se=C.useMemo(function(){if(n!=="tags")return _e;var at=gt(_e),ut=function(Lt){return nt.has(Lt)};return gt(re).sort(function(ht,Lt){return ht.value2&&arguments[2]!==void 0?arguments[2]:{},Lt=ht.source,At=Lt===void 0?"keyboard":Lt;Ht(ut),s&&n==="combobox"&&at!==null&&At==="keyboard"&&He(String(at))},[s,n]),Dt=function(ut,ht,Lt){var At=function(){var ws,Ut=ue(ut);return[$?{label:Ut==null?void 0:Ut[Q.label],value:ut,key:(ws=Ut==null?void 0:Ut.key)!==null&&ws!==void 0?ws:ut}:ut,fH(Ut)]};if(ht&&f){var ln=At(),Si=$e(ln,2),Xi=Si[0],Ir=Si[1];f(Xi,Ir)}else if(!ht&&g&&Lt!=="clear"){var En=At(),fi=$e(En,2),Ur=fi[0],go=fi[1];g(Ur,go)}},St=Mre(function(at,ut){var ht,Lt=ie?ut.selected:!0;Lt?ht=ie?[].concat(gt(re),[at]):[at]:ht=re.filter(function(At){return At.value!==at}),ce(ht),Dt(at,Lt),n==="combobox"?He(""):(!gH||h)&&(be(""),He(""))}),Kt=function(ut,ht){ce(ut);var Lt=ht.type,At=ht.values;(Lt==="remove"||Lt==="clear")&&At.forEach(function(ln){Dt(ln.value,!1,Lt)})},_n=function(ut,ht){if(be(ut),He(null),ht.source==="submit"){var Lt=(ut||"").trim();if(Lt){var At=Array.from(new Set([].concat(gt(z),[Lt])));ce(At),Dt(Lt,!0),be("")}return}ht.source!=="blur"&&(n==="combobox"&&ce(ut),u==null||u(ut))},zt=function(ut){var ht=ut;n!=="tags"&&(ht=ut.map(function(At){var ln=je.get(At);return ln==null?void 0:ln.value}).filter(function(At){return At!==void 0}));var Lt=Array.from(new Set([].concat(gt(z),gt(ht))));ce(Lt),Lt.forEach(function(At){Dt(At,!0)})},Yt=C.useMemo(function(){var at=T!==!1&&m!==!1;return te(te({},Ge),{},{flattenOptions:oe,onActiveValue:Ct,defaultActiveFirstOption:Ue,onSelect:St,menuItemSelectedIcon:k,rawValues:z,fieldNames:Q,virtual:at,listHeight:P,listItemHeight:R,childrenAsData:Y})},[Ge,oe,Ct,Ue,St,k,z,Q,T,m,P,R,Y]);return C.createElement(z_e.Provider,{value:Yt},C.createElement(vVe,It({},U,{id:j,prefixCls:o,ref:e,omitDomProps:qVe,mode:n,displayValues:de,onDisplayValuesChange:Kt,searchValue:ye,onSearch:_n,autoClearSearchValue:h,onSearchSplit:zt,dropdownMatchSelectWidth:m,OptionList:U_e,emptyOptions:!oe.length,activeValue:Te,activeDescendantId:"".concat(j,"_list_").concat(rt)})))}),eX=YVe;eX.Option=Qq;eX.OptGroup=Zq;function j_e(i,e,t){return function(r){const{prefixCls:o,style:s}=r,a=C.useRef(null),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=nl(!1,{value:r.open}),{getPrefixCls:g}=C.useContext(Pn),p=g(e||"select",o);return C.useEffect(()=>{if(f(!0),typeof ResizeObserver<"u"){const m=new ResizeObserver(_=>{const y=_[0].target;c(y.offsetHeight+8),d(y.offsetWidth)}),v=setInterval(()=>{var _;const y=t?`.${t(p)}`:`.${p}-dropdown`,S=(_=a.current)===null||_===void 0?void 0:_.querySelector(y);S&&(clearInterval(v),m.observe(S))},10);return()=>{clearInterval(v),m.disconnect()}}},[]),C.createElement(I4,{theme:{token:{motionDurationFast:"0.01s",motionDurationMid:"0.01s",motionDurationSlow:"0.01s"}}},C.createElement("div",{ref:a,style:{paddingBottom:l,position:"relative",width:"fit-content",minWidth:u}},C.createElement(i,Object.assign({},r,{style:Object.assign(Object.assign({},s),{margin:0}),open:h,visible:h,getPopupContainer:()=>a.current}))))}}function pp(i,e,t){return De({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const P4=(i,e)=>e||i,ZVe=()=>{const[,i]=mC(),e=new Jr(i.colorBgBase);let t={};return e.toHsl().l<.5&&(t={opacity:.65}),C.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(24 31.67)"},C.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),C.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),C.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),C.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),C.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),C.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),C.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},C.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),C.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},QVe=ZVe,JVe=()=>{const[,i]=mC(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:r}=i,{borderColor:o,shadowColor:s,contentColor:a}=C.useMemo(()=>({borderColor:new Jr(e).onBackground(r).toHexShortString(),shadowColor:new Jr(t).onBackground(r).toHexShortString(),contentColor:new Jr(n).onBackground(r).toHexShortString()}),[e,t,n,r]);return C.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},C.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),C.createElement("g",{fillRule:"nonzero",stroke:o},C.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),C.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))},eze=JVe,tze=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:r,fontSize:o,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:o,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:r,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}},nze=yo("Empty",i=>{const{componentCls:e,controlHeightLG:t}=i,n=Bi(i,{emptyImgCls:`${e}-img`,emptyImgHeight:t*2.5,emptyImgHeightMD:t,emptyImgHeightSM:t*.875});return[tze(n)]});var ize=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{className:e,rootClassName:t,prefixCls:n,image:r=K_e,description:o,children:s,imageStyle:a}=i,l=ize(i,["className","rootClassName","prefixCls","image","description","children","imageStyle"]);const{getPrefixCls:c,direction:u}=C.useContext(Pn),d=c("empty",n),[h,f]=nze(d),[g]=jk("Empty"),p=typeof o<"u"?o:g==null?void 0:g.description,m=typeof p=="string"?p:"empty";let v=null;return typeof r=="string"?v=C.createElement("img",{alt:m,src:r}):v=r,h(C.createElement("div",Object.assign({className:De(f,d,{[`${d}-normal`]:r===G_e,[`${d}-rtl`]:u==="rtl"},e,t)},l),C.createElement("div",{className:`${d}-image`,style:a},v),p&&C.createElement("div",{className:`${d}-description`},p),s&&C.createElement("div",{className:`${d}-footer`},s)))};tX.PRESENTED_IMAGE_DEFAULT=K_e;tX.PRESENTED_IMAGE_SIMPLE=G_e;const L0=tX,rze=i=>{const{componentName:e}=i,{getPrefixCls:t}=C.useContext(Pn),n=t("empty");switch(e){case"Table":case"List":return qe.createElement(L0,{image:L0.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return qe.createElement(L0,{image:L0.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return qe.createElement(L0,null)}},nX=rze,oze=i=>{const{controlPaddingHorizontal:e}=i;return{position:"relative",display:"block",minHeight:i.controlHeight,padding:`${(i.controlHeight-i.fontSize*i.lineHeight)/2}px ${e}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,boxSizing:"border-box"}},sze=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` +`].includes(Qt)})},[$]),Xi=function($t,On,Jt){var Zt=!0,oi=$t;M==null||M(null);var Wi=Jt?null:gVe($t,$);return v!=="combobox"&&Wi&&(oi="",B==null||B(Wi),ln(!1),Zt=!1),O&&rt!==oi&&O(oi,{source:On?"typing":"effect"}),Zt},Ir=function($t){!$t||!$t.trim()||O($t,{source:"submit"})};C.useEffect(function(){!ht&&!re&&v!=="combobox"&&Xi("",!1,!1)},[ht]),C.useEffect(function(){at&&_&&ut(!1),_&&Me(!1)},[_]);var En=T_e(),fi=$e(En,2),Ur=fi[0],go=fi[1],ys=function($t){var On=Ur(),Jt=$t.which;if(Jt===_t.ENTER&&(v!=="combobox"&&$t.preventDefault(),ht||ln(!0)),go(!!rt),Jt===_t.BACKSPACE&&!On&&re&&!rt&&d.length){for(var Zt=gt(d),oi=null,Wi=Zt.length-1;Wi>=0;Wi-=1){var So=Zt[Wi];if(!So.disabled){Zt.splice(Wi,1),oi=So;break}}oi&&h(Zt,{type:"remove",values:[oi]})}for(var Hs=arguments.length,gl=new Array(Hs>1?Hs-1:0),Vs=1;Vs1?On-1:0),Zt=1;Zt1?Wi-1:0),Hs=1;Hs1&&arguments[1]!==void 0?arguments[1]:!1;return od(i).map(function(t,n){if(!C.isValidElement(t)||!t.type)return null;var r=t,o=r.type.isSelectOptGroup,s=r.key,a=r.props,l=a.children,c=Mn(a,xVe);return e||!o?LVe(t):te(te({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:$_e(l)})}).filter(function(t){return t})}function EVe(i,e,t,n,r){return C.useMemo(function(){var o=i,s=!i;s&&(o=$_e(e));var a=new Map,l=new Map,c=function(h,f,g){g&&typeof g=="string"&&h.set(f[g],f)};function u(d){for(var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=0;fl},n}return Cs(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(r){r.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var r=this.state,o=r.dragging,s=r.visible,a=this.props.prefixCls,l=this.getSpinHeight(),c=this.getTop(),u=this.showScroll(),d=u&&s;return C.createElement("div",{ref:this.scrollbarRef,className:De("".concat(a,"-scrollbar"),we({},"".concat(a,"-scrollbar-show"),u)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:d?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},C.createElement("div",{ref:this.thumbRef,className:De("".concat(a,"-scrollbar-thumb"),we({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:l,top:c,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(C.Component);function kVe(i){var e=i.children,t=i.setRef,n=C.useCallback(function(r){t(r)},[]);return C.cloneElement(e,{ref:n})}function TVe(i,e,t,n,r,o){var s=o.getKey;return i.slice(e,t+1).map(function(a,l){var c=e+l,u=r(a,c,{}),d=s(a);return C.createElement(kVe,{key:d,setRef:function(f){return n(a,f)}},u)})}var NVe=function(){function i(){bs(this,i),this.maps=void 0,this.maps=Object.create(null)}return Cs(i,[{key:"set",value:function(t,n){this.maps[t]=n}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function RVe(i,e,t){var n=C.useState(0),r=$e(n,2),o=r[0],s=r[1],a=C.useRef(new Map),l=C.useRef(new NVe),c=C.useRef();function u(){tr.cancel(c.current)}function d(){u(),c.current=tr(function(){a.current.forEach(function(f,g){if(f&&f.offsetParent){var p=FD(f),m=p.offsetHeight;l.current.get(g)!==m&&l.current.set(g,p.offsetHeight)}}),s(function(f){return f+1})})}function h(f,g){var p=i(f),m=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!m!=!g&&(g?e==null||e(f):t==null||t(f))}return C.useEffect(function(){return u},[]),[h,d,l.current,o]}function MVe(i,e,t,n,r,o,s,a){var l=C.useRef();return function(c){if(c==null){a();return}if(tr.cancel(l.current),typeof c=="number")s(c);else if(c&&Un(c)==="object"){var u,d=c.align;"index"in c?u=c.index:u=e.findIndex(function(p){return r(p)===c.key});var h=c.offset,f=h===void 0?0:h,g=function p(m,v){if(!(m<0||!i.current)){var _=i.current.clientHeight,y=!1,S=v;if(_){for(var L=v||d,E=0,D=0,k=0,T=Math.min(e.length,u),M=0;M<=T;M+=1){var P=r(e[M]);D=E;var N=t.get(P);k=D+(N===void 0?n:N),E=k,M===u&&N===void 0&&(y=!0)}var R=null;switch(L){case"top":R=D-f;break;case"bottom":R=k-_+f;break;default:{var O=i.current.scrollTop,B=O+_;DB&&(S="bottom")}}R!==null&&R!==i.current.scrollTop&&s(R)}l.current=tr(function(){y&&o(),p(m-1,S)},2)}};g(3)}}}function PVe(i,e,t){var n=i.length,r=e.length,o,s;if(n===0&&r===0)return null;n"u"?"undefined":Un(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const V_e=function(i,e){var t=C.useRef(!1),n=C.useRef(null);function r(){clearTimeout(n.current),t.current=!0,n.current=setTimeout(function(){t.current=!1},50)}var o=C.useRef({top:i,bottom:e});return o.current.top=i,o.current.bottom=e,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&o.current.top||s>0&&o.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&r(),!t.current&&l}};function FVe(i,e,t,n){var r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a=C.useRef(!1),l=V_e(e,t);function c(d){if(i){tr.cancel(o.current);var h=d.deltaY;r.current+=h,s.current=h,!l(h)&&(OVe||d.preventDefault(),o.current=tr(function(){var f=a.current?10:1;n(r.current*f),r.current=0}))}}function u(d){i&&(a.current=d.detail===s.current)}return[c,u]}var BVe=14/15;function WVe(i,e,t){var n=C.useRef(!1),r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=r.current-f;r.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=BVe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,r.current=Math.ceil(h.touches[0].pageY),o.current=h.target,o.current.addEventListener("touchmove",l),o.current.addEventListener("touchend",c))};a=function(){o.current&&(o.current.removeEventListener("touchmove",l),o.current.removeEventListener("touchend",c))},Cr(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var $Ve=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],HVe=[],VVe={overflowY:"auto",overflowAnchor:"none"};function zVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-virtual-list":t,r=i.className,o=i.height,s=i.itemHeight,a=i.fullHeight,l=a===void 0?!0:a,c=i.style,u=i.data,d=i.children,h=i.itemKey,f=i.virtual,g=i.component,p=g===void 0?"div":g,m=i.onScroll,v=i.onVisibleChange,_=i.innerProps,y=Mn(i,$Ve),S=!!(f!==!1&&o&&s),L=S&&u&&s*u.length>o,E=C.useState(0),D=$e(E,2),k=D[0],T=D[1],M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=De(n,r),B=u||HVe,$=C.useRef(),G=C.useRef(),U=C.useRef(),j=C.useCallback(function(Te){return typeof h=="function"?h(Te):Te==null?void 0:Te[h]},[h]),ie={getKey:j};function Y(Te){T(function(He){var Me;typeof Te=="function"?Me=Te(He):Me=Te;var bt=re(Me);return $.current.scrollTop=bt,bt})}var J=C.useRef({start:0,end:B.length}),Q=C.useRef(),he=AVe(B,j),ge=$e(he,1),ye=ge[0];Q.current=ye;var be=RVe(j,null,null),Ge=$e(be,4),nt=Ge[0],je=Ge[1],_e=Ge[2],Ve=Ge[3],Le=C.useMemo(function(){if(!S)return{scrollHeight:void 0,start:0,end:B.length-1,offset:void 0};if(!L){var Te;return{scrollHeight:((Te=G.current)===null||Te===void 0?void 0:Te.offsetHeight)||0,start:0,end:B.length-1,offset:void 0}}for(var He=0,Me,bt,rt,Ht=B.length,Ue=0;Ue=k&&Me===void 0&&(Me=Ue,bt=He),Kt>k+o&&rt===void 0&&(rt=Ue),He=Kt}return Me===void 0&&(Me=0,bt=0,rt=Math.ceil(o/s)),rt===void 0&&(rt=B.length-1),rt=Math.min(rt+1,B.length),{scrollHeight:He,start:Me,end:rt,offset:bt}},[L,S,k,B,Ve,o]),Pe=Le.scrollHeight,Be=Le.start,Qe=Le.end,Ye=Le.offset;J.current.start=Be,J.current.end=Qe;var We=Pe-o,dt=C.useRef(We);dt.current=We;function re(Te){var He=Te;return Number.isNaN(dt.current)||(He=Math.min(He,dt.current)),He=Math.max(He,0),He}var ue=k<=0,de=k>=We,z=V_e(ue,de);function q(Te){var He=Te;Y(He)}function se(Te){var He=Te.currentTarget.scrollTop;He!==k&&Y(He),m==null||m(Te)}var ne=FVe(S,ue,de,function(Te){Y(function(He){var Me=He+Te;return Me})}),pe=$e(ne,2),ke=pe[0],oe=pe[1];WVe(S,$,function(Te,He){return z(Te,He)?!1:(ke({preventDefault:function(){},deltaY:Te}),!0)}),Cr(function(){function Te(He){S&&He.preventDefault()}return $.current.addEventListener("wheel",ke),$.current.addEventListener("DOMMouseScroll",oe),$.current.addEventListener("MozMousePixelScroll",Te),function(){$.current&&($.current.removeEventListener("wheel",ke),$.current.removeEventListener("DOMMouseScroll",oe),$.current.removeEventListener("MozMousePixelScroll",Te))}},[S]);var ce=MVe($,B,_e,s,j,je,Y,function(){var Te;(Te=U.current)===null||Te===void 0||Te.delayHidden()});C.useImperativeHandle(e,function(){return{scrollTo:ce}}),Cr(function(){if(v){var Te=B.slice(Be,Qe+1);v(Te,B)}},[Be,Qe,B]);var fe=TVe(B,Be,Qe,nt,d,ie),Ie=null;return o&&(Ie=te(we({},l?"height":"maxHeight",o),VVe),S&&(Ie.overflowY="hidden",N&&(Ie.pointerEvents="none"))),C.createElement("div",It({style:te(te({},c),{},{position:"relative"}),className:O},y),C.createElement(p,{className:"".concat(n,"-holder"),style:Ie,ref:$,onScroll:se},C.createElement(H_e,{prefixCls:n,height:Pe,offset:Ye,onInnerResize:je,ref:G,innerProps:_},fe)),S&&C.createElement(IVe,{ref:U,prefixCls:n,scrollTop:k,height:o,scrollHeight:Pe,count:B.length,onScroll:q,onStartMove:function(){R(!0)},onStopMove:function(){R(!1)}}))}var Jq=C.forwardRef(zVe);Jq.displayName="List";var z_e=C.createContext(null);function UVe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var jVe=["disabled","title","children","style","className"];function Are(i){return typeof i=="string"||typeof i=="number"}var KVe=function(e,t){var n=DHe(),r=n.prefixCls,o=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=C.useContext(z_e),g=f.flattenOptions,p=f.onActiveValue,m=f.defaultActiveFirstOption,v=f.onSelect,_=f.menuItemSelectedIcon,y=f.rawValues,S=f.fieldNames,L=f.virtual,E=f.listHeight,D=f.listItemHeight,k="".concat(r,"-item"),T=pC(function(){return g},[s,g],function(ye,be){return be[0]&&ye[1]!==be[1]}),M=C.useRef(null),P=function(be){be.preventDefault()},N=function(be){M.current&&M.current.scrollTo(typeof be=="number"?{index:be}:be)},R=function(be){for(var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,nt=T.length,je=0;je1&&arguments[1]!==void 0?arguments[1]:!1;G(be);var nt={source:Ge?"keyboard":"mouse"},je=T[be];if(!je){p(null,-1,nt);return}p(je.value,be,nt)};C.useEffect(function(){U(m!==!1?R(0):-1)},[T.length,c]);var j=C.useCallback(function(ye){return y.has(ye)&&l!=="combobox"},[l,gt(y).toString(),y.size]);C.useEffect(function(){var ye=setTimeout(function(){if(!a&&s&&y.size===1){var Ge=Array.from(y)[0],nt=T.findIndex(function(je){var _e=je.data;return _e.value===Ge});nt!==-1&&(U(nt),N(nt))}});if(s){var be;(be=M.current)===null||be===void 0||be.scrollTo(void 0)}return function(){return clearTimeout(ye)}},[s,c,g.length]);var ie=function(be){be!==void 0&&v(be,{selected:!y.has(be)}),a||u(!1)};if(C.useImperativeHandle(t,function(){return{onKeyDown:function(be){var Ge=be.which,nt=be.ctrlKey;switch(Ge){case _t.N:case _t.P:case _t.UP:case _t.DOWN:{var je=0;if(Ge===_t.UP?je=-1:Ge===_t.DOWN?je=1:UVe()&&nt&&(Ge===_t.N?je=1:Ge===_t.P&&(je=-1)),je!==0){var _e=R($+je,je);N(_e),U(_e,!0)}break}case _t.ENTER:{var Ve=T[$];Ve&&!Ve.data.disabled?ie(Ve.value):ie(void 0),s&&be.preventDefault();break}case _t.ESC:u(!1),s&&be.stopPropagation()}},onKeyUp:function(){},scrollTo:function(be){N(be)}}}),T.length===0)return C.createElement("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(k,"-empty"),onMouseDown:P},d);var Y=Object.keys(S).map(function(ye){return S[ye]}),J=function(be){return be.label};function Q(ye,be){var Ge=ye.group;return{role:Ge?"presentation":"option",id:"".concat(o,"_list_").concat(be)}}var he=function(be){var Ge=T[be];if(!Ge)return null;var nt=Ge.data||{},je=nt.value,_e=Ge.group,Ve=Mp(nt,!0),Le=J(Ge);return Ge?C.createElement("div",It({"aria-label":typeof Le=="string"&&!_e?Le:null},Ve,{key:be},Q(Ge,be),{"aria-selected":j(je)}),je):null},ge={role:"listbox",id:"".concat(o,"_list")};return C.createElement(C.Fragment,null,L&&C.createElement("div",It({},ge,{style:{height:0,width:0,overflow:"hidden"}}),he($-1),he($),he($+1)),C.createElement(Jq,{itemKey:"key",ref:M,data:T,height:E,itemHeight:D,fullHeight:!1,onMouseDown:P,onScroll:h,virtual:L,innerProps:L?null:ge},function(ye,be){var Ge,nt=ye.group,je=ye.groupOption,_e=ye.data,Ve=ye.label,Le=ye.value,Pe=_e.key;if(nt){var Be,Qe=(Be=_e.title)!==null&&Be!==void 0?Be:Are(Ve)?Ve.toString():void 0;return C.createElement("div",{className:De(k,"".concat(k,"-group")),title:Qe},Ve!==void 0?Ve:Pe)}var Ye=_e.disabled,We=_e.title;_e.children;var dt=_e.style,re=_e.className,ue=Mn(_e,jVe),de=cl(ue,Y),z=j(Le),q="".concat(k,"-option"),se=De(k,q,re,(Ge={},we(Ge,"".concat(q,"-grouped"),je),we(Ge,"".concat(q,"-active"),$===be&&!Ye),we(Ge,"".concat(q,"-disabled"),Ye),we(Ge,"".concat(q,"-selected"),z),Ge)),ne=J(ye),pe=!_||typeof _=="function"||z,ke=typeof ne=="number"?ne:ne||Le,oe=Are(ke)?ke.toString():void 0;return We!==void 0&&(oe=We),C.createElement("div",It({},Mp(de),L?{}:Q(ye,be),{"aria-selected":z,className:se,title:oe,onMouseMove:function(){$===be||Ye||U(be)},onClick:function(){Ye||ie(Le)},style:dt}),C.createElement("div",{className:"".concat(q,"-content")},ke),C.isValidElement(_)||z,pe&&C.createElement(oA,{className:"".concat(k,"-option-state"),customizeIcon:_,customizeIconProps:{isSelected:z}},z?"✓":null))}))},U_e=C.forwardRef(KVe);U_e.displayName="OptionList";var GVe=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],qVe=["inputValue"];function XVe(i){return!i||Un(i)!=="object"}var YVe=C.forwardRef(function(i,e){var t=i.id,n=i.mode,r=i.prefixCls,o=r===void 0?"rc-select":r,s=i.backfill,a=i.fieldNames,l=i.inputValue,c=i.searchValue,u=i.onSearch,d=i.autoClearSearchValue,h=d===void 0?!0:d,f=i.onSelect,g=i.onDeselect,p=i.dropdownMatchSelectWidth,m=p===void 0?!0:p,v=i.filterOption,_=i.filterSort,y=i.optionFilterProp,S=i.optionLabelProp,L=i.options,E=i.children,D=i.defaultActiveFirstOption,k=i.menuItemSelectedIcon,T=i.virtual,M=i.listHeight,P=M===void 0?200:M,N=i.listItemHeight,R=N===void 0?20:N,O=i.value,B=i.defaultValue,$=i.labelInValue,G=i.onChange,U=Mn(i,GVe),j=wVe(t),ie=gH(n),Y=!!(!L&&E),J=C.useMemo(function(){return v===void 0&&n==="combobox"?!1:v},[v,n]),Q=C.useMemo(function(){return W_e(a,Y)},[JSON.stringify(a),Y]),he=nl("",{value:c!==void 0?c:l,postState:function(ut){return ut||""}}),ge=$e(he,2),ye=ge[0],be=ge[1],Ge=EVe(L,E,Q,y,S),nt=Ge.valueOptions,je=Ge.labelOptions,_e=Ge.options,Ve=C.useCallback(function(at){var ut=P_e(at);return ut.map(function(ht){var Lt,At,ln,Si,Xi;if(XVe(ht))Lt=ht;else{var Ir;ln=ht.key,At=ht.label,Lt=(Ir=ht.value)!==null&&Ir!==void 0?Ir:ln}var En=nt.get(Lt);if(En){var fi;At===void 0&&(At=En==null?void 0:En[S||Q.label]),ln===void 0&&(ln=(fi=En==null?void 0:En.key)!==null&&fi!==void 0?fi:Lt),Si=En==null?void 0:En.disabled,Xi=En==null?void 0:En.title}return{label:At,value:Lt,key:ln,disabled:Si,title:Xi}})},[Q,S,nt]),Le=nl(B,{value:O}),Pe=$e(Le,2),Be=Pe[0],Qe=Pe[1],Ye=C.useMemo(function(){var at,ut=Ve(Be);return n==="combobox"&&!((at=ut[0])!==null&&at!==void 0&&at.value)?[]:ut},[Be,Ve,n]),We=_Ve(Ye,nt),dt=$e(We,2),re=dt[0],ue=dt[1],de=C.useMemo(function(){if(!n&&re.length===1){var at=re[0];if(at.value===null&&(at.label===null||at.label===void 0))return[]}return re.map(function(ut){var ht;return te(te({},ut),{},{label:(ht=ut.label)!==null&&ht!==void 0?ht:ut.value})})},[n,re]),z=C.useMemo(function(){return new Set(re.map(function(at){return at.value}))},[re]);C.useEffect(function(){if(n==="combobox"){var at,ut=(at=re[0])===null||at===void 0?void 0:at.value;be(UHe(ut)?String(ut):"")}},[re]);var q=Mre(function(at,ut){var ht,Lt=ut??at;return ht={},we(ht,Q.value,at),we(ht,Q.label,Lt),ht}),se=C.useMemo(function(){if(n!=="tags")return _e;var at=gt(_e),ut=function(Lt){return nt.has(Lt)};return gt(re).sort(function(ht,Lt){return ht.value2&&arguments[2]!==void 0?arguments[2]:{},Lt=ht.source,At=Lt===void 0?"keyboard":Lt;Ht(ut),s&&n==="combobox"&&at!==null&&At==="keyboard"&&He(String(at))},[s,n]),Dt=function(ut,ht,Lt){var At=function(){var ws,Ut=ue(ut);return[$?{label:Ut==null?void 0:Ut[Q.label],value:ut,key:(ws=Ut==null?void 0:Ut.key)!==null&&ws!==void 0?ws:ut}:ut,fH(Ut)]};if(ht&&f){var ln=At(),Si=$e(ln,2),Xi=Si[0],Ir=Si[1];f(Xi,Ir)}else if(!ht&&g&&Lt!=="clear"){var En=At(),fi=$e(En,2),Ur=fi[0],go=fi[1];g(Ur,go)}},St=Mre(function(at,ut){var ht,Lt=ie?ut.selected:!0;Lt?ht=ie?[].concat(gt(re),[at]):[at]:ht=re.filter(function(At){return At.value!==at}),ce(ht),Dt(at,Lt),n==="combobox"?He(""):(!gH||h)&&(be(""),He(""))}),Kt=function(ut,ht){ce(ut);var Lt=ht.type,At=ht.values;(Lt==="remove"||Lt==="clear")&&At.forEach(function(ln){Dt(ln.value,!1,Lt)})},_n=function(ut,ht){if(be(ut),He(null),ht.source==="submit"){var Lt=(ut||"").trim();if(Lt){var At=Array.from(new Set([].concat(gt(z),[Lt])));ce(At),Dt(Lt,!0),be("")}return}ht.source!=="blur"&&(n==="combobox"&&ce(ut),u==null||u(ut))},zt=function(ut){var ht=ut;n!=="tags"&&(ht=ut.map(function(At){var ln=je.get(At);return ln==null?void 0:ln.value}).filter(function(At){return At!==void 0}));var Lt=Array.from(new Set([].concat(gt(z),gt(ht))));ce(Lt),Lt.forEach(function(At){Dt(At,!0)})},Yt=C.useMemo(function(){var at=T!==!1&&m!==!1;return te(te({},Ge),{},{flattenOptions:oe,onActiveValue:Ct,defaultActiveFirstOption:Ue,onSelect:St,menuItemSelectedIcon:k,rawValues:z,fieldNames:Q,virtual:at,listHeight:P,listItemHeight:R,childrenAsData:Y})},[Ge,oe,Ct,Ue,St,k,z,Q,T,m,P,R,Y]);return C.createElement(z_e.Provider,{value:Yt},C.createElement(vVe,It({},U,{id:j,prefixCls:o,ref:e,omitDomProps:qVe,mode:n,displayValues:de,onDisplayValuesChange:Kt,searchValue:ye,onSearch:_n,autoClearSearchValue:h,onSearchSplit:zt,dropdownMatchSelectWidth:m,OptionList:U_e,emptyOptions:!oe.length,activeValue:Te,activeDescendantId:"".concat(j,"_list_").concat(rt)})))}),eX=YVe;eX.Option=Qq;eX.OptGroup=Zq;function j_e(i,e,t){return function(r){const{prefixCls:o,style:s}=r,a=C.useRef(null),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=nl(!1,{value:r.open}),{getPrefixCls:g}=C.useContext(Pn),p=g(e||"select",o);return C.useEffect(()=>{if(f(!0),typeof ResizeObserver<"u"){const m=new ResizeObserver(_=>{const y=_[0].target;c(y.offsetHeight+8),d(y.offsetWidth)}),v=setInterval(()=>{var _;const y=t?`.${t(p)}`:`.${p}-dropdown`,S=(_=a.current)===null||_===void 0?void 0:_.querySelector(y);S&&(clearInterval(v),m.observe(S))},10);return()=>{clearInterval(v),m.disconnect()}}},[]),C.createElement(I4,{theme:{token:{motionDurationFast:"0.01s",motionDurationMid:"0.01s",motionDurationSlow:"0.01s"}}},C.createElement("div",{ref:a,style:{paddingBottom:l,position:"relative",width:"fit-content",minWidth:u}},C.createElement(i,Object.assign({},r,{style:Object.assign(Object.assign({},s),{margin:0}),open:h,visible:h,getPopupContainer:()=>a.current}))))}}function pp(i,e,t){return De({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const P4=(i,e)=>e||i,ZVe=()=>{const[,i]=vC(),e=new Jr(i.colorBgBase);let t={};return e.toHsl().l<.5&&(t={opacity:.65}),C.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(24 31.67)"},C.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),C.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),C.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),C.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),C.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),C.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),C.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},C.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),C.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},QVe=ZVe,JVe=()=>{const[,i]=vC(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:r}=i,{borderColor:o,shadowColor:s,contentColor:a}=C.useMemo(()=>({borderColor:new Jr(e).onBackground(r).toHexShortString(),shadowColor:new Jr(t).onBackground(r).toHexShortString(),contentColor:new Jr(n).onBackground(r).toHexShortString()}),[e,t,n,r]);return C.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},C.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),C.createElement("g",{fillRule:"nonzero",stroke:o},C.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),C.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))},eze=JVe,tze=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:r,fontSize:o,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:o,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:r,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}},nze=yo("Empty",i=>{const{componentCls:e,controlHeightLG:t}=i,n=Bi(i,{emptyImgCls:`${e}-img`,emptyImgHeight:t*2.5,emptyImgHeightMD:t,emptyImgHeightSM:t*.875});return[tze(n)]});var ize=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{className:e,rootClassName:t,prefixCls:n,image:r=K_e,description:o,children:s,imageStyle:a}=i,l=ize(i,["className","rootClassName","prefixCls","image","description","children","imageStyle"]);const{getPrefixCls:c,direction:u}=C.useContext(Pn),d=c("empty",n),[h,f]=nze(d),[g]=jk("Empty"),p=typeof o<"u"?o:g==null?void 0:g.description,m=typeof p=="string"?p:"empty";let v=null;return typeof r=="string"?v=C.createElement("img",{alt:m,src:r}):v=r,h(C.createElement("div",Object.assign({className:De(f,d,{[`${d}-normal`]:r===G_e,[`${d}-rtl`]:u==="rtl"},e,t)},l),C.createElement("div",{className:`${d}-image`,style:a},v),p&&C.createElement("div",{className:`${d}-description`},p),s&&C.createElement("div",{className:`${d}-footer`},s)))};tX.PRESENTED_IMAGE_DEFAULT=K_e;tX.PRESENTED_IMAGE_SIMPLE=G_e;const E0=tX,rze=i=>{const{componentName:e}=i,{getPrefixCls:t}=C.useContext(Pn),n=t("empty");switch(e){case"Table":case"List":return qe.createElement(E0,{image:E0.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return qe.createElement(E0,{image:E0.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return qe.createElement(E0,null)}},nX=rze,oze=i=>{const{controlPaddingHorizontal:e}=i;return{position:"relative",display:"block",minHeight:i.controlHeight,padding:`${(i.controlHeight-i.fontSize*i.lineHeight)/2}px ${e}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,boxSizing:"border-box"}},sze=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` &${e}-slide-up-enter${e}-slide-up-enter-active${t}-dropdown-placement-bottomLeft, &${e}-slide-up-appear${e}-slide-up-appear-active${t}-dropdown-placement-bottomLeft `]:{animationName:Kq},[` &${e}-slide-up-enter${e}-slide-up-enter-active${t}-dropdown-placement-topLeft, &${e}-slide-up-appear${e}-slide-up-appear-active${t}-dropdown-placement-topLeft - `]:{animationName:qq},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-bottomLeft`]:{animationName:Gq},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-topLeft`]:{animationName:Xq},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},oze(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign(Object.assign({flex:"auto"},lb),{"> *":Object.assign({},lb)}),"&-state":{flex:"none"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.controlItemBgHover},[`&-selected:not(${n}-option-disabled)`]:{color:i.colorText,fontWeight:i.fontWeightStrong,backgroundColor:i.controlItemBgActive,[`${n}-option-state`]:{color:i.colorPrimary}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},Bw(i,"slide-up"),Bw(i,"slide-down"),iA(i,"move-up"),iA(i,"move-down")]},aze=sze,i1=2;function q_e(i){let{controlHeightSM:e,controlHeight:t,lineWidth:n}=i;const r=(t-e)/2-n,o=Math.ceil(r/2);return[r,o]}function N6(i,e){const{componentCls:t,iconCls:n}=i,r=`${t}-selection-overflow`,o=i.controlHeightSM,[s]=q_e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[r]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${s-i1}px ${i1*2}px`,borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${i1}px 0`,lineHeight:`${o}px`,content:'"\\a0"'}},[` + `]:{animationName:qq},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-bottomLeft`]:{animationName:Gq},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-topLeft`]:{animationName:Xq},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},oze(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign(Object.assign({flex:"auto"},cb),{"> *":Object.assign({},cb)}),"&-state":{flex:"none"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.controlItemBgHover},[`&-selected:not(${n}-option-disabled)`]:{color:i.colorText,fontWeight:i.fontWeightStrong,backgroundColor:i.controlItemBgActive,[`${n}-option-state`]:{color:i.colorPrimary}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},Bw(i,"slide-up"),Bw(i,"slide-down"),iA(i,"move-up"),iA(i,"move-down")]},aze=sze,i1=2;function q_e(i){let{controlHeightSM:e,controlHeight:t,lineWidth:n}=i;const r=(t-e)/2-n,o=Math.ceil(r/2);return[r,o]}function N6(i,e){const{componentCls:t,iconCls:n}=i,r=`${t}-selection-overflow`,o=i.controlHeightSM,[s]=q_e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[r]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${s-i1}px ${i1*2}px`,borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${i1}px 0`,lineHeight:`${o}px`,content:'"\\a0"'}},[` &${t}-show-arrow ${t}-selector, &${t}-allow-clear ${t}-selector `]:{paddingInlineEnd:i.fontSizeIcon+i.controlPaddingHorizontal},[`${t}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:o,marginTop:i1,marginBottom:i1,lineHeight:`${o-i.lineWidth*2}px`,background:i.colorFillSecondary,border:`${i.lineWidth}px solid ${i.colorSplit}`,borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,userSelect:"none",marginInlineEnd:i1*2,paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS/2,[`${t}-disabled&`]:{color:i.colorTextDisabled,borderColor:i.colorBorder,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},Kk()),{display:"inline-block",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${r}-item + ${r}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.inputPaddingHorizontalBase-s,[` @@ -305,7 +305,7 @@ html body { `]:{paddingInlineEnd:s},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:i.controlHeight,padding:`0 ${n}px`,[`${t}-selection-search-input`]:{height:o},"&:after":{lineHeight:`${o}px`}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${n}px`,"&:after":{display:"none"}}}}}}}function cze(i){const{componentCls:e}=i,t=i.controlPaddingHorizontalSM-i.lineWidth;return[R6(i),R6(Bi(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${t}px`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t+i.fontSize*1.5},[` &${e}-show-arrow ${e}-selection-item, &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:i.fontSize*1.5}}}},R6(Bi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const uze=i=>{const{componentCls:e}=i;return{position:"relative",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${e}-disabled&`]:{color:i.colorTextDisabled,background:i.colorBgContainerDisabled,cursor:"not-allowed",[`${e}-multiple&`]:{background:i.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},M6=function(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:n,borderHoverColor:r,outlineColor:o,antCls:s}=e,a=t?{[`${n}-selector`]:{borderColor:r}}:{};return{[i]:{[`&:not(${n}-disabled):not(${n}-customize-input):not(${s}-pagination-size-changer)`]:Object.assign(Object.assign({},a),{[`${n}-focused& ${n}-selector`]:{borderColor:r,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${o}`,outline:0},[`&:hover ${n}-selector`]:{borderColor:r}})}}},dze=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},hze=i=>{const{componentCls:e,inputPaddingHorizontalBase:t,iconCls:n}=i;return{[e]:Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${e}-customize-input) ${e}-selector`]:Object.assign(Object.assign({},uze(i)),dze(i)),[`${e}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal"},lb),{"> *":Object.assign({lineHeight:"inherit"},lb)}),[`${e}-selection-placeholder`]:Object.assign(Object.assign({},lb),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${e}-arrow`]:Object.assign(Object.assign({},Kk()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[n]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${e}-suffix)`]:{pointerEvents:"auto"}},[`${e}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:i.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${e}-clear`]:{opacity:1}}}),[`${e}-has-feedback`]:{[`${e}-clear`]:{insetInlineEnd:t+i.fontSize+i.paddingXXS}}}},fze=i=>{const{componentCls:e}=i;return[{[e]:{[`&-borderless ${e}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${e}-in-form-item`]:{width:"100%"}}},hze(i),cze(i),lze(i),aze(i),{[`${e}-rtl`]:{direction:"rtl"}},M6(e,Bi(i,{borderHoverColor:i.colorPrimaryHover,outlineColor:i.controlOutline})),M6(`${e}-status-error`,Bi(i,{borderHoverColor:i.colorErrorHover,outlineColor:i.colorErrorOutline}),!0),M6(`${e}-status-warning`,Bi(i,{borderHoverColor:i.colorWarningHover,outlineColor:i.colorWarningOutline}),!0),N4(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},gze=yo("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=Bi(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.paddingSM-1});return[fze(n)]},i=>({zIndexPopup:i.zIndexPopupBase+50})),CR={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"visible"},pze={bottomLeft:Object.assign(Object.assign({},CR),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},CR),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},CR),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},CR),{points:["br","tr"],offset:[0,-4]})};function mze(i){return i||pze}function vze(i){return i??!0}function _ze(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:s,hasFeedback:a,prefixCls:l,showArrow:c,feedbackIcon:u}=i;const d=t??C.createElement(PS,null),h=m=>C.createElement(C.Fragment,null,c!==!1&&m,a&&u);let f=null;if(e!==void 0)f=h(e);else if(o)f=h(C.createElement(AD,{spin:!0}));else{const m=`${l}-suffix`;f=v=>{let{open:_,showSearch:y}=v;return h(_&&y?C.createElement(Iq,{className:m}):C.createElement(Dq,{className:m}))}}let g=null;n!==void 0?g=n:s?g=C.createElement(vme,null):g=null;let p=null;return r!==void 0?p=r:p=C.createElement(Vk,null),{clearIcon:d,suffixIcon:f,itemIcon:g,removeIcon:p}}var bze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,className:r,rootClassName:o,getPopupContainer:s,popupClassName:a,dropdownClassName:l,listHeight:c=256,placement:u,listItemHeight:d=24,size:h,disabled:f,notFoundContent:g,status:p,showArrow:m,builtinPlacements:v}=i,_=bze(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow","builtinPlacements"]);const{getPopupContainer:y,getPrefixCls:S,renderEmpty:L,direction:E,virtual:D,dropdownMatchSelectWidth:k,select:T}=C.useContext(Pn),M=C.useContext(Eh),P=S("select",t),N=S(),{compactSize:R,compactItemClassnames:O}=FS(P,E),[B,$]=gze(P),G=C.useMemo(()=>{const{mode:We}=_;if(We!=="combobox")return We===X_e?"combobox":We},[_.mode]),U=G==="multiple"||G==="tags",j=vze(m),{status:ie,hasFeedback:Y,isFormItemInput:J,feedbackIcon:Q}=C.useContext(Vf),he=P4(ie,p);let ge;g!==void 0?ge=g:G==="combobox"?ge=null:ge=(L==null?void 0:L("Select"))||C.createElement(nX,{componentName:"Select"});const{suffixIcon:ye,itemIcon:be,removeIcon:Ge,clearIcon:nt}=_ze(Object.assign(Object.assign({},_),{multiple:U,hasFeedback:Y,feedbackIcon:Q,showArrow:j,prefixCls:P})),je=cl(_,["suffixIcon","itemIcon"]),_e=De(a||l,{[`${P}-dropdown-${E}`]:E==="rtl"},o,$),Ve=R||h||M,Le=C.useContext(D_),Pe=f??Le,Be=De({[`${P}-lg`]:Ve==="large",[`${P}-sm`]:Ve==="small",[`${P}-rtl`]:E==="rtl",[`${P}-borderless`]:!n,[`${P}-in-form-item`]:J},pp(P,he,Y),O,r,o,$),Qe=C.useMemo(()=>u!==void 0?u:E==="rtl"?"bottomRight":"bottomLeft",[u,E]),Ye=mze(v);return B(C.createElement(eX,Object.assign({ref:e,virtual:D,dropdownMatchSelectWidth:k,showSearch:T==null?void 0:T.showSearch},je,{builtinPlacements:Ye,transitionName:Nb(N,h$e(u),_.transitionName),listHeight:c,listItemHeight:d,mode:G,prefixCls:P,placement:Qe,direction:E,inputIcon:ye,menuItemSelectedIcon:be,removeIcon:Ge,clearIcon:nt,notFoundContent:ge,className:Be,getPopupContainer:s||y,dropdownClassName:_e,showArrow:Y||j,disabled:Pe})))},BS=C.forwardRef(Cze),yze=j_e(BS);BS.SECRET_COMBOBOX_MODE_DO_NOT_USE=X_e;BS.Option=Qq;BS.OptGroup=Zq;BS._InternalPanelDoNotUseOrYouWillBeFired=yze;const A4=BS;function Y_e(){const[,i]=C.useReducer(e=>e+1,0);return i}const Uv=["xxl","xl","lg","md","sm","xs"],wze=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),Sze=i=>{const e=i,t=[].concat(Uv).reverse();return t.forEach((n,r)=>{const o=n.toUpperCase(),s=`screen${o}Min`,a=`screen${o}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(r{const t=new Map;let n=-1,r={};return{matchHandlers:{},dispatch(o){return r=o,t.forEach(s=>s(r)),t.size>=1},subscribe(o){return t.size||this.register(),n+=1,t.set(n,o),o(r),n},unsubscribe(o){t.delete(o),t.size||this.unregister()},unregister(){Object.keys(e).forEach(o=>{const s=e[o],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(o=>{const s=e[o],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[o]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function O4(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=C.useRef({}),t=Y_e(),n=Z_e();return C.useEffect(()=>{const r=n.subscribe(o=>{e.current=o,i&&t()});return()=>n.unsubscribe(r)},[]),e.current}const pH=C.createContext("default"),Ore=i=>{let{children:e,size:t}=i;const n=C.useContext(pH);return C.createElement(pH.Provider,{value:t||n},e)},xze=i=>{const{antCls:e,componentCls:t,iconCls:n,avatarBg:r,avatarColor:o,avatarSizeBase:s,avatarSizeLG:a,avatarSizeSM:l,avatarFontSizeBase:c,avatarFontSizeLG:u,avatarFontSizeSM:d,borderRadius:h,borderRadiusLG:f,borderRadiusSM:g,lineWidth:p,lineType:m}=i,v=(_,y,S)=>({width:_,height:_,lineHeight:`${_-p*2}px`,borderRadius:"50%",[`&${t}-square`]:{borderRadius:S},[`${t}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${t}-icon`]:{fontSize:y,[`> ${n}`]:{margin:0}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-block",overflow:"hidden",color:o,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${p}px ${m} transparent`,["&-image"]:{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),v(s,c,h)),{["&-lg"]:Object.assign({},v(a,u,f)),["&-sm"]:Object.assign({},v(l,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},Lze=i=>{const{componentCls:e,avatarGroupBorderColor:t,avatarGroupSpace:n}=i;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:t},["> *:not(:first-child)"]:{marginInlineStart:n}}}},Q_e=yo("Avatar",i=>{const{colorTextLightSolid:e,controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:a,fontSizeHeading3:l,marginXS:c,colorBorderBg:u,colorTextPlaceholder:d}=i,h=Bi(i,{avatarBg:d,avatarColor:e,avatarSizeBase:t,avatarSizeLG:n,avatarSizeSM:r,avatarFontSizeBase:Math.round((s+a)/2),avatarFontSizeLG:l,avatarFontSizeSM:o,avatarGroupSpace:-c,avatarGroupBorderColor:u});return[xze(h),Lze(h)]});var Eze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(pH),[n,r]=C.useState(1),[o,s]=C.useState(!1),[a,l]=C.useState(!0),c=C.useRef(null),u=C.useRef(null),d=pu(e,c),{getPrefixCls:h}=C.useContext(Pn),f=()=>{if(!u.current||!c.current)return;const he=u.current.offsetWidth,ge=c.current.offsetWidth;if(he!==0&&ge!==0){const{gap:ye=4}=i;ye*2{s(!0)},[]),C.useEffect(()=>{l(!0),r(1)},[i.src]),C.useEffect(()=>{f()},[i.gap]);const g=()=>{const{onError:he}=i;(he?he():void 0)!==!1&&l(!1)},{prefixCls:p,shape:m="circle",size:v="default",src:_,srcSet:y,icon:S,className:L,rootClassName:E,alt:D,draggable:k,children:T,crossOrigin:M}=i,P=Eze(i,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),N=v==="default"?t:v,R=Object.keys(typeof N=="object"?N||{}:{}).some(he=>["xs","sm","md","lg","xl","xxl"].includes(he)),O=O4(R),B=C.useMemo(()=>{if(typeof N!="object")return{};const he=Uv.find(ye=>O[ye]),ge=N[he];return ge?{width:ge,height:ge,lineHeight:`${ge}px`,fontSize:S?ge/2:18}:{}},[O,N]),$=h("avatar",p),[G,U]=Q_e($),j=De({[`${$}-lg`]:N==="large",[`${$}-sm`]:N==="small"}),ie=C.isValidElement(_),Y=De($,j,{[`${$}-${m}`]:!!m,[`${$}-image`]:ie||_&&a,[`${$}-icon`]:!!S},L,E,U),J=typeof N=="number"?{width:N,height:N,lineHeight:`${N}px`,fontSize:S?N/2:18}:{};let Q;if(typeof _=="string"&&a)Q=C.createElement("img",{src:_,draggable:k,srcSet:y,onError:g,alt:D,crossOrigin:M});else if(ie)Q=_;else if(S)Q=S;else if(o||n!==1){const he=`scale(${n}) translateX(-50%)`,ge={msTransform:he,WebkitTransform:he,transform:he},ye=typeof N=="number"?{lineHeight:`${N}px`}:{};Q=C.createElement(Lh,{onResize:f},C.createElement("span",{className:`${$}-string`,ref:u,style:Object.assign(Object.assign({},ye),ge)},T))}else Q=C.createElement("span",{className:`${$}-string`,style:{opacity:0},ref:u},T);return delete P.onError,delete P.gap,G(C.createElement("span",Object.assign({},P,{style:Object.assign(Object.assign(Object.assign({},J),B),P.style),className:Y,ref:d}),Q))},Ize=C.forwardRef(Dze),J_e=Ize;var r1={shiftX:64,adjustY:1},o1={adjustX:1,shiftY:!0},Ru=[0,0],kze={left:{points:["cr","cl"],overflow:o1,offset:[-4,0],targetOffset:Ru},right:{points:["cl","cr"],overflow:o1,offset:[4,0],targetOffset:Ru},top:{points:["bc","tc"],overflow:r1,offset:[0,-4],targetOffset:Ru},bottom:{points:["tc","bc"],overflow:r1,offset:[0,4],targetOffset:Ru},topLeft:{points:["bl","tl"],overflow:r1,offset:[0,-4],targetOffset:Ru},leftTop:{points:["tr","tl"],overflow:o1,offset:[-4,0],targetOffset:Ru},topRight:{points:["br","tr"],overflow:r1,offset:[0,-4],targetOffset:Ru},rightTop:{points:["tl","tr"],overflow:o1,offset:[4,0],targetOffset:Ru},bottomRight:{points:["tr","br"],overflow:r1,offset:[0,4],targetOffset:Ru},rightBottom:{points:["bl","br"],overflow:o1,offset:[4,0],targetOffset:Ru},bottomLeft:{points:["tl","bl"],overflow:r1,offset:[0,4],targetOffset:Ru},leftBottom:{points:["br","bl"],overflow:o1,offset:[-4,0],targetOffset:Ru}};function iX(i){var e=i.children,t=i.prefixCls,n=i.id,r=i.overlayInnerStyle,o=i.className,s=i.style;return C.createElement("div",{className:De("".concat(t,"-content"),o),style:s},C.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:r},typeof e=="function"?e():e))}var Tze=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],Nze=function(e,t){var n=e.overlayClassName,r=e.trigger,o=r===void 0?["hover"]:r,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,m=e.transitionName,v=e.animation,_=e.motion,y=e.placement,S=y===void 0?"right":y,L=e.align,E=L===void 0?{}:L,D=e.destroyTooltipOnHide,k=D===void 0?!1:D,T=e.defaultVisible,M=e.getTooltipContainer,P=e.overlayInnerStyle;e.arrowContent;var N=e.overlay,R=e.id,O=e.showArrow,B=O===void 0?!0:O,$=Mn(e,Tze),G=C.useRef(null);C.useImperativeHandle(t,function(){return G.current});var U=te({},$);"visible"in e&&(U.popupVisible=e.visible);var j=function(){return C.createElement(iX,{key:"content",prefixCls:h,id:R,overlayInnerStyle:P},N)};return C.createElement(F_e,It({popupClassName:n,prefixCls:h,popup:j,action:o,builtinPlacements:kze,popupPlacement:S,ref:G,popupAlign:E,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:m,popupAnimation:v,popupMotion:_,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:B},U),f)};const Rze=C.forwardRef(Nze),e0e=8;function rX(i){const e=e0e,{contentRadius:t,limitVerticalRadius:n}=i,r=t>12?t+2:12;return{dropdownArrowOffset:r,dropdownArrowOffsetVertical:n?e:r}}function yR(i,e){return i?e:{}}function oX(i,e){const{componentCls:t,sizePopupArrow:n,borderRadiusXS:r,borderRadiusOuter:o,boxShadowPopoverArrow:s}=i,{colorBg:a,contentRadius:l=i.borderRadiusLG,limitVerticalRadius:c,arrowDistance:u=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}=e,{dropdownArrowOffsetVertical:h,dropdownArrowOffset:f}=rX({contentRadius:l,limitVerticalRadius:c});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({[`${t}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},J9e(n,r,o,a,s)),{"&:before":{background:a}})]},yR(!!d.top,{[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),yR(!!d.bottom,{[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),yR(!!d.left,{[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:h},[`&-placement-leftBottom ${t}-arrow`]:{bottom:h}})),yR(!!d.right,{[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:h},[`&-placement-rightBottom ${t}-arrow`]:{bottom:h}}))}}function Mze(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const r=n&&typeof n=="object"?n:{},o={};switch(i){case"top":case"bottom":o.shiftX=e.dropdownArrowOffset*2+t;break;case"left":case"right":o.shiftY=e.dropdownArrowOffsetVertical*2+t;break}const s=Object.assign(Object.assign({},o),r);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const Fre={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Pze={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Aze=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function t0e(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:r,borderRadius:o}=i,s=e/2,a={};return Object.keys(Fre).forEach(l=>{const c=n&&Pze[l]||Fre[l],u=Object.assign(Object.assign({},c),{offset:[0,0]});switch(a[l]=u,Aze.has(l)&&(u.autoArrow=!1),l){case"top":case"topLeft":case"topRight":u.offset[1]=-s-r;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=s+r;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-s-r;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=s+r;break}const d=rX({contentRadius:o,limitVerticalRadius:!0});if(n)switch(l){case"topLeft":case"bottomLeft":u.offset[0]=-d.dropdownArrowOffset-s;break;case"topRight":case"bottomRight":u.offset[0]=d.dropdownArrowOffset+s;break;case"leftTop":case"rightTop":u.offset[1]=-d.dropdownArrowOffset-s;break;case"leftBottom":case"rightBottom":u.offset[1]=d.dropdownArrowOffset+s;break}u.overflow=Mze(l,d,e,t)}),a}const um=(i,e)=>new Jr(i).setAlpha(e).toRgbString(),s1=(i,e)=>new Jr(i).lighten(e).toHexString(),Oze=i=>{const e=kp(i,{theme:"dark"});return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[6],6:e[5],7:e[4],8:e[6],9:e[5],10:e[4]}},Fze=(i,e)=>{const t=i||"#000",n=e||"#fff";return{colorBgBase:t,colorTextBase:n,colorText:um(n,.85),colorTextSecondary:um(n,.65),colorTextTertiary:um(n,.45),colorTextQuaternary:um(n,.25),colorFill:um(n,.18),colorFillSecondary:um(n,.12),colorFillTertiary:um(n,.08),colorFillQuaternary:um(n,.04),colorBgElevated:s1(t,12),colorBgContainer:s1(t,8),colorBgLayout:s1(t,0),colorBgSpotlight:s1(t,26),colorBorder:s1(t,26),colorBorderSecondary:s1(t,19)}},Bze=(i,e)=>{const t=Object.keys(Aq).map(r=>{const o=kp(i[r],{theme:"dark"});return new Array(10).fill(1).reduce((s,a,l)=>(s[`${r}-${l+1}`]=o[l],s[`${r}${l+1}`]=o[l],s),{})}).reduce((r,o)=>(r=Object.assign(Object.assign({},r),o),r),{}),n=e??D4(i);return Object.assign(Object.assign(Object.assign({},n),t),Mve(i,{generateColorPalettes:Oze,generateNeutralColorPalettes:Fze}))},Wze=Bze;function $ze(i){const{sizeUnit:e,sizeStep:t}=i,n=t-2;return{sizeXXL:e*(n+10),sizeXL:e*(n+6),sizeLG:e*(n+2),sizeMD:e*(n+2),sizeMS:e*(n+1),size:e*n,sizeSM:e*n,sizeXS:e*(n-1),sizeXXS:e*(n-1)}}const Hze=(i,e)=>{const t=e??D4(i),n=t.fontSizeSM,r=t.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),$ze(e??i)),Pve(n)),{controlHeight:r}),Rve(Object.assign(Object.assign({},t),{controlHeight:r})))},Vze=Hze;function zze(){const[i,e,t]=mC();return{theme:i,token:e,hashId:t}}const n0e={defaultConfig:ZP,defaultSeed:ZP.token,useToken:zze,defaultAlgorithm:D4,darkAlgorithm:Wze,compactAlgorithm:Vze},Uze=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:r,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u,tooltipRadiusOuter:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${c/2}px ${u}px`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:o,boxShadow:l},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:Math.min(o,e0e)}},[`${e}-content`]:{position:"relative"}}),r7e(i,(h,f)=>{let{darkColor:g}=f;return{[`&${e}-${h}`]:{[`${e}-inner`]:{backgroundColor:g},[`${e}-arrow`]:{"--antd-arrow-background-color":g}}}})),{"&-rtl":{direction:"rtl"}})},oX(Bi(i,{borderRadiusOuter:d}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:o,limitVerticalRadius:!0}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},i0e=(i,e)=>yo("Tooltip",n=>{if(e===!1)return[];const{borderRadius:r,colorTextLightSolid:o,colorBgDefault:s,borderRadiusOuter:a}=n,l=Bi(n,{tooltipMaxWidth:250,tooltipColor:o,tooltipBorderRadius:r,tooltipBg:s,tooltipRadiusOuter:a>4?4:a});return[Uze(l),Xk(n,"zoom-big-fast")]},n=>{let{zIndexPopupBase:r,colorBgSpotlight:o}=n;return{zIndexPopup:r+70,colorBgDefault:o}})(i),jze=HD.map(i=>`${i}-inverse`);function Kze(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(gt(jze),gt(HD)).includes(i):HD.includes(i)}function r0e(i,e){const t=Kze(e),n=De({[`${i}-${e}`]:e&&t}),r={},o={};return e&&!t&&(r.background=e,o["--antd-arrow-background-color"]=e),{className:n,overlayStyle:r,arrowStyle:o}}function Gze(i){const{prefixCls:e,className:t,placement:n="top",title:r,color:o,overlayInnerStyle:s}=i,{getPrefixCls:a}=C.useContext(Pn),l=a("tooltip",e),[c,u]=i0e(l,!0),d=r0e(l,o),h=Object.assign(Object.assign({},s),d.overlayStyle),f=d.arrowStyle;return c(C.createElement("div",{className:De(u,l,`${l}-pure`,`${l}-placement-${n}`,t,d.className),style:f},C.createElement("div",{className:`${l}-arrow`}),C.createElement(iX,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:h}),r)))}var qze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t={},n=Object.assign({},i);return e.forEach(r=>{i&&r in i&&(t[r]=i[r],delete n[r])}),{picked:t,omitted:n}};function Zze(i,e){const t=i.type;if((t.__ANT_BUTTON===!0||i.type==="button")&&i.props.disabled||t.__ANT_SWITCH===!0&&(i.props.disabled||i.props.loading)||t.__ANT_RADIO===!0&&i.props.disabled){const{picked:n,omitted:r}=Yze(i.props.style,["position","left","right","top","bottom","float","display","zIndex"]),o=Object.assign(Object.assign({display:"inline-block"},n),{cursor:"not-allowed",width:i.props.block?"100%":void 0}),s=Object.assign(Object.assign({},r),{pointerEvents:"none"}),a=ta(i,{style:s,className:null});return C.createElement("span",{style:o,className:De(i.props.className,`${e}-disabled-compatible-wrapper`)},a)}return i}const o0e=C.forwardRef((i,e)=>{var t,n;const{prefixCls:r,openClassName:o,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:m,builtinPlacements:v,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,S=!!g,{token:L}=Xze(),{getPopupContainer:E,getPrefixCls:D,direction:k}=C.useContext(Pn),T=C.useRef(null),M=()=>{var We;(We=T.current)===null||We===void 0||We.forceAlign()};C.useImperativeHandle(e,()=>({forceAlign:M,forcePopupAlign:()=>{M()}}));const[P,N]=nl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),R=!p&&!m&&p!==0,O=We=>{var dt,re;N(R?!1:We),R||((dt=i.onOpenChange)===null||dt===void 0||dt.call(i,We),(re=i.onVisibleChange)===null||re===void 0||re.call(i,We))},B=C.useMemo(()=>{var We,dt;let re=_;return typeof g=="object"&&(re=(dt=(We=g.pointAtCenter)!==null&&We!==void 0?We:g.arrowPointAtCenter)!==null&&dt!==void 0?dt:_),v||t0e({arrowPointAtCenter:re,autoAdjustOverflow:y,arrowWidth:S?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS})},[_,g,v,L]),$=(We,dt)=>{const re=Object.keys(B).find(ue=>{var de,z;return B[ue].points[0]===((de=dt.points)===null||de===void 0?void 0:de[0])&&B[ue].points[1]===((z=dt.points)===null||z===void 0?void 0:z[1])});if(re){const ue=We.getBoundingClientRect(),de={top:"50%",left:"50%"};/top|Bottom/.test(re)?de.top=`${ue.height-dt.offset[1]}px`:/Top|bottom/.test(re)&&(de.top=`${-dt.offset[1]}px`),/left|Right/.test(re)?de.left=`${ue.width-dt.offset[0]}px`:/right|Left/.test(re)&&(de.left=`${-dt.offset[0]}px`),We.style.transformOrigin=`${de.left} ${de.top}`}},G=C.useMemo(()=>p===0?p:m||p||"",[m,p]),{getPopupContainer:U,placement:j="top",mouseEnterDelay:ie=.1,mouseLeaveDelay:Y=.1,overlayStyle:J,rootClassName:Q}=i,he=qze(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),ge=D("tooltip",r),ye=D(),be=i["data-popover-inject"];let Ge=P;!("open"in i)&&!("visible"in i)&&R&&(Ge=!1);const nt=Zze(uh(u)&&!Yve(u)?u:C.createElement("span",null,u),ge),je=nt.props,_e=!je.className||typeof je.className=="string"?De(je.className,{[o||`${ge}-open`]:!0}):je.className,[Ve,Le]=i0e(ge,!be),Pe=r0e(ge,l),Be=Object.assign(Object.assign({},c),Pe.overlayStyle),Qe=Pe.arrowStyle,Ye=De(a,{[`${ge}-rtl`]:k==="rtl"},Pe.className,Q,Le);return Ve(C.createElement(Rze,Object.assign({},he,{showArrow:S,placement:j,mouseEnterDelay:ie,mouseLeaveDelay:Y,prefixCls:ge,overlayClassName:Ye,overlayStyle:Object.assign(Object.assign({},Qe),J),getTooltipContainer:U||s||E,ref:T,builtinPlacements:B,overlay:G,visible:Ge,onVisibleChange:O,afterVisibleChange:d??h,onPopupAlign:$,overlayInnerStyle:Be,arrowContent:C.createElement("span",{className:`${ge}-arrow-content`}),motion:{motionName:Nb(ye,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Ge?ta(nt,{className:_e}):nt))});o0e._InternalPanelDoNotUseOrYouWillBeFired=Gze;const Qk=o0e,aA=i=>i?typeof i=="function"?i():i:null,Qze=i=>{const{componentCls:e,popoverBg:t,popoverColor:n,width:r,fontWeightStrong:o,popoverPadding:s,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:c,zIndexPopup:u,marginXS:d,colorBgElevated:h}=i;return[{[e]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--antd-arrow-background-color":h,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:t,backgroundClip:"padding-box",borderRadius:c,boxShadow:a,padding:s},[`${e}-title`]:{minWidth:r,marginBottom:d,color:l,fontWeight:o},[`${e}-inner-content`]:{color:n}})},oX(i,{colorBg:"var(--antd-arrow-background-color)"}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},Jze=i=>{const{componentCls:e}=i;return{[e]:HD.map(t=>{const n=i[`${t}6`];return{[`&${e}-${t}`]:{"--antd-arrow-background-color":n,[`${e}-inner`]:{backgroundColor:n},[`${e}-arrow`]:{background:"transparent"}}}})}},eUe=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorSplit:r,paddingSM:o,controlHeight:s,fontSize:a,lineHeight:l,padding:c}=i,u=s-Math.round(a*l),d=u/2,h=u/2-t,f=c;return{[e]:{[`${e}-inner`]:{padding:0},[`${e}-title`]:{margin:0,padding:`${d}px ${f}px ${h}px`,borderBottom:`${t}px ${n} ${r}`},[`${e}-inner-content`]:{padding:`${o}px ${f}px`}}}},s0e=yo("Popover",i=>{const{colorBgElevated:e,colorText:t,wireframe:n}=i,r=Bi(i,{popoverBg:e,popoverColor:t,popoverPadding:12});return[Qze(r),Jze(r),n&&eUe(r),Xk(r,"zoom-big")]},i=>{let{zIndexPopupBase:e}=i;return{zIndexPopup:e+30,width:177}});var tUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(!(!e&&!t))return C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${i}-title`},aA(e)),C.createElement("div",{className:`${i}-inner-content`},aA(t)))};function iUe(i){const{hashId:e,prefixCls:t,className:n,style:r,placement:o="top",title:s,content:a,children:l}=i;return C.createElement("div",{className:De(e,t,`${t}-pure`,`${t}-placement-${o}`,n),style:r},C.createElement("div",{className:`${t}-arrow`}),C.createElement(iX,Object.assign({},i,{className:e,prefixCls:t}),l||nUe(t,s,a)))}function rUe(i){const{prefixCls:e}=i,t=tUe(i,["prefixCls"]),{getPrefixCls:n}=C.useContext(Pn),r=n("popover",e),[o,s]=s0e(r);return o(C.createElement(iUe,Object.assign({},t,{prefixCls:r,hashId:s})))}var oUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{title:e,content:t,prefixCls:n}=i;return!e&&!t?null:C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${n}-title`},aA(e)),C.createElement("div",{className:`${n}-inner-content`},aA(t)))},a0e=C.forwardRef((i,e)=>{const{prefixCls:t,title:n,content:r,overlayClassName:o,placement:s="top",trigger:a="hover",mouseEnterDelay:l=.1,mouseLeaveDelay:c=.1,overlayStyle:u={}}=i,d=oUe(i,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:h}=C.useContext(Pn),f=h("popover",t),[g,p]=s0e(f),m=h(),v=De(o,p);return g(C.createElement(Qk,Object.assign({placement:s,trigger:a,mouseEnterDelay:l,mouseLeaveDelay:c,overlayStyle:u},d,{prefixCls:f,overlayClassName:v,ref:e,overlay:C.createElement(sUe,{prefixCls:f,title:n,content:r}),transitionName:Nb(m,"zoom-big",d.transitionName),"data-popover-inject":!0})))});a0e._InternalPanelDoNotUseOrYouWillBeFired=rUe;const aUe=a0e,lUe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,className:r,rootClassName:o,maxCount:s,maxStyle:a,size:l}=i,c=e("avatar",n),u=`${c}-group`,[d,h]=Q_e(c),f=De(u,{[`${u}-rtl`]:t==="rtl"},r,o,h),{children:g,maxPopoverPlacement:p="top",maxPopoverTrigger:m="hover"}=i,v=od(g).map((y,S)=>ta(y,{key:`avatar-key-${S}`})),_=v.length;if(s&&s<_){const y=v.slice(0,s),S=v.slice(s,_);return y.push(C.createElement(aUe,{key:"avatar-popover-key",content:S,trigger:m,placement:p,overlayClassName:`${u}-popover`},C.createElement(J_e,{style:a},`+${_-s}`))),d(C.createElement(Ore,{size:l},C.createElement("div",{className:f,style:i.style},y)))}return d(C.createElement(Ore,{size:l},C.createElement("div",{className:f,style:i.style},v)))},cUe=lUe,l0e=J_e;l0e.Group=cUe;const uUe=l0e;var dUe=C.forwardRef(function(i,e){var t=i.didUpdate,n=i.getContainer,r=i.children,o=C.useRef(),s=C.useRef();C.useImperativeHandle(e,function(){return{}});var a=C.useRef(!1);return!a.current&&ea()&&(s.current=n(),o.current=s.current.parentNode,a.current=!0),C.useEffect(function(){t==null||t(i)}),C.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var l,c;(l=s.current)===null||l===void 0||(c=l.parentNode)===null||c===void 0||c.removeChild(s.current)}},[]),s.current?kw.createPortal(r,s.current):null});function hUe(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function fUe(i,e,t){var n=i[e]||{};return te(te({},n),t)}function gUe(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function BUe(i,e,t,n){var r=ni.clone(i),o={width:e.width,height:e.height};return n.adjustX&&r.left=t.left&&r.left+o.width>t.right&&(o.width-=r.left+o.width-t.right),n.adjustX&&r.left+o.width>t.right&&(r.left=Math.max(t.right-o.width,t.left)),n.adjustY&&r.top=t.top&&r.top+o.height>t.bottom&&(o.height-=r.top+o.height-t.bottom),n.adjustY&&r.top+o.height>t.bottom&&(r.top=Math.max(t.bottom-o.height,t.top)),ni.mix(r,o)}function cX(i){var e,t,n;if(!ni.isWindow(i)&&i.nodeType!==9)e=ni.offset(i),t=ni.outerWidth(i),n=ni.outerHeight(i);else{var r=ni.getWindow(i);e={left:ni.getWindowScrollLeft(r),top:ni.getWindowScrollTop(r)},t=ni.viewportWidth(r),n=ni.viewportHeight(r)}return e.width=t,e.height=n,e}function Gre(i,e){var t=e.charAt(0),n=e.charAt(1),r=i.width,o=i.height,s=i.left,a=i.top;return t==="c"?a+=o/2:t==="b"&&(a+=o),n==="c"?s+=r/2:n==="r"&&(s+=r),{left:s,top:a}}function SR(i,e,t,n,r){var o=Gre(e,t[1]),s=Gre(i,t[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-r[0]),top:Math.round(i.top-a[1]+n[1]-r[1])}}function qre(i,e,t){return i.leftt.right}function Xre(i,e,t){return i.topt.bottom}function WUe(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function uX(i,e,t){var n=t.target||e,r=cX(n),o=!HUe(n,t.overflow&&t.overflow.alwaysByViewport);return v0e(i,r,t,o)}uX.__getOffsetParent=bH;uX.__getVisibleRectForElement=lX;function VUe(i,e,t){var n,r,o=ni.getDocument(i),s=o.defaultView||o.parentWindow,a=ni.getWindowScrollLeft(s),l=ni.getWindowScrollTop(s),c=ni.viewportWidth(s),u=ni.viewportHeight(s);"pageX"in e?n=e.pageX:n=a+e.clientX,"pageY"in e?r=e.pageY:r=l+e.clientY;var d={left:n,top:r,width:0,height:0},h=n>=0&&n<=a+c&&r>=0&&r<=l+u,f=[t.points[0],"cc"];return v0e(i,d,Wre(Wre({},t),{},{points:f}),h)}const zUe=function(i,e){var t=qe.useRef(!1),n=qe.useRef(null);function r(){window.clearTimeout(n.current)}function o(s){if(r(),!t.current||s===!0){if(i(s)===!1)return;t.current=!0,n.current=window.setTimeout(function(){t.current=!1},e)}else n.current=window.setTimeout(function(){t.current=!1,o()},e)}return[o,function(){t.current=!1,r()}]};function UUe(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function jUe(i,e){i!==document.activeElement&&sb(e,i)&&typeof i.focus=="function"&&i.focus()}function Qre(i,e){var t=null,n=null;function r(s){var a=$e(s,1),l=a[0].target;if(document.documentElement.contains(l)){var c=l.getBoundingClientRect(),u=c.width,d=c.height,h=Math.floor(u),f=Math.floor(d);(t!==h||n!==f)&&Promise.resolve().then(function(){e({width:h,height:f})}),t=h,n=f}}var o=new sve(r);return i&&o.observe(i),function(){o.disconnect()}}function Jre(i){return typeof i!="function"?null:i()}function eoe(i){return Un(i)!=="object"||!i?null:i}var KUe=function(e,t){var n=e.children,r=e.disabled,o=e.target,s=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=c===void 0?0:c,d=qe.useRef({}),h=qe.useRef(),f=qe.Children.only(n),g=qe.useRef({});g.current.disabled=r,g.current.target=o,g.current.align=s,g.current.onAlign=a;var p=zUe(function(){var P=g.current,N=P.disabled,R=P.target,O=P.align,B=P.onAlign,$=h.current;if(!N&&R&&$){var G,U=Jre(R),j=eoe(R);d.current.element=U,d.current.point=j,d.current.align=O;var ie=document,Y=ie.activeElement;return U&&qk(U)?G=uX($,U,O):j&&(G=VUe($,j,O)),jUe(Y,$),B&&G&&B($,G),!0}return!1},u),m=$e(p,2),v=m[0],_=m[1],y=qe.useState(),S=$e(y,2),L=S[0],E=S[1],D=qe.useState(),k=$e(D,2),T=k[0],M=k[1];return Cr(function(){E(Jre(o)),M(eoe(o))}),qe.useEffect(function(){(d.current.element!==L||!UUe(d.current.point,T)||!Tp(d.current.align,s))&&v()}),qe.useEffect(function(){var P=Qre(h.current,v);return P},[h.current]),qe.useEffect(function(){var P=Qre(L,v);return P},[L]),qe.useEffect(function(){r?_():v()},[r]),qe.useEffect(function(){if(l){var P=Zg(window,"resize",v);return P.remove}},[l]),qe.useEffect(function(){return function(){_()}},[]),qe.useImperativeHandle(t,function(){return{forceAlign:function(){return v(!0)}}}),qe.isValidElement(f)&&(f=qe.cloneElement(f,{ref:pu(f.ref,h)})),f},_0e=qe.forwardRef(KUe);_0e.displayName="Align";var toe=["measure","alignPre","align",null,"motion"];const GUe=function(i,e){var t=Cv(null),n=$e(t,2),r=n[0],o=n[1],s=C.useRef();function a(u){o(u,!0)}function l(){er.cancel(s.current)}function c(u){l(),s.current=er(function(){a(function(d){switch(r){case"align":return"motion";case"motion":return"stable"}return d}),u==null||u()})}return C.useEffect(function(){a("measure")},[i]),C.useEffect(function(){switch(r){case"measure":e();break}r&&(s.current=er(pC(Nl().mark(function u(){var d,h;return Nl().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:d=toe.indexOf(r),h=toe[d+1],h&&d!==-1&&a(h);case 3:case"end":return g.stop()}},u)}))))},[r]),C.useEffect(function(){return function(){l()}},[]),[r,c]},qUe=function(i){var e=C.useState({width:0,height:0}),t=$e(e,2),n=t[0],r=t[1];function o(a){var l=a.offsetWidth,c=a.offsetHeight,u=a.getBoundingClientRect(),d=u.width,h=u.height;Math.abs(l-d)<1&&Math.abs(c-h)<1&&(l=d,c=h),r({width:l,height:c})}var s=C.useMemo(function(){var a={};if(i){var l=n.width,c=n.height;i.indexOf("height")!==-1&&c?a.height=c:i.indexOf("minHeight")!==-1&&c&&(a.minHeight=c),i.indexOf("width")!==-1&&l?a.width=l:i.indexOf("minWidth")!==-1&&l&&(a.minWidth=l)}return a},[i,n]);return[s,o]};var b0e=C.forwardRef(function(i,e){var t=i.visible,n=i.prefixCls,r=i.className,o=i.style,s=i.children,a=i.zIndex,l=i.stretch,c=i.destroyPopupOnHide,u=i.forceRender,d=i.align,h=i.point,f=i.getRootDomNode,g=i.getClassNameFromAlign,p=i.onAlign,m=i.onMouseEnter,v=i.onMouseLeave,_=i.onMouseDown,y=i.onTouchStart,S=i.onClick,L=C.useRef(),E=C.useRef(),D=C.useState(),k=$e(D,2),T=k[0],M=k[1],P=qUe(l),N=$e(P,2),R=N[0],O=N[1];function B(){l&&O(f())}var $=GUe(t,B),G=$e($,2),U=G[0],j=G[1],ie=C.useState(0),Y=$e(ie,2),J=Y[0],Q=Y[1],he=C.useRef();Cr(function(){U==="alignPre"&&Q(0)},[U]);function ge(){return h||f}function ye(){var Le;(Le=L.current)===null||Le===void 0||Le.forceAlign()}function be(Le,Pe){var Be=g(Pe);T!==Be&&M(Be),Q(function(Qe){return Qe+1}),U==="align"&&(p==null||p(Le,Pe))}Cr(function(){U==="align"&&(J<3?ye():j(function(){var Le;(Le=he.current)===null||Le===void 0||Le.call(he)}))},[J]);var Ge=te({},c0e(i));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Le){var Pe=Ge[Le];Ge[Le]=function(Be,Qe){return j(),Pe==null?void 0:Pe(Be,Qe)}});function nt(){return new Promise(function(Le){he.current=Le})}C.useEffect(function(){!Ge.motionName&&U==="motion"&&j()},[Ge.motionName,U]),C.useImperativeHandle(e,function(){return{forceAlign:ye,getElement:function(){return E.current}}});var je=te(te({},R),{},{zIndex:a,opacity:U==="motion"||U==="stable"||!t?void 0:0,pointerEvents:!t&&U!=="stable"?"none":void 0},o),_e=!0;d!=null&&d.points&&(U==="align"||U==="stable")&&(_e=!1);var Ve=s;return C.Children.count(s)>1&&(Ve=C.createElement("div",{className:"".concat(n,"-content")},s)),C.createElement(hd,It({visible:t,ref:E,leavedClassName:"".concat(n,"-hidden")},Ge,{onAppearPrepare:nt,onEnterPrepare:nt,removeOnLeave:c,forceRender:u}),function(Le,Pe){var Be=Le.className,Qe=Le.style,Ye=De(n,r,T,Be);return C.createElement(_0e,{target:ge(),key:"popup",ref:L,monitorWindowResize:!0,disabled:_e,align:d,onAlign:be},C.createElement("div",{ref:Pe,className:Ye,onMouseEnter:m,onMouseLeave:v,onMouseDownCapture:_,onTouchStartCapture:y,onClick:S,style:te(te({},Qe),je)},Ve))})});b0e.displayName="PopupInner";var C0e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.visible,r=i.zIndex,o=i.children,s=i.mobile;s=s===void 0?{}:s;var a=s.popupClassName,l=s.popupStyle,c=s.popupMotion,u=c===void 0?{}:c,d=s.popupRender,h=i.onClick,f=C.useRef();C.useImperativeHandle(e,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var g=te({zIndex:r},l),p=o;return C.Children.count(o)>1&&(p=C.createElement("div",{className:"".concat(t,"-content")},o)),d&&(p=d(p)),C.createElement(hd,It({visible:n,ref:f,removeOnLeave:!0},u),function(m,v){var _=m.className,y=m.style,S=De(t,a,_);return C.createElement("div",{ref:v,className:S,onClick:h,style:te(te({},y),g)},p)})});C0e.displayName="MobilePopupInner";var XUe=["visible","mobile"],y0e=C.forwardRef(function(i,e){var t=i.visible,n=i.mobile,r=Mn(i,XUe),o=C.useState(t),s=$e(o,2),a=s[0],l=s[1],c=C.useState(!1),u=$e(c,2),d=u[0],h=u[1],f=te(te({},r),{},{visible:a});C.useEffect(function(){l(t),t&&n&&h(M4())},[t,n]);var g=d?C.createElement(C0e,It({},f,{mobile:n,ref:e})):C.createElement(b0e,It({},f,{ref:e}));return C.createElement("div",null,C.createElement(pUe,f),g)});y0e.displayName="Popup";var noe=C.createContext(null);function B6(){}function YUe(){return""}function ZUe(i){return i?i.ownerDocument:window.document}var QUe=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function JUe(i){var e=function(t){Sh(r,t);var n=xh(r);function r(o){var s;bs(this,r),s=n.call(this,o),we(zn(s),"popupRef",C.createRef()),we(zn(s),"triggerRef",C.createRef()),we(zn(s),"portalContainer",void 0),we(zn(s),"attachId",void 0),we(zn(s),"clickOutsideHandler",void 0),we(zn(s),"touchOutsideHandler",void 0),we(zn(s),"contextMenuOutsideHandler1",void 0),we(zn(s),"contextMenuOutsideHandler2",void 0),we(zn(s),"mouseDownTimeout",void 0),we(zn(s),"focusTime",void 0),we(zn(s),"preClickTime",void 0),we(zn(s),"preTouchTime",void 0),we(zn(s),"delayTimer",void 0),we(zn(s),"hasPopupMouseDown",void 0),we(zn(s),"onMouseEnter",function(l){var c=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",l),s.delaySetPopupVisible(!0,c,c?null:l)}),we(zn(s),"onMouseMove",function(l){s.fireEvents("onMouseMove",l),s.setPoint(l)}),we(zn(s),"onMouseLeave",function(l){s.fireEvents("onMouseLeave",l),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),we(zn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),we(zn(s),"onPopupMouseLeave",function(l){var c;l.relatedTarget&&!l.relatedTarget.setTimeout&&sb((c=s.popupRef.current)===null||c===void 0?void 0:c.getElement(),l.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),we(zn(s),"onFocus",function(l){s.fireEvents("onFocus",l),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),we(zn(s),"onMouseDown",function(l){s.fireEvents("onMouseDown",l),s.preClickTime=Date.now()}),we(zn(s),"onTouchStart",function(l){s.fireEvents("onTouchStart",l),s.preTouchTime=Date.now()}),we(zn(s),"onBlur",function(l){s.fireEvents("onBlur",l),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),we(zn(s),"onContextMenu",function(l){l.preventDefault(),s.fireEvents("onContextMenu",l),s.setPopupVisible(!0,l)}),we(zn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),we(zn(s),"onClick",function(l){if(s.fireEvents("onClick",l),s.focusTime){var c;if(s.preClickTime&&s.preTouchTime?c=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?c=s.preClickTime:s.preTouchTime&&(c=s.preTouchTime),Math.abs(c-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&l&&l.preventDefault&&l.preventDefault();var u=!s.state.popupVisible;(s.isClickToHide()&&!u||u&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,l)}),we(zn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var l;(l=s.context).onPopupMouseDown.apply(l,arguments)}}),we(zn(s),"onDocumentClick",function(l){if(!(s.props.mask&&!s.props.maskClosable)){var c=l.target,u=s.getRootDomNode(),d=s.getPopupDomNode();(!sb(u,c)||s.isContextMenuOnly())&&!sb(d,c)&&!s.hasPopupMouseDown&&s.close()}}),we(zn(s),"getRootDomNode",function(){var l=s.props.getTriggerDOMNode;if(l)return l(s.triggerRef.current);try{var c=FD(s.triggerRef.current);if(c)return c}catch{}return kw.findDOMNode(zn(s))}),we(zn(s),"getPopupClassNameFromAlign",function(l){var c=[],u=s.props,d=u.popupPlacement,h=u.builtinPlacements,f=u.prefixCls,g=u.alignPoint,p=u.getPopupClassNameFromAlign;return d&&h&&c.push(gUe(h,f,l,g)),p&&c.push(p(l)),c.join(" ")}),we(zn(s),"getComponent",function(){var l=s.props,c=l.prefixCls,u=l.destroyPopupOnHide,d=l.popupClassName,h=l.onPopupAlign,f=l.popupMotion,g=l.popupAnimation,p=l.popupTransitionName,m=l.popupStyle,v=l.mask,_=l.maskAnimation,y=l.maskTransitionName,S=l.maskMotion,L=l.zIndex,E=l.popup,D=l.stretch,k=l.alignPoint,T=l.mobile,M=l.forceRender,P=l.onPopupClick,N=s.state,R=N.popupVisible,O=N.point,B=s.getPopupAlign(),$={};return s.isMouseEnterToShow()&&($.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&($.onMouseLeave=s.onPopupMouseLeave),$.onMouseDown=s.onPopupMouseDown,$.onTouchStart=s.onPopupMouseDown,C.createElement(y0e,It({prefixCls:c,destroyPopupOnHide:u,visible:R,point:k&&O,className:d,align:B,onAlign:h,animation:g,getClassNameFromAlign:s.getPopupClassNameFromAlign},$,{stretch:D,getRootDomNode:s.getRootDomNode,style:m,mask:v,zIndex:L,transitionName:p,maskAnimation:_,maskTransitionName:y,maskMotion:S,ref:s.popupRef,motion:f,mobile:T,forceRender:M,onClick:P}),typeof E=="function"?E():E)}),we(zn(s),"attachParent",function(l){er.cancel(s.attachId);var c=s.props,u=c.getPopupContainer,d=c.getDocument,h=s.getRootDomNode(),f;u?(h||u.length===0)&&(f=u(h)):f=d(s.getRootDomNode()).body,f?f.appendChild(l):s.attachId=er(function(){s.attachParent(l)})}),we(zn(s),"getContainer",function(){if(!s.portalContainer){var l=s.props.getDocument,c=l(s.getRootDomNode()).createElement("div");c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width="100%",s.portalContainer=c}return s.attachParent(s.portalContainer),s.portalContainer}),we(zn(s),"setPoint",function(l){var c=s.props.alignPoint;!c||!l||s.setState({point:{pageX:l.pageX,pageY:l.pageY}})}),we(zn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),we(zn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},QUe.forEach(function(l){s["fire".concat(l)]=function(c){s.fireEvents(l,c)}}),s}return Cs(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var l;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(l=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Zg(l,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(l=l||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Zg(l,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(l=l||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Zg(l,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Zg(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),er.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,l=s.popupAlign,c=s.builtinPlacements;return a&&c?fUe(c,a,l):l}},{key:"setPopupVisible",value:function(s,a){var l=this.props.alignPoint,c=this.state.popupVisible;this.clearDelayTimer(),c!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:c}),this.props.onPopupVisibleChange(s)),l&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,l){var c=this,u=a*1e3;if(this.clearDelayTimer(),u){var d=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout(function(){c.setPopupVisible(s,d),c.clearDelayTimer()},u)}else this.setPopupVisible(s,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,l=this.props;return a[s]&&l[s]?this["fire".concat(s)]:a[s]||l[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("contextMenu")!==-1||l.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("hover")!==-1||l.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("hover")!==-1||l.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("focus")!==-1||l.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("focus")!==-1||l.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var l=this.props.children.props[s];l&&l(a);var c=this.props[s];c&&c(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,l=a.children,c=a.forceRender,u=a.alignPoint,d=a.className,h=a.autoDestroy,f=C.Children.only(l),g={key:"trigger"};this.isContextMenuToShow()?g.onContextMenu=this.onContextMenu:g.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(g.onClick=this.onClick,g.onMouseDown=this.onMouseDown,g.onTouchStart=this.onTouchStart):(g.onClick=this.createTwoChains("onClick"),g.onMouseDown=this.createTwoChains("onMouseDown"),g.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(g.onMouseEnter=this.onMouseEnter,u&&(g.onMouseMove=this.onMouseMove)):g.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?g.onMouseLeave=this.onMouseLeave:g.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(g.onFocus=this.onFocus,g.onBlur=this.onBlur):(g.onFocus=this.createTwoChains("onFocus"),g.onBlur=this.createTwoChains("onBlur"));var p=De(f&&f.props&&f.props.className,d);p&&(g.className=p);var m=te({},g);E_(f)&&(m.ref=pu(this.triggerRef,f.ref));var v=C.cloneElement(f,m),_;return(s||this.popupRef.current||c)&&(_=C.createElement(i,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!s&&h&&(_=null),C.createElement(noe.Provider,{value:this.triggerContextValue},v,_)}}],[{key:"getDerivedStateFromProps",value:function(s,a){var l=s.popupVisible,c={};return l!==void 0&&a.popupVisible!==l&&(c.popupVisible=l,c.prevPopupVisible=a.popupVisible),c}}]),r}(C.Component);return we(e,"contextType",noe),we(e,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:YUe,getDocument:ZUe,onPopupVisibleChange:B6,afterPopupVisibleChange:B6,onPopupAlign:B6,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),e}const w0e=JUe(dUe);var a1={adjustX:1,adjustY:1},l1=[0,0],eje={topLeft:{points:["bl","tl"],overflow:a1,offset:[0,-4],targetOffset:l1},topCenter:{points:["bc","tc"],overflow:a1,offset:[0,-4],targetOffset:l1},topRight:{points:["br","tr"],overflow:a1,offset:[0,-4],targetOffset:l1},bottomLeft:{points:["tl","bl"],overflow:a1,offset:[0,4],targetOffset:l1},bottomCenter:{points:["tc","bc"],overflow:a1,offset:[0,4],targetOffset:l1},bottomRight:{points:["tr","br"],overflow:a1,offset:[0,4],targetOffset:l1}};function ioe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(qk(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),r=i.getAttribute("tabindex"),o=Number(r),s=null;return r&&!Number.isNaN(o)?s=o:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function S0e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=gt(i.querySelectorAll("*")).filter(function(n){return ioe(n,e)});return ioe(i,e)&&t.unshift(i),t}var tje=_t.ESC,nje=_t.TAB;function ije(i){var e=i.visible,t=i.setTriggerVisible,n=i.triggerRef,r=i.onVisibleChange,o=i.autoFocus,s=C.useRef(!1),a=function(){if(e&&n.current){var d,h,f,g;(d=n.current)===null||d===void 0||(h=d.triggerRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.focus)===null||g===void 0||g.call(f),t(!1),typeof r=="function"&&r(!1)}},l=function(){var d,h,f,g,p=S0e((d=n.current)===null||d===void 0||(h=d.popupRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.getElement)===null||g===void 0?void 0:g.call(f)),m=p[0];return m!=null&&m.focus?(m.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case tje:a();break;case nje:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};C.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&er(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var rje=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"];function oje(i,e){var t=i.arrow,n=t===void 0?!1:t,r=i.prefixCls,o=r===void 0?"rc-dropdown":r,s=i.transitionName,a=i.animation,l=i.align,c=i.placement,u=c===void 0?"bottomLeft":c,d=i.placements,h=d===void 0?eje:d,f=i.getPopupContainer,g=i.showAction,p=i.hideAction,m=i.overlayClassName,v=i.overlayStyle,_=i.visible,y=i.trigger,S=y===void 0?["hover"]:y,L=i.autoFocus,E=Mn(i,rje),D=C.useState(),k=$e(D,2),T=k[0],M=k[1],P="visible"in i?_:T,N=C.useRef(null);C.useImperativeHandle(e,function(){return N.current}),ije({visible:P,setTriggerVisible:M,triggerRef:N,onVisibleChange:i.onVisibleChange,autoFocus:L});var R=function(){var Q=i.overlay,he;return typeof Q=="function"?he=Q():he=Q,he},O=function(Q){var he=i.onOverlayClick;M(!1),he&&he(Q)},B=function(Q){var he=i.onVisibleChange;M(Q),typeof he=="function"&&he(Q)},$=function(){var Q=R();return C.createElement(C.Fragment,null,n&&C.createElement("div",{className:"".concat(o,"-arrow")}),Q)},G=function(){var Q=i.overlay;return typeof Q=="function"?$:$()},U=function(){var Q=i.minOverlayWidthMatchTrigger,he=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Q:!he},j=function(){var Q=i.openClassName;return Q!==void 0?Q:"".concat(o,"-open")},ie=function(){var Q=i.children,he=Q.props?Q.props:{},ge=De(he.className,j());return P&&Q?C.cloneElement(Q,{className:ge}):Q},Y=p;return!Y&&S.indexOf("contextMenu")!==-1&&(Y=["click"]),C.createElement(w0e,te(te({builtinPlacements:h},E),{},{prefixCls:o,ref:N,popupClassName:De(m,we({},"".concat(o,"-show-arrow"),n)),popupStyle:v,action:S,showAction:g,hideAction:Y||[],popupPlacement:u,popupAlign:l,popupTransitionName:s,popupAnimation:a,popupVisible:P,stretch:U()?"minWidth":"",popup:G(),onPopupVisibleChange:B,onPopupClick:O,getPopupContainer:f}),ie())}const sje=C.forwardRef(oje);var x0e=C.createContext(null);function dX(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function L0e(i){var e=C.useContext(x0e);return dX(e,i)}var aje=["children","locked"],dh=C.createContext(null);function lje(i,e){var t=te({},i);return Object.keys(e).forEach(function(n){var r=e[n];r!==void 0&&(t[n]=r)}),t}function KD(i){var e=i.children,t=i.locked,n=Mn(i,aje),r=C.useContext(dh),o=gC(function(){return lje(r,n)},[r,n],function(s,a){return!t&&(s[0]!==a[0]||!Tp(s[1],a[1],!0))});return C.createElement(dh.Provider,{value:o},e)}var cje=[],E0e=C.createContext(null);function B4(){return C.useContext(E0e)}var D0e=C.createContext(cje);function WS(i){var e=C.useContext(D0e);return C.useMemo(function(){return i!==void 0?[].concat(gt(e),[i]):e},[e,i])}var I0e=C.createContext(null),hX=C.createContext({}),CH=_t.LEFT,yH=_t.RIGHT,wH=_t.UP,SM=_t.DOWN,xM=_t.ENTER,k0e=_t.ESC,Kx=_t.HOME,Gx=_t.END,roe=[wH,SM,CH,yH];function uje(i,e,t,n){var r,o,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===xM)return{inlineTrigger:!0};var h=(r={},we(r,wH,l),we(r,SM,c),r),f=(o={},we(o,CH,t?c:l),we(o,yH,t?l:c),we(o,SM,u),we(o,xM,u),o),g=(s={},we(s,wH,l),we(s,SM,c),we(s,xM,u),we(s,k0e,d),we(s,CH,t?u:d),we(s,yH,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},m=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(m){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function dje(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function hje(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function T0e(i,e){var t=S0e(i,!0);return t.filter(function(n){return e.has(n)})}function ooe(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var r=T0e(i,e),o=r.length,s=r.findIndex(function(a){return t===a});return n<0?s===-1?s=o-1:s-=1:n>0&&(s+=1),s=(s+o)%o,r[s]}function fje(i,e,t,n,r,o,s,a,l,c){var u=C.useRef(),d=C.useRef();d.current=e;var h=function(){er.cancel(u.current)};return C.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(roe,[xM,k0e,Kx,Gx]).includes(g)){var p,m,v,_=function(){p=new Set,m=new Map,v=new Map;var B=o();return B.forEach(function($){var G=document.querySelector("[data-menu-id='".concat(dX(n,$),"']"));G&&(p.add(G),v.set(G,$),m.set($,G))}),p};_();var y=m.get(e),S=hje(y,p),L=v.get(S),E=uje(i,s(L,!0).length===1,t,g);if(!E&&g!==Kx&&g!==Gx)return;(roe.includes(g)||[Kx,Gx].includes(g))&&f.preventDefault();var D=function(B){if(B){var $=B,G=B.querySelector("a");G!=null&&G.getAttribute("href")&&($=G);var U=v.get(B);a(U),h(),u.current=er(function(){d.current===U&&$.focus()})}};if([Kx,Gx].includes(g)||E.sibling||!S){var k;!S||i==="inline"?k=r.current:k=dje(S);var T,M=T0e(k,p);g===Kx?T=M[0]:g===Gx?T=M[M.length-1]:T=ooe(k,p,S,E.offset),D(T)}else if(E.inlineTrigger)l(L);else if(E.offset>0)l(L,!0),h(),u.current=er(function(){_();var O=S.getAttribute("aria-controls"),B=document.getElementById(O),$=ooe(B,p);D($)},5);else if(E.offset<0){var P=s(L,!0),N=P[P.length-2],R=m.get(N);l(N,!1),D(R)}}c==null||c(f)}}function gje(i){Promise.resolve().then(i)}var fX="__RC_UTIL_PATH_SPLIT__",soe=function(e){return e.join(fX)},pje=function(e){return e.split(fX)},SH="rc-menu-more";function mje(){var i=C.useState({}),e=$e(i,2),t=e[1],n=C.useRef(new Map),r=C.useRef(new Map),o=C.useState([]),s=$e(o,2),a=s[0],l=s[1],c=C.useRef(0),u=C.useRef(!1),d=function(){u.current||t({})},h=C.useCallback(function(y,S){var L=soe(S);r.current.set(L,y),n.current.set(y,L),c.current+=1;var E=c.current;gje(function(){E===c.current&&d()})},[]),f=C.useCallback(function(y,S){var L=soe(S);r.current.delete(L),n.current.delete(y)},[]),g=C.useCallback(function(y){l(y)},[]),p=C.useCallback(function(y,S){var L=n.current.get(y)||"",E=pje(L);return S&&a.includes(E[0])&&E.unshift(SH),E},[a]),m=C.useCallback(function(y,S){return y.some(function(L){var E=p(L,!0);return E.includes(S)})},[p]),v=function(){var S=gt(n.current.keys());return a.length&&S.push(SH),S},_=C.useCallback(function(y){var S="".concat(n.current.get(y)).concat(fX),L=new Set;return gt(r.current.keys()).forEach(function(E){E.startsWith(S)&&L.add(r.current.get(E))}),L},[]);return C.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:m,getKeyPath:p,getKeys:v,getSubPathKeys:_}}function A1(i){var e=C.useRef(i);e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(S){return!h.current&&!S&&m(!0),y==null?void 0:y(S)},p?null:C.createElement(KD,{mode:o,locked:!h.current},C.createElement(hd,It({visible:v},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(S){var L=S.className,E=S.style;return C.createElement(gX,{id:e,className:L,style:E},r)}))}var Aje=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Oje=["active"],Fje=function(e){var t,n=e.style,r=e.className,o=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.onClick,p=e.onMouseEnter,m=e.onMouseLeave,v=e.onTitleClick,_=e.onTitleMouseEnter,y=e.onTitleMouseLeave,S=Mn(e,Aje),L=L0e(s),E=C.useContext(dh),D=E.prefixCls,k=E.mode,T=E.openKeys,M=E.disabled,P=E.overflowDisabled,N=E.activeKey,R=E.selectedKeys,O=E.itemIcon,B=E.expandIcon,$=E.onItemClick,G=E.onOpenChange,U=E.onActive,j=C.useContext(hX),ie=j._internalRenderSubMenuItem,Y=C.useContext(I0e),J=Y.isSubPathKey,Q=WS(),he="".concat(D,"-submenu"),ge=M||a,ye=C.useRef(),be=C.useRef(),Ge=u||O,nt=d||B,je=T.includes(s),_e=!P&&je,Ve=J(R,s),Le=N0e(s,ge,_,y),Pe=Le.active,Be=Mn(Le,Oje),Qe=C.useState(!1),Ye=$e(Qe,2),We=Ye[0],dt=Ye[1],re=function(Me){ge||dt(Me)},ue=function(Me){re(!0),p==null||p({key:s,domEvent:Me})},de=function(Me){re(!1),m==null||m({key:s,domEvent:Me})},z=C.useMemo(function(){return Pe||(k!=="inline"?We||J([N],s):!1)},[k,Pe,N,We,s,J]),q=R0e(Q.length),se=function(Me){ge||(v==null||v({key:s,domEvent:Me}),k==="inline"&&G(s,!je))},ne=A1(function(He){g==null||g(cA(He)),$(He)}),pe=function(Me){k!=="inline"&&G(s,Me)},ke=function(){U(s)},oe=L&&"".concat(L,"-popup"),ce=C.createElement("div",It({role:"menuitem",style:q,className:"".concat(he,"-title"),tabIndex:ge?null:-1,ref:ye,title:typeof o=="string"?o:null,"data-menu-id":P&&L?null:L,"aria-expanded":_e,"aria-haspopup":!0,"aria-controls":oe,"aria-disabled":ge,onClick:se,onFocus:ke},Be),o,C.createElement(M0e,{icon:k!=="horizontal"?nt:null,props:te(te({},e),{},{isOpen:_e,isSubMenu:!0})},C.createElement("i",{className:"".concat(he,"-arrow")}))),fe=C.useRef(k);if(k!=="inline"&&Q.length>1?fe.current="vertical":fe.current=k,!P){var Ie=fe.current;ce=C.createElement(Mje,{mode:Ie,prefixCls:he,visible:!l&&_e&&k!=="inline",popupClassName:h,popupOffset:f,popup:C.createElement(KD,{mode:Ie==="horizontal"?"vertical":Ie},C.createElement(gX,{id:oe,ref:be},c)),disabled:ge,onVisibleChange:pe},ce)}var Te=C.createElement(Nf.Item,It({role:"none"},S,{component:"li",style:n,className:De(he,"".concat(he,"-").concat(k),r,(t={},we(t,"".concat(he,"-open"),_e),we(t,"".concat(he,"-active"),z),we(t,"".concat(he,"-selected"),Ve),we(t,"".concat(he,"-disabled"),ge),t)),onMouseEnter:ue,onMouseLeave:de}),ce,!P&&C.createElement(Pje,{id:oe,open:_e,keyPath:Q},c));return ie&&(Te=ie(Te,e,{selected:Ve,active:z,open:_e,disabled:ge})),C.createElement(KD,{onItemClick:ne,mode:k==="horizontal"?"vertical":k,itemIcon:Ge,expandIcon:nt},Te)};function $4(i){var e=i.eventKey,t=i.children,n=WS(e),r=pX(t,n),o=B4();C.useEffect(function(){if(o)return o.registerPath(e,n),function(){o.unregisterPath(e,n)}},[n]);var s;return o?s=r:s=C.createElement(Fje,i,r),C.createElement(D0e.Provider,{value:n},s)}var Bje=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],c1=[],Wje=C.forwardRef(function(i,e){var t,n,r=i,o=r.prefixCls,s=o===void 0?"rc-menu":o,a=r.rootClassName,l=r.style,c=r.className,u=r.tabIndex,d=u===void 0?0:u,h=r.items,f=r.children,g=r.direction,p=r.id,m=r.mode,v=m===void 0?"vertical":m,_=r.inlineCollapsed,y=r.disabled,S=r.disabledOverflow,L=r.subMenuOpenDelay,E=L===void 0?.1:L,D=r.subMenuCloseDelay,k=D===void 0?.1:D,T=r.forceSubMenuRender,M=r.defaultOpenKeys,P=r.openKeys,N=r.activeKey,R=r.defaultActiveFirst,O=r.selectable,B=O===void 0?!0:O,$=r.multiple,G=$===void 0?!1:$,U=r.defaultSelectedKeys,j=r.selectedKeys,ie=r.onSelect,Y=r.onDeselect,J=r.inlineIndent,Q=J===void 0?24:J,he=r.motion,ge=r.defaultMotions,ye=r.triggerSubMenuAction,be=ye===void 0?"hover":ye,Ge=r.builtinPlacements,nt=r.itemIcon,je=r.expandIcon,_e=r.overflowedIndicator,Ve=_e===void 0?"...":_e,Le=r.overflowedIndicatorPopupClassName,Pe=r.getPopupContainer,Be=r.onClick,Qe=r.onOpenChange,Ye=r.onKeyDown;r.openAnimation,r.openTransitionName;var We=r._internalRenderMenuItem,dt=r._internalRenderSubMenuItem,re=Mn(r,Bje),ue=C.useMemo(function(){return kje(f,h,c1)},[f,h]),de=C.useState(!1),z=$e(de,2),q=z[0],se=z[1],ne=C.useRef(),pe=_je(p),ke=g==="rtl",oe=nl(M,{value:P,postState:function($t){return $t||c1}}),ce=$e(oe,2),fe=ce[0],Ie=ce[1],Te=function($t){var On=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Jt(){Ie($t),Qe==null||Qe($t)}On?lh.flushSync(Jt):Jt()},He=C.useState(fe),Me=$e(He,2),bt=Me[0],rt=Me[1],Ht=C.useRef(!1),Ue=C.useMemo(function(){return(v==="inline"||v==="vertical")&&_?["vertical",_]:[v,!1]},[v,_]),Ct=$e(Ue,2),Dt=Ct[0],St=Ct[1],Kt=Dt==="inline",_n=C.useState(Dt),zt=$e(_n,2),Yt=zt[0],at=zt[1],ut=C.useState(St),ht=$e(ut,2),Lt=ht[0],At=ht[1];C.useEffect(function(){at(Dt),At(St),Ht.current&&(Kt?Ie(bt):Te(c1))},[Dt,St]);var ln=C.useState(0),Si=$e(ln,2),Xi=Si[0],Ir=Si[1],En=Xi>=ue.length-1||Yt!=="horizontal"||S;C.useEffect(function(){Kt&&rt(fe)},[fe]),C.useEffect(function(){return Ht.current=!0,function(){Ht.current=!1}},[]);var fi=mje(),Ur=fi.registerPath,go=fi.unregisterPath,ys=fi.refreshOverflowKeys,ws=fi.isSubPathKey,Ut=fi.getKeyPath,Ee=fi.getKeys,wt=fi.getSubPathKeys,kt=C.useMemo(function(){return{registerPath:Ur,unregisterPath:go}},[Ur,go]),qn=C.useMemo(function(){return{isSubPathKey:ws}},[ws]);C.useEffect(function(){ys(En?c1:ue.slice(Xi+1).map(function(Qt){return Qt.key}))},[Xi,En]);var dr=nl(N||R&&((t=ue[0])===null||t===void 0?void 0:t.key),{value:N}),jr=$e(dr,2),ei=jr[0],to=jr[1],$s=A1(function(Qt){to(Qt)}),Hl=A1(function(){to(void 0)});C.useImperativeHandle(e,function(){return{list:ne.current,focus:function($t){var On,Jt=ei??((On=ue.find(function(So){return!So.props.disabled}))===null||On===void 0?void 0:On.key);if(Jt){var Zt,oi,Wi;(Zt=ne.current)===null||Zt===void 0||(oi=Zt.querySelector("li[data-menu-id='".concat(dX(pe,Jt),"']")))===null||oi===void 0||(Wi=oi.focus)===null||Wi===void 0||Wi.call(oi,$t)}}}});var Oa=nl(U||[],{value:j,postState:function($t){return Array.isArray($t)?$t:$t==null?c1:[$t]}}),Uo=$e(Oa,2),wo=Uo[0],Fa=Uo[1],Ba=function($t){if(B){var On=$t.key,Jt=wo.includes(On),Zt;G?Jt?Zt=wo.filter(function(Wi){return Wi!==On}):Zt=[].concat(gt(wo),[On]):Zt=[On],Fa(Zt);var oi=te(te({},$t),{},{selectedKeys:Zt});Jt?Y==null||Y(oi):ie==null||ie(oi)}!G&&fe.length&&Yt!=="inline"&&Te(c1)},Vl=A1(function(Qt){Be==null||Be(cA(Qt)),Ba(Qt)}),fl=A1(function(Qt,$t){var On=fe.filter(function(Zt){return Zt!==Qt});if($t)On.push(Qt);else if(Yt!=="inline"){var Jt=wt(Qt);On=On.filter(function(Zt){return!Jt.has(Zt)})}Tp(fe,On,!0)||Te(On,!0)}),zl=A1(Pe),yu=function($t,On){var Jt=On??!fe.includes($t);fl($t,Jt)},wu=fje(Yt,ei,ke,pe,ne,Ee,Ut,to,yu,Ye);C.useEffect(function(){se(!0)},[]);var Ic=C.useMemo(function(){return{_internalRenderMenuItem:We,_internalRenderSubMenuItem:dt}},[We,dt]),Wa=Yt!=="horizontal"||S?ue:ue.map(function(Qt,$t){return C.createElement(KD,{key:Qt.key,overflowDisabled:$t>Xi},Qt)}),$a=C.createElement(Nf,It({id:p,ref:ne,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:W4,className:De(s,"".concat(s,"-root"),"".concat(s,"-").concat(Yt),c,(n={},we(n,"".concat(s,"-inline-collapsed"),Lt),we(n,"".concat(s,"-rtl"),ke),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Wa,renderRawItem:function($t){return $t},renderRawRest:function($t){var On=$t.length,Jt=On?ue.slice(-On):null;return C.createElement($4,{eventKey:SH,title:Ve,disabled:En,internalPopupClose:On===0,popupClassName:Le},Jt)},maxCount:Yt!=="horizontal"||S?Nf.INVALIDATE:Nf.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function($t){Ir($t)},onKeyDown:wu},re));return C.createElement(hX.Provider,{value:Ic},C.createElement(x0e.Provider,{value:pe},C.createElement(KD,{prefixCls:s,rootClassName:a,mode:Yt,openKeys:fe,rtl:ke,disabled:y,motion:q?he:null,defaultMotions:q?ge:null,activeKey:ei,onActive:$s,onInactive:Hl,selectedKeys:wo,inlineIndent:Q,subMenuOpenDelay:E,subMenuCloseDelay:k,forceSubMenuRender:T,builtinPlacements:Ge,triggerSubMenuAction:be,getPopupContainer:zl,itemIcon:nt,expandIcon:je,onItemClick:Vl,onOpenChange:fl},C.createElement(I0e.Provider,{value:qn},$a),C.createElement("div",{style:{display:"none"},"aria-hidden":!0},C.createElement(E0e.Provider,{value:kt},ue)))))}),$je=["className","title","eventKey","children"],Hje=["children"],Vje=function(e){var t=e.className,n=e.title;e.eventKey;var r=e.children,o=Mn(e,$je),s=C.useContext(dh),a=s.prefixCls,l="".concat(a,"-item-group");return C.createElement("li",It({role:"presentation"},o,{onClick:function(u){return u.stopPropagation()},className:De(l,t)}),C.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),C.createElement("ul",{role:"group",className:"".concat(l,"-list")},r))};function H4(i){var e=i.children,t=Mn(i,Hje),n=WS(t.eventKey),r=pX(e,n),o=B4();return o?r:C.createElement(Vje,cl(t,["warnKey"]),r)}function mX(i){var e=i.className,t=i.style,n=C.useContext(dh),r=n.prefixCls,o=B4();return o?null:C.createElement("li",{className:De("".concat(r,"-item-divider"),e),style:t})}var eT=Wje;eT.Item=W4;eT.SubMenu=$4;eT.ItemGroup=H4;eT.Divider=mX;const zje=i=>{const{componentCls:e,motionDurationSlow:t,menuHorizontalHeight:n,colorSplit:r,lineWidth:o,lineType:s,menuItemPaddingInline:a}=i;return{[`${e}-horizontal`]:{lineHeight:`${n}px`,border:0,borderBottom:`${o}px ${s} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:a},[`> ${e}-item:hover, + `]:{paddingInlineEnd:i.fontSize*1.5}}}},R6(Bi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const uze=i=>{const{componentCls:e}=i;return{position:"relative",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${e}-disabled&`]:{color:i.colorTextDisabled,background:i.colorBgContainerDisabled,cursor:"not-allowed",[`${e}-multiple&`]:{background:i.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},M6=function(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:n,borderHoverColor:r,outlineColor:o,antCls:s}=e,a=t?{[`${n}-selector`]:{borderColor:r}}:{};return{[i]:{[`&:not(${n}-disabled):not(${n}-customize-input):not(${s}-pagination-size-changer)`]:Object.assign(Object.assign({},a),{[`${n}-focused& ${n}-selector`]:{borderColor:r,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${o}`,outline:0},[`&:hover ${n}-selector`]:{borderColor:r}})}}},dze=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},hze=i=>{const{componentCls:e,inputPaddingHorizontalBase:t,iconCls:n}=i;return{[e]:Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${e}-customize-input) ${e}-selector`]:Object.assign(Object.assign({},uze(i)),dze(i)),[`${e}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal"},cb),{"> *":Object.assign({lineHeight:"inherit"},cb)}),[`${e}-selection-placeholder`]:Object.assign(Object.assign({},cb),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${e}-arrow`]:Object.assign(Object.assign({},Kk()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[n]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${e}-suffix)`]:{pointerEvents:"auto"}},[`${e}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:i.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${e}-clear`]:{opacity:1}}}),[`${e}-has-feedback`]:{[`${e}-clear`]:{insetInlineEnd:t+i.fontSize+i.paddingXXS}}}},fze=i=>{const{componentCls:e}=i;return[{[e]:{[`&-borderless ${e}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${e}-in-form-item`]:{width:"100%"}}},hze(i),cze(i),lze(i),aze(i),{[`${e}-rtl`]:{direction:"rtl"}},M6(e,Bi(i,{borderHoverColor:i.colorPrimaryHover,outlineColor:i.controlOutline})),M6(`${e}-status-error`,Bi(i,{borderHoverColor:i.colorErrorHover,outlineColor:i.colorErrorOutline}),!0),M6(`${e}-status-warning`,Bi(i,{borderHoverColor:i.colorWarningHover,outlineColor:i.colorWarningOutline}),!0),N4(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},gze=yo("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=Bi(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.paddingSM-1});return[fze(n)]},i=>({zIndexPopup:i.zIndexPopupBase+50})),CR={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"visible"},pze={bottomLeft:Object.assign(Object.assign({},CR),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},CR),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},CR),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},CR),{points:["br","tr"],offset:[0,-4]})};function mze(i){return i||pze}function vze(i){return i??!0}function _ze(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:s,hasFeedback:a,prefixCls:l,showArrow:c,feedbackIcon:u}=i;const d=t??C.createElement(PS,null),h=m=>C.createElement(C.Fragment,null,c!==!1&&m,a&&u);let f=null;if(e!==void 0)f=h(e);else if(o)f=h(C.createElement(AD,{spin:!0}));else{const m=`${l}-suffix`;f=v=>{let{open:_,showSearch:y}=v;return h(_&&y?C.createElement(Iq,{className:m}):C.createElement(Dq,{className:m}))}}let g=null;n!==void 0?g=n:s?g=C.createElement(vme,null):g=null;let p=null;return r!==void 0?p=r:p=C.createElement(Vk,null),{clearIcon:d,suffixIcon:f,itemIcon:g,removeIcon:p}}var bze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,className:r,rootClassName:o,getPopupContainer:s,popupClassName:a,dropdownClassName:l,listHeight:c=256,placement:u,listItemHeight:d=24,size:h,disabled:f,notFoundContent:g,status:p,showArrow:m,builtinPlacements:v}=i,_=bze(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow","builtinPlacements"]);const{getPopupContainer:y,getPrefixCls:S,renderEmpty:L,direction:E,virtual:D,dropdownMatchSelectWidth:k,select:T}=C.useContext(Pn),M=C.useContext(Eh),P=S("select",t),N=S(),{compactSize:R,compactItemClassnames:O}=FS(P,E),[B,$]=gze(P),G=C.useMemo(()=>{const{mode:We}=_;if(We!=="combobox")return We===X_e?"combobox":We},[_.mode]),U=G==="multiple"||G==="tags",j=vze(m),{status:ie,hasFeedback:Y,isFormItemInput:J,feedbackIcon:Q}=C.useContext(Vf),he=P4(ie,p);let ge;g!==void 0?ge=g:G==="combobox"?ge=null:ge=(L==null?void 0:L("Select"))||C.createElement(nX,{componentName:"Select"});const{suffixIcon:ye,itemIcon:be,removeIcon:Ge,clearIcon:nt}=_ze(Object.assign(Object.assign({},_),{multiple:U,hasFeedback:Y,feedbackIcon:Q,showArrow:j,prefixCls:P})),je=cl(_,["suffixIcon","itemIcon"]),_e=De(a||l,{[`${P}-dropdown-${E}`]:E==="rtl"},o,$),Ve=R||h||M,Le=C.useContext(I_),Pe=f??Le,Be=De({[`${P}-lg`]:Ve==="large",[`${P}-sm`]:Ve==="small",[`${P}-rtl`]:E==="rtl",[`${P}-borderless`]:!n,[`${P}-in-form-item`]:J},pp(P,he,Y),O,r,o,$),Qe=C.useMemo(()=>u!==void 0?u:E==="rtl"?"bottomRight":"bottomLeft",[u,E]),Ye=mze(v);return B(C.createElement(eX,Object.assign({ref:e,virtual:D,dropdownMatchSelectWidth:k,showSearch:T==null?void 0:T.showSearch},je,{builtinPlacements:Ye,transitionName:Rb(N,h$e(u),_.transitionName),listHeight:c,listItemHeight:d,mode:G,prefixCls:P,placement:Qe,direction:E,inputIcon:ye,menuItemSelectedIcon:be,removeIcon:Ge,clearIcon:nt,notFoundContent:ge,className:Be,getPopupContainer:s||y,dropdownClassName:_e,showArrow:Y||j,disabled:Pe})))},BS=C.forwardRef(Cze),yze=j_e(BS);BS.SECRET_COMBOBOX_MODE_DO_NOT_USE=X_e;BS.Option=Qq;BS.OptGroup=Zq;BS._InternalPanelDoNotUseOrYouWillBeFired=yze;const A4=BS;function Y_e(){const[,i]=C.useReducer(e=>e+1,0);return i}const Uv=["xxl","xl","lg","md","sm","xs"],wze=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),Sze=i=>{const e=i,t=[].concat(Uv).reverse();return t.forEach((n,r)=>{const o=n.toUpperCase(),s=`screen${o}Min`,a=`screen${o}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(r{const t=new Map;let n=-1,r={};return{matchHandlers:{},dispatch(o){return r=o,t.forEach(s=>s(r)),t.size>=1},subscribe(o){return t.size||this.register(),n+=1,t.set(n,o),o(r),n},unsubscribe(o){t.delete(o),t.size||this.unregister()},unregister(){Object.keys(e).forEach(o=>{const s=e[o],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(o=>{const s=e[o],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[o]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function O4(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=C.useRef({}),t=Y_e(),n=Z_e();return C.useEffect(()=>{const r=n.subscribe(o=>{e.current=o,i&&t()});return()=>n.unsubscribe(r)},[]),e.current}const pH=C.createContext("default"),Ore=i=>{let{children:e,size:t}=i;const n=C.useContext(pH);return C.createElement(pH.Provider,{value:t||n},e)},xze=i=>{const{antCls:e,componentCls:t,iconCls:n,avatarBg:r,avatarColor:o,avatarSizeBase:s,avatarSizeLG:a,avatarSizeSM:l,avatarFontSizeBase:c,avatarFontSizeLG:u,avatarFontSizeSM:d,borderRadius:h,borderRadiusLG:f,borderRadiusSM:g,lineWidth:p,lineType:m}=i,v=(_,y,S)=>({width:_,height:_,lineHeight:`${_-p*2}px`,borderRadius:"50%",[`&${t}-square`]:{borderRadius:S},[`${t}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${t}-icon`]:{fontSize:y,[`> ${n}`]:{margin:0}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-block",overflow:"hidden",color:o,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${p}px ${m} transparent`,["&-image"]:{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),v(s,c,h)),{["&-lg"]:Object.assign({},v(a,u,f)),["&-sm"]:Object.assign({},v(l,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},Lze=i=>{const{componentCls:e,avatarGroupBorderColor:t,avatarGroupSpace:n}=i;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:t},["> *:not(:first-child)"]:{marginInlineStart:n}}}},Q_e=yo("Avatar",i=>{const{colorTextLightSolid:e,controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:a,fontSizeHeading3:l,marginXS:c,colorBorderBg:u,colorTextPlaceholder:d}=i,h=Bi(i,{avatarBg:d,avatarColor:e,avatarSizeBase:t,avatarSizeLG:n,avatarSizeSM:r,avatarFontSizeBase:Math.round((s+a)/2),avatarFontSizeLG:l,avatarFontSizeSM:o,avatarGroupSpace:-c,avatarGroupBorderColor:u});return[xze(h),Lze(h)]});var Eze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(pH),[n,r]=C.useState(1),[o,s]=C.useState(!1),[a,l]=C.useState(!0),c=C.useRef(null),u=C.useRef(null),d=pu(e,c),{getPrefixCls:h}=C.useContext(Pn),f=()=>{if(!u.current||!c.current)return;const he=u.current.offsetWidth,ge=c.current.offsetWidth;if(he!==0&&ge!==0){const{gap:ye=4}=i;ye*2{s(!0)},[]),C.useEffect(()=>{l(!0),r(1)},[i.src]),C.useEffect(()=>{f()},[i.gap]);const g=()=>{const{onError:he}=i;(he?he():void 0)!==!1&&l(!1)},{prefixCls:p,shape:m="circle",size:v="default",src:_,srcSet:y,icon:S,className:L,rootClassName:E,alt:D,draggable:k,children:T,crossOrigin:M}=i,P=Eze(i,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),N=v==="default"?t:v,R=Object.keys(typeof N=="object"?N||{}:{}).some(he=>["xs","sm","md","lg","xl","xxl"].includes(he)),O=O4(R),B=C.useMemo(()=>{if(typeof N!="object")return{};const he=Uv.find(ye=>O[ye]),ge=N[he];return ge?{width:ge,height:ge,lineHeight:`${ge}px`,fontSize:S?ge/2:18}:{}},[O,N]),$=h("avatar",p),[G,U]=Q_e($),j=De({[`${$}-lg`]:N==="large",[`${$}-sm`]:N==="small"}),ie=C.isValidElement(_),Y=De($,j,{[`${$}-${m}`]:!!m,[`${$}-image`]:ie||_&&a,[`${$}-icon`]:!!S},L,E,U),J=typeof N=="number"?{width:N,height:N,lineHeight:`${N}px`,fontSize:S?N/2:18}:{};let Q;if(typeof _=="string"&&a)Q=C.createElement("img",{src:_,draggable:k,srcSet:y,onError:g,alt:D,crossOrigin:M});else if(ie)Q=_;else if(S)Q=S;else if(o||n!==1){const he=`scale(${n}) translateX(-50%)`,ge={msTransform:he,WebkitTransform:he,transform:he},ye=typeof N=="number"?{lineHeight:`${N}px`}:{};Q=C.createElement(Lh,{onResize:f},C.createElement("span",{className:`${$}-string`,ref:u,style:Object.assign(Object.assign({},ye),ge)},T))}else Q=C.createElement("span",{className:`${$}-string`,style:{opacity:0},ref:u},T);return delete P.onError,delete P.gap,G(C.createElement("span",Object.assign({},P,{style:Object.assign(Object.assign(Object.assign({},J),B),P.style),className:Y,ref:d}),Q))},Ize=C.forwardRef(Dze),J_e=Ize;var r1={shiftX:64,adjustY:1},o1={adjustX:1,shiftY:!0},Ru=[0,0],kze={left:{points:["cr","cl"],overflow:o1,offset:[-4,0],targetOffset:Ru},right:{points:["cl","cr"],overflow:o1,offset:[4,0],targetOffset:Ru},top:{points:["bc","tc"],overflow:r1,offset:[0,-4],targetOffset:Ru},bottom:{points:["tc","bc"],overflow:r1,offset:[0,4],targetOffset:Ru},topLeft:{points:["bl","tl"],overflow:r1,offset:[0,-4],targetOffset:Ru},leftTop:{points:["tr","tl"],overflow:o1,offset:[-4,0],targetOffset:Ru},topRight:{points:["br","tr"],overflow:r1,offset:[0,-4],targetOffset:Ru},rightTop:{points:["tl","tr"],overflow:o1,offset:[4,0],targetOffset:Ru},bottomRight:{points:["tr","br"],overflow:r1,offset:[0,4],targetOffset:Ru},rightBottom:{points:["bl","br"],overflow:o1,offset:[4,0],targetOffset:Ru},bottomLeft:{points:["tl","bl"],overflow:r1,offset:[0,4],targetOffset:Ru},leftBottom:{points:["br","bl"],overflow:o1,offset:[-4,0],targetOffset:Ru}};function iX(i){var e=i.children,t=i.prefixCls,n=i.id,r=i.overlayInnerStyle,o=i.className,s=i.style;return C.createElement("div",{className:De("".concat(t,"-content"),o),style:s},C.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:r},typeof e=="function"?e():e))}var Tze=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],Nze=function(e,t){var n=e.overlayClassName,r=e.trigger,o=r===void 0?["hover"]:r,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,m=e.transitionName,v=e.animation,_=e.motion,y=e.placement,S=y===void 0?"right":y,L=e.align,E=L===void 0?{}:L,D=e.destroyTooltipOnHide,k=D===void 0?!1:D,T=e.defaultVisible,M=e.getTooltipContainer,P=e.overlayInnerStyle;e.arrowContent;var N=e.overlay,R=e.id,O=e.showArrow,B=O===void 0?!0:O,$=Mn(e,Tze),G=C.useRef(null);C.useImperativeHandle(t,function(){return G.current});var U=te({},$);"visible"in e&&(U.popupVisible=e.visible);var j=function(){return C.createElement(iX,{key:"content",prefixCls:h,id:R,overlayInnerStyle:P},N)};return C.createElement(F_e,It({popupClassName:n,prefixCls:h,popup:j,action:o,builtinPlacements:kze,popupPlacement:S,ref:G,popupAlign:E,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:m,popupAnimation:v,popupMotion:_,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:B},U),f)};const Rze=C.forwardRef(Nze),e0e=8;function rX(i){const e=e0e,{contentRadius:t,limitVerticalRadius:n}=i,r=t>12?t+2:12;return{dropdownArrowOffset:r,dropdownArrowOffsetVertical:n?e:r}}function yR(i,e){return i?e:{}}function oX(i,e){const{componentCls:t,sizePopupArrow:n,borderRadiusXS:r,borderRadiusOuter:o,boxShadowPopoverArrow:s}=i,{colorBg:a,contentRadius:l=i.borderRadiusLG,limitVerticalRadius:c,arrowDistance:u=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}=e,{dropdownArrowOffsetVertical:h,dropdownArrowOffset:f}=rX({contentRadius:l,limitVerticalRadius:c});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({[`${t}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},J9e(n,r,o,a,s)),{"&:before":{background:a}})]},yR(!!d.top,{[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),yR(!!d.bottom,{[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),yR(!!d.left,{[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:h},[`&-placement-leftBottom ${t}-arrow`]:{bottom:h}})),yR(!!d.right,{[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:h},[`&-placement-rightBottom ${t}-arrow`]:{bottom:h}}))}}function Mze(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const r=n&&typeof n=="object"?n:{},o={};switch(i){case"top":case"bottom":o.shiftX=e.dropdownArrowOffset*2+t;break;case"left":case"right":o.shiftY=e.dropdownArrowOffsetVertical*2+t;break}const s=Object.assign(Object.assign({},o),r);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const Fre={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Pze={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Aze=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function t0e(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:r,borderRadius:o}=i,s=e/2,a={};return Object.keys(Fre).forEach(l=>{const c=n&&Pze[l]||Fre[l],u=Object.assign(Object.assign({},c),{offset:[0,0]});switch(a[l]=u,Aze.has(l)&&(u.autoArrow=!1),l){case"top":case"topLeft":case"topRight":u.offset[1]=-s-r;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=s+r;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-s-r;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=s+r;break}const d=rX({contentRadius:o,limitVerticalRadius:!0});if(n)switch(l){case"topLeft":case"bottomLeft":u.offset[0]=-d.dropdownArrowOffset-s;break;case"topRight":case"bottomRight":u.offset[0]=d.dropdownArrowOffset+s;break;case"leftTop":case"rightTop":u.offset[1]=-d.dropdownArrowOffset-s;break;case"leftBottom":case"rightBottom":u.offset[1]=d.dropdownArrowOffset+s;break}u.overflow=Mze(l,d,e,t)}),a}const um=(i,e)=>new Jr(i).setAlpha(e).toRgbString(),s1=(i,e)=>new Jr(i).lighten(e).toHexString(),Oze=i=>{const e=kp(i,{theme:"dark"});return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[6],6:e[5],7:e[4],8:e[6],9:e[5],10:e[4]}},Fze=(i,e)=>{const t=i||"#000",n=e||"#fff";return{colorBgBase:t,colorTextBase:n,colorText:um(n,.85),colorTextSecondary:um(n,.65),colorTextTertiary:um(n,.45),colorTextQuaternary:um(n,.25),colorFill:um(n,.18),colorFillSecondary:um(n,.12),colorFillTertiary:um(n,.08),colorFillQuaternary:um(n,.04),colorBgElevated:s1(t,12),colorBgContainer:s1(t,8),colorBgLayout:s1(t,0),colorBgSpotlight:s1(t,26),colorBorder:s1(t,26),colorBorderSecondary:s1(t,19)}},Bze=(i,e)=>{const t=Object.keys(Aq).map(r=>{const o=kp(i[r],{theme:"dark"});return new Array(10).fill(1).reduce((s,a,l)=>(s[`${r}-${l+1}`]=o[l],s[`${r}${l+1}`]=o[l],s),{})}).reduce((r,o)=>(r=Object.assign(Object.assign({},r),o),r),{}),n=e??D4(i);return Object.assign(Object.assign(Object.assign({},n),t),Mve(i,{generateColorPalettes:Oze,generateNeutralColorPalettes:Fze}))},Wze=Bze;function $ze(i){const{sizeUnit:e,sizeStep:t}=i,n=t-2;return{sizeXXL:e*(n+10),sizeXL:e*(n+6),sizeLG:e*(n+2),sizeMD:e*(n+2),sizeMS:e*(n+1),size:e*n,sizeSM:e*n,sizeXS:e*(n-1),sizeXXS:e*(n-1)}}const Hze=(i,e)=>{const t=e??D4(i),n=t.fontSizeSM,r=t.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),$ze(e??i)),Pve(n)),{controlHeight:r}),Rve(Object.assign(Object.assign({},t),{controlHeight:r})))},Vze=Hze;function zze(){const[i,e,t]=vC();return{theme:i,token:e,hashId:t}}const n0e={defaultConfig:ZP,defaultSeed:ZP.token,useToken:zze,defaultAlgorithm:D4,darkAlgorithm:Wze,compactAlgorithm:Vze},Uze=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:r,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u,tooltipRadiusOuter:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${c/2}px ${u}px`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:o,boxShadow:l},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:Math.min(o,e0e)}},[`${e}-content`]:{position:"relative"}}),r7e(i,(h,f)=>{let{darkColor:g}=f;return{[`&${e}-${h}`]:{[`${e}-inner`]:{backgroundColor:g},[`${e}-arrow`]:{"--antd-arrow-background-color":g}}}})),{"&-rtl":{direction:"rtl"}})},oX(Bi(i,{borderRadiusOuter:d}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:o,limitVerticalRadius:!0}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},i0e=(i,e)=>yo("Tooltip",n=>{if(e===!1)return[];const{borderRadius:r,colorTextLightSolid:o,colorBgDefault:s,borderRadiusOuter:a}=n,l=Bi(n,{tooltipMaxWidth:250,tooltipColor:o,tooltipBorderRadius:r,tooltipBg:s,tooltipRadiusOuter:a>4?4:a});return[Uze(l),Xk(n,"zoom-big-fast")]},n=>{let{zIndexPopupBase:r,colorBgSpotlight:o}=n;return{zIndexPopup:r+70,colorBgDefault:o}})(i),jze=HD.map(i=>`${i}-inverse`);function Kze(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(gt(jze),gt(HD)).includes(i):HD.includes(i)}function r0e(i,e){const t=Kze(e),n=De({[`${i}-${e}`]:e&&t}),r={},o={};return e&&!t&&(r.background=e,o["--antd-arrow-background-color"]=e),{className:n,overlayStyle:r,arrowStyle:o}}function Gze(i){const{prefixCls:e,className:t,placement:n="top",title:r,color:o,overlayInnerStyle:s}=i,{getPrefixCls:a}=C.useContext(Pn),l=a("tooltip",e),[c,u]=i0e(l,!0),d=r0e(l,o),h=Object.assign(Object.assign({},s),d.overlayStyle),f=d.arrowStyle;return c(C.createElement("div",{className:De(u,l,`${l}-pure`,`${l}-placement-${n}`,t,d.className),style:f},C.createElement("div",{className:`${l}-arrow`}),C.createElement(iX,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:h}),r)))}var qze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t={},n=Object.assign({},i);return e.forEach(r=>{i&&r in i&&(t[r]=i[r],delete n[r])}),{picked:t,omitted:n}};function Zze(i,e){const t=i.type;if((t.__ANT_BUTTON===!0||i.type==="button")&&i.props.disabled||t.__ANT_SWITCH===!0&&(i.props.disabled||i.props.loading)||t.__ANT_RADIO===!0&&i.props.disabled){const{picked:n,omitted:r}=Yze(i.props.style,["position","left","right","top","bottom","float","display","zIndex"]),o=Object.assign(Object.assign({display:"inline-block"},n),{cursor:"not-allowed",width:i.props.block?"100%":void 0}),s=Object.assign(Object.assign({},r),{pointerEvents:"none"}),a=ta(i,{style:s,className:null});return C.createElement("span",{style:o,className:De(i.props.className,`${e}-disabled-compatible-wrapper`)},a)}return i}const o0e=C.forwardRef((i,e)=>{var t,n;const{prefixCls:r,openClassName:o,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:m,builtinPlacements:v,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,S=!!g,{token:L}=Xze(),{getPopupContainer:E,getPrefixCls:D,direction:k}=C.useContext(Pn),T=C.useRef(null),M=()=>{var We;(We=T.current)===null||We===void 0||We.forceAlign()};C.useImperativeHandle(e,()=>({forceAlign:M,forcePopupAlign:()=>{M()}}));const[P,N]=nl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),R=!p&&!m&&p!==0,O=We=>{var dt,re;N(R?!1:We),R||((dt=i.onOpenChange)===null||dt===void 0||dt.call(i,We),(re=i.onVisibleChange)===null||re===void 0||re.call(i,We))},B=C.useMemo(()=>{var We,dt;let re=_;return typeof g=="object"&&(re=(dt=(We=g.pointAtCenter)!==null&&We!==void 0?We:g.arrowPointAtCenter)!==null&&dt!==void 0?dt:_),v||t0e({arrowPointAtCenter:re,autoAdjustOverflow:y,arrowWidth:S?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS})},[_,g,v,L]),$=(We,dt)=>{const re=Object.keys(B).find(ue=>{var de,z;return B[ue].points[0]===((de=dt.points)===null||de===void 0?void 0:de[0])&&B[ue].points[1]===((z=dt.points)===null||z===void 0?void 0:z[1])});if(re){const ue=We.getBoundingClientRect(),de={top:"50%",left:"50%"};/top|Bottom/.test(re)?de.top=`${ue.height-dt.offset[1]}px`:/Top|bottom/.test(re)&&(de.top=`${-dt.offset[1]}px`),/left|Right/.test(re)?de.left=`${ue.width-dt.offset[0]}px`:/right|Left/.test(re)&&(de.left=`${-dt.offset[0]}px`),We.style.transformOrigin=`${de.left} ${de.top}`}},G=C.useMemo(()=>p===0?p:m||p||"",[m,p]),{getPopupContainer:U,placement:j="top",mouseEnterDelay:ie=.1,mouseLeaveDelay:Y=.1,overlayStyle:J,rootClassName:Q}=i,he=qze(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),ge=D("tooltip",r),ye=D(),be=i["data-popover-inject"];let Ge=P;!("open"in i)&&!("visible"in i)&&R&&(Ge=!1);const nt=Zze(uh(u)&&!Yve(u)?u:C.createElement("span",null,u),ge),je=nt.props,_e=!je.className||typeof je.className=="string"?De(je.className,{[o||`${ge}-open`]:!0}):je.className,[Ve,Le]=i0e(ge,!be),Pe=r0e(ge,l),Be=Object.assign(Object.assign({},c),Pe.overlayStyle),Qe=Pe.arrowStyle,Ye=De(a,{[`${ge}-rtl`]:k==="rtl"},Pe.className,Q,Le);return Ve(C.createElement(Rze,Object.assign({},he,{showArrow:S,placement:j,mouseEnterDelay:ie,mouseLeaveDelay:Y,prefixCls:ge,overlayClassName:Ye,overlayStyle:Object.assign(Object.assign({},Qe),J),getTooltipContainer:U||s||E,ref:T,builtinPlacements:B,overlay:G,visible:Ge,onVisibleChange:O,afterVisibleChange:d??h,onPopupAlign:$,overlayInnerStyle:Be,arrowContent:C.createElement("span",{className:`${ge}-arrow-content`}),motion:{motionName:Rb(ye,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Ge?ta(nt,{className:_e}):nt))});o0e._InternalPanelDoNotUseOrYouWillBeFired=Gze;const Qk=o0e,aA=i=>i?typeof i=="function"?i():i:null,Qze=i=>{const{componentCls:e,popoverBg:t,popoverColor:n,width:r,fontWeightStrong:o,popoverPadding:s,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:c,zIndexPopup:u,marginXS:d,colorBgElevated:h}=i;return[{[e]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--antd-arrow-background-color":h,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:t,backgroundClip:"padding-box",borderRadius:c,boxShadow:a,padding:s},[`${e}-title`]:{minWidth:r,marginBottom:d,color:l,fontWeight:o},[`${e}-inner-content`]:{color:n}})},oX(i,{colorBg:"var(--antd-arrow-background-color)"}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},Jze=i=>{const{componentCls:e}=i;return{[e]:HD.map(t=>{const n=i[`${t}6`];return{[`&${e}-${t}`]:{"--antd-arrow-background-color":n,[`${e}-inner`]:{backgroundColor:n},[`${e}-arrow`]:{background:"transparent"}}}})}},eUe=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorSplit:r,paddingSM:o,controlHeight:s,fontSize:a,lineHeight:l,padding:c}=i,u=s-Math.round(a*l),d=u/2,h=u/2-t,f=c;return{[e]:{[`${e}-inner`]:{padding:0},[`${e}-title`]:{margin:0,padding:`${d}px ${f}px ${h}px`,borderBottom:`${t}px ${n} ${r}`},[`${e}-inner-content`]:{padding:`${o}px ${f}px`}}}},s0e=yo("Popover",i=>{const{colorBgElevated:e,colorText:t,wireframe:n}=i,r=Bi(i,{popoverBg:e,popoverColor:t,popoverPadding:12});return[Qze(r),Jze(r),n&&eUe(r),Xk(r,"zoom-big")]},i=>{let{zIndexPopupBase:e}=i;return{zIndexPopup:e+30,width:177}});var tUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(!(!e&&!t))return C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${i}-title`},aA(e)),C.createElement("div",{className:`${i}-inner-content`},aA(t)))};function iUe(i){const{hashId:e,prefixCls:t,className:n,style:r,placement:o="top",title:s,content:a,children:l}=i;return C.createElement("div",{className:De(e,t,`${t}-pure`,`${t}-placement-${o}`,n),style:r},C.createElement("div",{className:`${t}-arrow`}),C.createElement(iX,Object.assign({},i,{className:e,prefixCls:t}),l||nUe(t,s,a)))}function rUe(i){const{prefixCls:e}=i,t=tUe(i,["prefixCls"]),{getPrefixCls:n}=C.useContext(Pn),r=n("popover",e),[o,s]=s0e(r);return o(C.createElement(iUe,Object.assign({},t,{prefixCls:r,hashId:s})))}var oUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{title:e,content:t,prefixCls:n}=i;return!e&&!t?null:C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${n}-title`},aA(e)),C.createElement("div",{className:`${n}-inner-content`},aA(t)))},a0e=C.forwardRef((i,e)=>{const{prefixCls:t,title:n,content:r,overlayClassName:o,placement:s="top",trigger:a="hover",mouseEnterDelay:l=.1,mouseLeaveDelay:c=.1,overlayStyle:u={}}=i,d=oUe(i,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:h}=C.useContext(Pn),f=h("popover",t),[g,p]=s0e(f),m=h(),v=De(o,p);return g(C.createElement(Qk,Object.assign({placement:s,trigger:a,mouseEnterDelay:l,mouseLeaveDelay:c,overlayStyle:u},d,{prefixCls:f,overlayClassName:v,ref:e,overlay:C.createElement(sUe,{prefixCls:f,title:n,content:r}),transitionName:Rb(m,"zoom-big",d.transitionName),"data-popover-inject":!0})))});a0e._InternalPanelDoNotUseOrYouWillBeFired=rUe;const aUe=a0e,lUe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,className:r,rootClassName:o,maxCount:s,maxStyle:a,size:l}=i,c=e("avatar",n),u=`${c}-group`,[d,h]=Q_e(c),f=De(u,{[`${u}-rtl`]:t==="rtl"},r,o,h),{children:g,maxPopoverPlacement:p="top",maxPopoverTrigger:m="hover"}=i,v=od(g).map((y,S)=>ta(y,{key:`avatar-key-${S}`})),_=v.length;if(s&&s<_){const y=v.slice(0,s),S=v.slice(s,_);return y.push(C.createElement(aUe,{key:"avatar-popover-key",content:S,trigger:m,placement:p,overlayClassName:`${u}-popover`},C.createElement(J_e,{style:a},`+${_-s}`))),d(C.createElement(Ore,{size:l},C.createElement("div",{className:f,style:i.style},y)))}return d(C.createElement(Ore,{size:l},C.createElement("div",{className:f,style:i.style},v)))},cUe=lUe,l0e=J_e;l0e.Group=cUe;const uUe=l0e;var dUe=C.forwardRef(function(i,e){var t=i.didUpdate,n=i.getContainer,r=i.children,o=C.useRef(),s=C.useRef();C.useImperativeHandle(e,function(){return{}});var a=C.useRef(!1);return!a.current&&ea()&&(s.current=n(),o.current=s.current.parentNode,a.current=!0),C.useEffect(function(){t==null||t(i)}),C.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var l,c;(l=s.current)===null||l===void 0||(c=l.parentNode)===null||c===void 0||c.removeChild(s.current)}},[]),s.current?kw.createPortal(r,s.current):null});function hUe(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function fUe(i,e,t){var n=i[e]||{};return te(te({},n),t)}function gUe(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function BUe(i,e,t,n){var r=ni.clone(i),o={width:e.width,height:e.height};return n.adjustX&&r.left=t.left&&r.left+o.width>t.right&&(o.width-=r.left+o.width-t.right),n.adjustX&&r.left+o.width>t.right&&(r.left=Math.max(t.right-o.width,t.left)),n.adjustY&&r.top=t.top&&r.top+o.height>t.bottom&&(o.height-=r.top+o.height-t.bottom),n.adjustY&&r.top+o.height>t.bottom&&(r.top=Math.max(t.bottom-o.height,t.top)),ni.mix(r,o)}function cX(i){var e,t,n;if(!ni.isWindow(i)&&i.nodeType!==9)e=ni.offset(i),t=ni.outerWidth(i),n=ni.outerHeight(i);else{var r=ni.getWindow(i);e={left:ni.getWindowScrollLeft(r),top:ni.getWindowScrollTop(r)},t=ni.viewportWidth(r),n=ni.viewportHeight(r)}return e.width=t,e.height=n,e}function Gre(i,e){var t=e.charAt(0),n=e.charAt(1),r=i.width,o=i.height,s=i.left,a=i.top;return t==="c"?a+=o/2:t==="b"&&(a+=o),n==="c"?s+=r/2:n==="r"&&(s+=r),{left:s,top:a}}function SR(i,e,t,n,r){var o=Gre(e,t[1]),s=Gre(i,t[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-r[0]),top:Math.round(i.top-a[1]+n[1]-r[1])}}function qre(i,e,t){return i.leftt.right}function Xre(i,e,t){return i.topt.bottom}function WUe(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function uX(i,e,t){var n=t.target||e,r=cX(n),o=!HUe(n,t.overflow&&t.overflow.alwaysByViewport);return v0e(i,r,t,o)}uX.__getOffsetParent=bH;uX.__getVisibleRectForElement=lX;function VUe(i,e,t){var n,r,o=ni.getDocument(i),s=o.defaultView||o.parentWindow,a=ni.getWindowScrollLeft(s),l=ni.getWindowScrollTop(s),c=ni.viewportWidth(s),u=ni.viewportHeight(s);"pageX"in e?n=e.pageX:n=a+e.clientX,"pageY"in e?r=e.pageY:r=l+e.clientY;var d={left:n,top:r,width:0,height:0},h=n>=0&&n<=a+c&&r>=0&&r<=l+u,f=[t.points[0],"cc"];return v0e(i,d,Wre(Wre({},t),{},{points:f}),h)}const zUe=function(i,e){var t=qe.useRef(!1),n=qe.useRef(null);function r(){window.clearTimeout(n.current)}function o(s){if(r(),!t.current||s===!0){if(i(s)===!1)return;t.current=!0,n.current=window.setTimeout(function(){t.current=!1},e)}else n.current=window.setTimeout(function(){t.current=!1,o()},e)}return[o,function(){t.current=!1,r()}]};function UUe(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function jUe(i,e){i!==document.activeElement&&ab(e,i)&&typeof i.focus=="function"&&i.focus()}function Qre(i,e){var t=null,n=null;function r(s){var a=$e(s,1),l=a[0].target;if(document.documentElement.contains(l)){var c=l.getBoundingClientRect(),u=c.width,d=c.height,h=Math.floor(u),f=Math.floor(d);(t!==h||n!==f)&&Promise.resolve().then(function(){e({width:h,height:f})}),t=h,n=f}}var o=new sve(r);return i&&o.observe(i),function(){o.disconnect()}}function Jre(i){return typeof i!="function"?null:i()}function eoe(i){return Un(i)!=="object"||!i?null:i}var KUe=function(e,t){var n=e.children,r=e.disabled,o=e.target,s=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=c===void 0?0:c,d=qe.useRef({}),h=qe.useRef(),f=qe.Children.only(n),g=qe.useRef({});g.current.disabled=r,g.current.target=o,g.current.align=s,g.current.onAlign=a;var p=zUe(function(){var P=g.current,N=P.disabled,R=P.target,O=P.align,B=P.onAlign,$=h.current;if(!N&&R&&$){var G,U=Jre(R),j=eoe(R);d.current.element=U,d.current.point=j,d.current.align=O;var ie=document,Y=ie.activeElement;return U&&qk(U)?G=uX($,U,O):j&&(G=VUe($,j,O)),jUe(Y,$),B&&G&&B($,G),!0}return!1},u),m=$e(p,2),v=m[0],_=m[1],y=qe.useState(),S=$e(y,2),L=S[0],E=S[1],D=qe.useState(),k=$e(D,2),T=k[0],M=k[1];return Cr(function(){E(Jre(o)),M(eoe(o))}),qe.useEffect(function(){(d.current.element!==L||!UUe(d.current.point,T)||!Tp(d.current.align,s))&&v()}),qe.useEffect(function(){var P=Qre(h.current,v);return P},[h.current]),qe.useEffect(function(){var P=Qre(L,v);return P},[L]),qe.useEffect(function(){r?_():v()},[r]),qe.useEffect(function(){if(l){var P=Zg(window,"resize",v);return P.remove}},[l]),qe.useEffect(function(){return function(){_()}},[]),qe.useImperativeHandle(t,function(){return{forceAlign:function(){return v(!0)}}}),qe.isValidElement(f)&&(f=qe.cloneElement(f,{ref:pu(f.ref,h)})),f},_0e=qe.forwardRef(KUe);_0e.displayName="Align";var toe=["measure","alignPre","align",null,"motion"];const GUe=function(i,e){var t=Cv(null),n=$e(t,2),r=n[0],o=n[1],s=C.useRef();function a(u){o(u,!0)}function l(){tr.cancel(s.current)}function c(u){l(),s.current=tr(function(){a(function(d){switch(r){case"align":return"motion";case"motion":return"stable"}return d}),u==null||u()})}return C.useEffect(function(){a("measure")},[i]),C.useEffect(function(){switch(r){case"measure":e();break}r&&(s.current=tr(mC(Nl().mark(function u(){var d,h;return Nl().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:d=toe.indexOf(r),h=toe[d+1],h&&d!==-1&&a(h);case 3:case"end":return g.stop()}},u)}))))},[r]),C.useEffect(function(){return function(){l()}},[]),[r,c]},qUe=function(i){var e=C.useState({width:0,height:0}),t=$e(e,2),n=t[0],r=t[1];function o(a){var l=a.offsetWidth,c=a.offsetHeight,u=a.getBoundingClientRect(),d=u.width,h=u.height;Math.abs(l-d)<1&&Math.abs(c-h)<1&&(l=d,c=h),r({width:l,height:c})}var s=C.useMemo(function(){var a={};if(i){var l=n.width,c=n.height;i.indexOf("height")!==-1&&c?a.height=c:i.indexOf("minHeight")!==-1&&c&&(a.minHeight=c),i.indexOf("width")!==-1&&l?a.width=l:i.indexOf("minWidth")!==-1&&l&&(a.minWidth=l)}return a},[i,n]);return[s,o]};var b0e=C.forwardRef(function(i,e){var t=i.visible,n=i.prefixCls,r=i.className,o=i.style,s=i.children,a=i.zIndex,l=i.stretch,c=i.destroyPopupOnHide,u=i.forceRender,d=i.align,h=i.point,f=i.getRootDomNode,g=i.getClassNameFromAlign,p=i.onAlign,m=i.onMouseEnter,v=i.onMouseLeave,_=i.onMouseDown,y=i.onTouchStart,S=i.onClick,L=C.useRef(),E=C.useRef(),D=C.useState(),k=$e(D,2),T=k[0],M=k[1],P=qUe(l),N=$e(P,2),R=N[0],O=N[1];function B(){l&&O(f())}var $=GUe(t,B),G=$e($,2),U=G[0],j=G[1],ie=C.useState(0),Y=$e(ie,2),J=Y[0],Q=Y[1],he=C.useRef();Cr(function(){U==="alignPre"&&Q(0)},[U]);function ge(){return h||f}function ye(){var Le;(Le=L.current)===null||Le===void 0||Le.forceAlign()}function be(Le,Pe){var Be=g(Pe);T!==Be&&M(Be),Q(function(Qe){return Qe+1}),U==="align"&&(p==null||p(Le,Pe))}Cr(function(){U==="align"&&(J<3?ye():j(function(){var Le;(Le=he.current)===null||Le===void 0||Le.call(he)}))},[J]);var Ge=te({},c0e(i));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Le){var Pe=Ge[Le];Ge[Le]=function(Be,Qe){return j(),Pe==null?void 0:Pe(Be,Qe)}});function nt(){return new Promise(function(Le){he.current=Le})}C.useEffect(function(){!Ge.motionName&&U==="motion"&&j()},[Ge.motionName,U]),C.useImperativeHandle(e,function(){return{forceAlign:ye,getElement:function(){return E.current}}});var je=te(te({},R),{},{zIndex:a,opacity:U==="motion"||U==="stable"||!t?void 0:0,pointerEvents:!t&&U!=="stable"?"none":void 0},o),_e=!0;d!=null&&d.points&&(U==="align"||U==="stable")&&(_e=!1);var Ve=s;return C.Children.count(s)>1&&(Ve=C.createElement("div",{className:"".concat(n,"-content")},s)),C.createElement(hd,It({visible:t,ref:E,leavedClassName:"".concat(n,"-hidden")},Ge,{onAppearPrepare:nt,onEnterPrepare:nt,removeOnLeave:c,forceRender:u}),function(Le,Pe){var Be=Le.className,Qe=Le.style,Ye=De(n,r,T,Be);return C.createElement(_0e,{target:ge(),key:"popup",ref:L,monitorWindowResize:!0,disabled:_e,align:d,onAlign:be},C.createElement("div",{ref:Pe,className:Ye,onMouseEnter:m,onMouseLeave:v,onMouseDownCapture:_,onTouchStartCapture:y,onClick:S,style:te(te({},Qe),je)},Ve))})});b0e.displayName="PopupInner";var C0e=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.visible,r=i.zIndex,o=i.children,s=i.mobile;s=s===void 0?{}:s;var a=s.popupClassName,l=s.popupStyle,c=s.popupMotion,u=c===void 0?{}:c,d=s.popupRender,h=i.onClick,f=C.useRef();C.useImperativeHandle(e,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var g=te({zIndex:r},l),p=o;return C.Children.count(o)>1&&(p=C.createElement("div",{className:"".concat(t,"-content")},o)),d&&(p=d(p)),C.createElement(hd,It({visible:n,ref:f,removeOnLeave:!0},u),function(m,v){var _=m.className,y=m.style,S=De(t,a,_);return C.createElement("div",{ref:v,className:S,onClick:h,style:te(te({},y),g)},p)})});C0e.displayName="MobilePopupInner";var XUe=["visible","mobile"],y0e=C.forwardRef(function(i,e){var t=i.visible,n=i.mobile,r=Mn(i,XUe),o=C.useState(t),s=$e(o,2),a=s[0],l=s[1],c=C.useState(!1),u=$e(c,2),d=u[0],h=u[1],f=te(te({},r),{},{visible:a});C.useEffect(function(){l(t),t&&n&&h(M4())},[t,n]);var g=d?C.createElement(C0e,It({},f,{mobile:n,ref:e})):C.createElement(b0e,It({},f,{ref:e}));return C.createElement("div",null,C.createElement(pUe,f),g)});y0e.displayName="Popup";var noe=C.createContext(null);function B6(){}function YUe(){return""}function ZUe(i){return i?i.ownerDocument:window.document}var QUe=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function JUe(i){var e=function(t){Sh(r,t);var n=xh(r);function r(o){var s;bs(this,r),s=n.call(this,o),we(zn(s),"popupRef",C.createRef()),we(zn(s),"triggerRef",C.createRef()),we(zn(s),"portalContainer",void 0),we(zn(s),"attachId",void 0),we(zn(s),"clickOutsideHandler",void 0),we(zn(s),"touchOutsideHandler",void 0),we(zn(s),"contextMenuOutsideHandler1",void 0),we(zn(s),"contextMenuOutsideHandler2",void 0),we(zn(s),"mouseDownTimeout",void 0),we(zn(s),"focusTime",void 0),we(zn(s),"preClickTime",void 0),we(zn(s),"preTouchTime",void 0),we(zn(s),"delayTimer",void 0),we(zn(s),"hasPopupMouseDown",void 0),we(zn(s),"onMouseEnter",function(l){var c=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",l),s.delaySetPopupVisible(!0,c,c?null:l)}),we(zn(s),"onMouseMove",function(l){s.fireEvents("onMouseMove",l),s.setPoint(l)}),we(zn(s),"onMouseLeave",function(l){s.fireEvents("onMouseLeave",l),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),we(zn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),we(zn(s),"onPopupMouseLeave",function(l){var c;l.relatedTarget&&!l.relatedTarget.setTimeout&&ab((c=s.popupRef.current)===null||c===void 0?void 0:c.getElement(),l.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),we(zn(s),"onFocus",function(l){s.fireEvents("onFocus",l),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),we(zn(s),"onMouseDown",function(l){s.fireEvents("onMouseDown",l),s.preClickTime=Date.now()}),we(zn(s),"onTouchStart",function(l){s.fireEvents("onTouchStart",l),s.preTouchTime=Date.now()}),we(zn(s),"onBlur",function(l){s.fireEvents("onBlur",l),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),we(zn(s),"onContextMenu",function(l){l.preventDefault(),s.fireEvents("onContextMenu",l),s.setPopupVisible(!0,l)}),we(zn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),we(zn(s),"onClick",function(l){if(s.fireEvents("onClick",l),s.focusTime){var c;if(s.preClickTime&&s.preTouchTime?c=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?c=s.preClickTime:s.preTouchTime&&(c=s.preTouchTime),Math.abs(c-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&l&&l.preventDefault&&l.preventDefault();var u=!s.state.popupVisible;(s.isClickToHide()&&!u||u&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,l)}),we(zn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var l;(l=s.context).onPopupMouseDown.apply(l,arguments)}}),we(zn(s),"onDocumentClick",function(l){if(!(s.props.mask&&!s.props.maskClosable)){var c=l.target,u=s.getRootDomNode(),d=s.getPopupDomNode();(!ab(u,c)||s.isContextMenuOnly())&&!ab(d,c)&&!s.hasPopupMouseDown&&s.close()}}),we(zn(s),"getRootDomNode",function(){var l=s.props.getTriggerDOMNode;if(l)return l(s.triggerRef.current);try{var c=FD(s.triggerRef.current);if(c)return c}catch{}return kw.findDOMNode(zn(s))}),we(zn(s),"getPopupClassNameFromAlign",function(l){var c=[],u=s.props,d=u.popupPlacement,h=u.builtinPlacements,f=u.prefixCls,g=u.alignPoint,p=u.getPopupClassNameFromAlign;return d&&h&&c.push(gUe(h,f,l,g)),p&&c.push(p(l)),c.join(" ")}),we(zn(s),"getComponent",function(){var l=s.props,c=l.prefixCls,u=l.destroyPopupOnHide,d=l.popupClassName,h=l.onPopupAlign,f=l.popupMotion,g=l.popupAnimation,p=l.popupTransitionName,m=l.popupStyle,v=l.mask,_=l.maskAnimation,y=l.maskTransitionName,S=l.maskMotion,L=l.zIndex,E=l.popup,D=l.stretch,k=l.alignPoint,T=l.mobile,M=l.forceRender,P=l.onPopupClick,N=s.state,R=N.popupVisible,O=N.point,B=s.getPopupAlign(),$={};return s.isMouseEnterToShow()&&($.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&($.onMouseLeave=s.onPopupMouseLeave),$.onMouseDown=s.onPopupMouseDown,$.onTouchStart=s.onPopupMouseDown,C.createElement(y0e,It({prefixCls:c,destroyPopupOnHide:u,visible:R,point:k&&O,className:d,align:B,onAlign:h,animation:g,getClassNameFromAlign:s.getPopupClassNameFromAlign},$,{stretch:D,getRootDomNode:s.getRootDomNode,style:m,mask:v,zIndex:L,transitionName:p,maskAnimation:_,maskTransitionName:y,maskMotion:S,ref:s.popupRef,motion:f,mobile:T,forceRender:M,onClick:P}),typeof E=="function"?E():E)}),we(zn(s),"attachParent",function(l){tr.cancel(s.attachId);var c=s.props,u=c.getPopupContainer,d=c.getDocument,h=s.getRootDomNode(),f;u?(h||u.length===0)&&(f=u(h)):f=d(s.getRootDomNode()).body,f?f.appendChild(l):s.attachId=tr(function(){s.attachParent(l)})}),we(zn(s),"getContainer",function(){if(!s.portalContainer){var l=s.props.getDocument,c=l(s.getRootDomNode()).createElement("div");c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width="100%",s.portalContainer=c}return s.attachParent(s.portalContainer),s.portalContainer}),we(zn(s),"setPoint",function(l){var c=s.props.alignPoint;!c||!l||s.setState({point:{pageX:l.pageX,pageY:l.pageY}})}),we(zn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),we(zn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},QUe.forEach(function(l){s["fire".concat(l)]=function(c){s.fireEvents(l,c)}}),s}return Cs(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var l;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(l=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Zg(l,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(l=l||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Zg(l,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(l=l||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Zg(l,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Zg(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tr.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,l=s.popupAlign,c=s.builtinPlacements;return a&&c?fUe(c,a,l):l}},{key:"setPopupVisible",value:function(s,a){var l=this.props.alignPoint,c=this.state.popupVisible;this.clearDelayTimer(),c!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:c}),this.props.onPopupVisibleChange(s)),l&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,l){var c=this,u=a*1e3;if(this.clearDelayTimer(),u){var d=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout(function(){c.setPopupVisible(s,d),c.clearDelayTimer()},u)}else this.setPopupVisible(s,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,l=this.props;return a[s]&&l[s]?this["fire".concat(s)]:a[s]||l[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("contextMenu")!==-1||l.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("hover")!==-1||l.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("hover")!==-1||l.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("focus")!==-1||l.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("focus")!==-1||l.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var l=this.props.children.props[s];l&&l(a);var c=this.props[s];c&&c(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,l=a.children,c=a.forceRender,u=a.alignPoint,d=a.className,h=a.autoDestroy,f=C.Children.only(l),g={key:"trigger"};this.isContextMenuToShow()?g.onContextMenu=this.onContextMenu:g.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(g.onClick=this.onClick,g.onMouseDown=this.onMouseDown,g.onTouchStart=this.onTouchStart):(g.onClick=this.createTwoChains("onClick"),g.onMouseDown=this.createTwoChains("onMouseDown"),g.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(g.onMouseEnter=this.onMouseEnter,u&&(g.onMouseMove=this.onMouseMove)):g.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?g.onMouseLeave=this.onMouseLeave:g.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(g.onFocus=this.onFocus,g.onBlur=this.onBlur):(g.onFocus=this.createTwoChains("onFocus"),g.onBlur=this.createTwoChains("onBlur"));var p=De(f&&f.props&&f.props.className,d);p&&(g.className=p);var m=te({},g);D_(f)&&(m.ref=pu(this.triggerRef,f.ref));var v=C.cloneElement(f,m),_;return(s||this.popupRef.current||c)&&(_=C.createElement(i,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!s&&h&&(_=null),C.createElement(noe.Provider,{value:this.triggerContextValue},v,_)}}],[{key:"getDerivedStateFromProps",value:function(s,a){var l=s.popupVisible,c={};return l!==void 0&&a.popupVisible!==l&&(c.popupVisible=l,c.prevPopupVisible=a.popupVisible),c}}]),r}(C.Component);return we(e,"contextType",noe),we(e,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:YUe,getDocument:ZUe,onPopupVisibleChange:B6,afterPopupVisibleChange:B6,onPopupAlign:B6,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),e}const w0e=JUe(dUe);var a1={adjustX:1,adjustY:1},l1=[0,0],eje={topLeft:{points:["bl","tl"],overflow:a1,offset:[0,-4],targetOffset:l1},topCenter:{points:["bc","tc"],overflow:a1,offset:[0,-4],targetOffset:l1},topRight:{points:["br","tr"],overflow:a1,offset:[0,-4],targetOffset:l1},bottomLeft:{points:["tl","bl"],overflow:a1,offset:[0,4],targetOffset:l1},bottomCenter:{points:["tc","bc"],overflow:a1,offset:[0,4],targetOffset:l1},bottomRight:{points:["tr","br"],overflow:a1,offset:[0,4],targetOffset:l1}};function ioe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(qk(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),r=i.getAttribute("tabindex"),o=Number(r),s=null;return r&&!Number.isNaN(o)?s=o:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function S0e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=gt(i.querySelectorAll("*")).filter(function(n){return ioe(n,e)});return ioe(i,e)&&t.unshift(i),t}var tje=_t.ESC,nje=_t.TAB;function ije(i){var e=i.visible,t=i.setTriggerVisible,n=i.triggerRef,r=i.onVisibleChange,o=i.autoFocus,s=C.useRef(!1),a=function(){if(e&&n.current){var d,h,f,g;(d=n.current)===null||d===void 0||(h=d.triggerRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.focus)===null||g===void 0||g.call(f),t(!1),typeof r=="function"&&r(!1)}},l=function(){var d,h,f,g,p=S0e((d=n.current)===null||d===void 0||(h=d.popupRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.getElement)===null||g===void 0?void 0:g.call(f)),m=p[0];return m!=null&&m.focus?(m.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case tje:a();break;case nje:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};C.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&tr(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var rje=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"];function oje(i,e){var t=i.arrow,n=t===void 0?!1:t,r=i.prefixCls,o=r===void 0?"rc-dropdown":r,s=i.transitionName,a=i.animation,l=i.align,c=i.placement,u=c===void 0?"bottomLeft":c,d=i.placements,h=d===void 0?eje:d,f=i.getPopupContainer,g=i.showAction,p=i.hideAction,m=i.overlayClassName,v=i.overlayStyle,_=i.visible,y=i.trigger,S=y===void 0?["hover"]:y,L=i.autoFocus,E=Mn(i,rje),D=C.useState(),k=$e(D,2),T=k[0],M=k[1],P="visible"in i?_:T,N=C.useRef(null);C.useImperativeHandle(e,function(){return N.current}),ije({visible:P,setTriggerVisible:M,triggerRef:N,onVisibleChange:i.onVisibleChange,autoFocus:L});var R=function(){var Q=i.overlay,he;return typeof Q=="function"?he=Q():he=Q,he},O=function(Q){var he=i.onOverlayClick;M(!1),he&&he(Q)},B=function(Q){var he=i.onVisibleChange;M(Q),typeof he=="function"&&he(Q)},$=function(){var Q=R();return C.createElement(C.Fragment,null,n&&C.createElement("div",{className:"".concat(o,"-arrow")}),Q)},G=function(){var Q=i.overlay;return typeof Q=="function"?$:$()},U=function(){var Q=i.minOverlayWidthMatchTrigger,he=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Q:!he},j=function(){var Q=i.openClassName;return Q!==void 0?Q:"".concat(o,"-open")},ie=function(){var Q=i.children,he=Q.props?Q.props:{},ge=De(he.className,j());return P&&Q?C.cloneElement(Q,{className:ge}):Q},Y=p;return!Y&&S.indexOf("contextMenu")!==-1&&(Y=["click"]),C.createElement(w0e,te(te({builtinPlacements:h},E),{},{prefixCls:o,ref:N,popupClassName:De(m,we({},"".concat(o,"-show-arrow"),n)),popupStyle:v,action:S,showAction:g,hideAction:Y||[],popupPlacement:u,popupAlign:l,popupTransitionName:s,popupAnimation:a,popupVisible:P,stretch:U()?"minWidth":"",popup:G(),onPopupVisibleChange:B,onPopupClick:O,getPopupContainer:f}),ie())}const sje=C.forwardRef(oje);var x0e=C.createContext(null);function dX(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function L0e(i){var e=C.useContext(x0e);return dX(e,i)}var aje=["children","locked"],dh=C.createContext(null);function lje(i,e){var t=te({},i);return Object.keys(e).forEach(function(n){var r=e[n];r!==void 0&&(t[n]=r)}),t}function KD(i){var e=i.children,t=i.locked,n=Mn(i,aje),r=C.useContext(dh),o=pC(function(){return lje(r,n)},[r,n],function(s,a){return!t&&(s[0]!==a[0]||!Tp(s[1],a[1],!0))});return C.createElement(dh.Provider,{value:o},e)}var cje=[],E0e=C.createContext(null);function B4(){return C.useContext(E0e)}var D0e=C.createContext(cje);function WS(i){var e=C.useContext(D0e);return C.useMemo(function(){return i!==void 0?[].concat(gt(e),[i]):e},[e,i])}var I0e=C.createContext(null),hX=C.createContext({}),CH=_t.LEFT,yH=_t.RIGHT,wH=_t.UP,SM=_t.DOWN,xM=_t.ENTER,k0e=_t.ESC,Kx=_t.HOME,Gx=_t.END,roe=[wH,SM,CH,yH];function uje(i,e,t,n){var r,o,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===xM)return{inlineTrigger:!0};var h=(r={},we(r,wH,l),we(r,SM,c),r),f=(o={},we(o,CH,t?c:l),we(o,yH,t?l:c),we(o,SM,u),we(o,xM,u),o),g=(s={},we(s,wH,l),we(s,SM,c),we(s,xM,u),we(s,k0e,d),we(s,CH,t?u:d),we(s,yH,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},m=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(m){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function dje(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function hje(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function T0e(i,e){var t=S0e(i,!0);return t.filter(function(n){return e.has(n)})}function ooe(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var r=T0e(i,e),o=r.length,s=r.findIndex(function(a){return t===a});return n<0?s===-1?s=o-1:s-=1:n>0&&(s+=1),s=(s+o)%o,r[s]}function fje(i,e,t,n,r,o,s,a,l,c){var u=C.useRef(),d=C.useRef();d.current=e;var h=function(){tr.cancel(u.current)};return C.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(roe,[xM,k0e,Kx,Gx]).includes(g)){var p,m,v,_=function(){p=new Set,m=new Map,v=new Map;var B=o();return B.forEach(function($){var G=document.querySelector("[data-menu-id='".concat(dX(n,$),"']"));G&&(p.add(G),v.set(G,$),m.set($,G))}),p};_();var y=m.get(e),S=hje(y,p),L=v.get(S),E=uje(i,s(L,!0).length===1,t,g);if(!E&&g!==Kx&&g!==Gx)return;(roe.includes(g)||[Kx,Gx].includes(g))&&f.preventDefault();var D=function(B){if(B){var $=B,G=B.querySelector("a");G!=null&&G.getAttribute("href")&&($=G);var U=v.get(B);a(U),h(),u.current=tr(function(){d.current===U&&$.focus()})}};if([Kx,Gx].includes(g)||E.sibling||!S){var k;!S||i==="inline"?k=r.current:k=dje(S);var T,M=T0e(k,p);g===Kx?T=M[0]:g===Gx?T=M[M.length-1]:T=ooe(k,p,S,E.offset),D(T)}else if(E.inlineTrigger)l(L);else if(E.offset>0)l(L,!0),h(),u.current=tr(function(){_();var O=S.getAttribute("aria-controls"),B=document.getElementById(O),$=ooe(B,p);D($)},5);else if(E.offset<0){var P=s(L,!0),N=P[P.length-2],R=m.get(N);l(N,!1),D(R)}}c==null||c(f)}}function gje(i){Promise.resolve().then(i)}var fX="__RC_UTIL_PATH_SPLIT__",soe=function(e){return e.join(fX)},pje=function(e){return e.split(fX)},SH="rc-menu-more";function mje(){var i=C.useState({}),e=$e(i,2),t=e[1],n=C.useRef(new Map),r=C.useRef(new Map),o=C.useState([]),s=$e(o,2),a=s[0],l=s[1],c=C.useRef(0),u=C.useRef(!1),d=function(){u.current||t({})},h=C.useCallback(function(y,S){var L=soe(S);r.current.set(L,y),n.current.set(y,L),c.current+=1;var E=c.current;gje(function(){E===c.current&&d()})},[]),f=C.useCallback(function(y,S){var L=soe(S);r.current.delete(L),n.current.delete(y)},[]),g=C.useCallback(function(y){l(y)},[]),p=C.useCallback(function(y,S){var L=n.current.get(y)||"",E=pje(L);return S&&a.includes(E[0])&&E.unshift(SH),E},[a]),m=C.useCallback(function(y,S){return y.some(function(L){var E=p(L,!0);return E.includes(S)})},[p]),v=function(){var S=gt(n.current.keys());return a.length&&S.push(SH),S},_=C.useCallback(function(y){var S="".concat(n.current.get(y)).concat(fX),L=new Set;return gt(r.current.keys()).forEach(function(E){E.startsWith(S)&&L.add(r.current.get(E))}),L},[]);return C.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:m,getKeyPath:p,getKeys:v,getSubPathKeys:_}}function A1(i){var e=C.useRef(i);e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(S){return!h.current&&!S&&m(!0),y==null?void 0:y(S)},p?null:C.createElement(KD,{mode:o,locked:!h.current},C.createElement(hd,It({visible:v},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(S){var L=S.className,E=S.style;return C.createElement(gX,{id:e,className:L,style:E},r)}))}var Aje=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Oje=["active"],Fje=function(e){var t,n=e.style,r=e.className,o=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.onClick,p=e.onMouseEnter,m=e.onMouseLeave,v=e.onTitleClick,_=e.onTitleMouseEnter,y=e.onTitleMouseLeave,S=Mn(e,Aje),L=L0e(s),E=C.useContext(dh),D=E.prefixCls,k=E.mode,T=E.openKeys,M=E.disabled,P=E.overflowDisabled,N=E.activeKey,R=E.selectedKeys,O=E.itemIcon,B=E.expandIcon,$=E.onItemClick,G=E.onOpenChange,U=E.onActive,j=C.useContext(hX),ie=j._internalRenderSubMenuItem,Y=C.useContext(I0e),J=Y.isSubPathKey,Q=WS(),he="".concat(D,"-submenu"),ge=M||a,ye=C.useRef(),be=C.useRef(),Ge=u||O,nt=d||B,je=T.includes(s),_e=!P&&je,Ve=J(R,s),Le=N0e(s,ge,_,y),Pe=Le.active,Be=Mn(Le,Oje),Qe=C.useState(!1),Ye=$e(Qe,2),We=Ye[0],dt=Ye[1],re=function(Me){ge||dt(Me)},ue=function(Me){re(!0),p==null||p({key:s,domEvent:Me})},de=function(Me){re(!1),m==null||m({key:s,domEvent:Me})},z=C.useMemo(function(){return Pe||(k!=="inline"?We||J([N],s):!1)},[k,Pe,N,We,s,J]),q=R0e(Q.length),se=function(Me){ge||(v==null||v({key:s,domEvent:Me}),k==="inline"&&G(s,!je))},ne=A1(function(He){g==null||g(cA(He)),$(He)}),pe=function(Me){k!=="inline"&&G(s,Me)},ke=function(){U(s)},oe=L&&"".concat(L,"-popup"),ce=C.createElement("div",It({role:"menuitem",style:q,className:"".concat(he,"-title"),tabIndex:ge?null:-1,ref:ye,title:typeof o=="string"?o:null,"data-menu-id":P&&L?null:L,"aria-expanded":_e,"aria-haspopup":!0,"aria-controls":oe,"aria-disabled":ge,onClick:se,onFocus:ke},Be),o,C.createElement(M0e,{icon:k!=="horizontal"?nt:null,props:te(te({},e),{},{isOpen:_e,isSubMenu:!0})},C.createElement("i",{className:"".concat(he,"-arrow")}))),fe=C.useRef(k);if(k!=="inline"&&Q.length>1?fe.current="vertical":fe.current=k,!P){var Ie=fe.current;ce=C.createElement(Mje,{mode:Ie,prefixCls:he,visible:!l&&_e&&k!=="inline",popupClassName:h,popupOffset:f,popup:C.createElement(KD,{mode:Ie==="horizontal"?"vertical":Ie},C.createElement(gX,{id:oe,ref:be},c)),disabled:ge,onVisibleChange:pe},ce)}var Te=C.createElement(Nf.Item,It({role:"none"},S,{component:"li",style:n,className:De(he,"".concat(he,"-").concat(k),r,(t={},we(t,"".concat(he,"-open"),_e),we(t,"".concat(he,"-active"),z),we(t,"".concat(he,"-selected"),Ve),we(t,"".concat(he,"-disabled"),ge),t)),onMouseEnter:ue,onMouseLeave:de}),ce,!P&&C.createElement(Pje,{id:oe,open:_e,keyPath:Q},c));return ie&&(Te=ie(Te,e,{selected:Ve,active:z,open:_e,disabled:ge})),C.createElement(KD,{onItemClick:ne,mode:k==="horizontal"?"vertical":k,itemIcon:Ge,expandIcon:nt},Te)};function $4(i){var e=i.eventKey,t=i.children,n=WS(e),r=pX(t,n),o=B4();C.useEffect(function(){if(o)return o.registerPath(e,n),function(){o.unregisterPath(e,n)}},[n]);var s;return o?s=r:s=C.createElement(Fje,i,r),C.createElement(D0e.Provider,{value:n},s)}var Bje=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],c1=[],Wje=C.forwardRef(function(i,e){var t,n,r=i,o=r.prefixCls,s=o===void 0?"rc-menu":o,a=r.rootClassName,l=r.style,c=r.className,u=r.tabIndex,d=u===void 0?0:u,h=r.items,f=r.children,g=r.direction,p=r.id,m=r.mode,v=m===void 0?"vertical":m,_=r.inlineCollapsed,y=r.disabled,S=r.disabledOverflow,L=r.subMenuOpenDelay,E=L===void 0?.1:L,D=r.subMenuCloseDelay,k=D===void 0?.1:D,T=r.forceSubMenuRender,M=r.defaultOpenKeys,P=r.openKeys,N=r.activeKey,R=r.defaultActiveFirst,O=r.selectable,B=O===void 0?!0:O,$=r.multiple,G=$===void 0?!1:$,U=r.defaultSelectedKeys,j=r.selectedKeys,ie=r.onSelect,Y=r.onDeselect,J=r.inlineIndent,Q=J===void 0?24:J,he=r.motion,ge=r.defaultMotions,ye=r.triggerSubMenuAction,be=ye===void 0?"hover":ye,Ge=r.builtinPlacements,nt=r.itemIcon,je=r.expandIcon,_e=r.overflowedIndicator,Ve=_e===void 0?"...":_e,Le=r.overflowedIndicatorPopupClassName,Pe=r.getPopupContainer,Be=r.onClick,Qe=r.onOpenChange,Ye=r.onKeyDown;r.openAnimation,r.openTransitionName;var We=r._internalRenderMenuItem,dt=r._internalRenderSubMenuItem,re=Mn(r,Bje),ue=C.useMemo(function(){return kje(f,h,c1)},[f,h]),de=C.useState(!1),z=$e(de,2),q=z[0],se=z[1],ne=C.useRef(),pe=_je(p),ke=g==="rtl",oe=nl(M,{value:P,postState:function($t){return $t||c1}}),ce=$e(oe,2),fe=ce[0],Ie=ce[1],Te=function($t){var On=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Jt(){Ie($t),Qe==null||Qe($t)}On?lh.flushSync(Jt):Jt()},He=C.useState(fe),Me=$e(He,2),bt=Me[0],rt=Me[1],Ht=C.useRef(!1),Ue=C.useMemo(function(){return(v==="inline"||v==="vertical")&&_?["vertical",_]:[v,!1]},[v,_]),Ct=$e(Ue,2),Dt=Ct[0],St=Ct[1],Kt=Dt==="inline",_n=C.useState(Dt),zt=$e(_n,2),Yt=zt[0],at=zt[1],ut=C.useState(St),ht=$e(ut,2),Lt=ht[0],At=ht[1];C.useEffect(function(){at(Dt),At(St),Ht.current&&(Kt?Ie(bt):Te(c1))},[Dt,St]);var ln=C.useState(0),Si=$e(ln,2),Xi=Si[0],Ir=Si[1],En=Xi>=ue.length-1||Yt!=="horizontal"||S;C.useEffect(function(){Kt&&rt(fe)},[fe]),C.useEffect(function(){return Ht.current=!0,function(){Ht.current=!1}},[]);var fi=mje(),Ur=fi.registerPath,go=fi.unregisterPath,ys=fi.refreshOverflowKeys,ws=fi.isSubPathKey,Ut=fi.getKeyPath,Ee=fi.getKeys,wt=fi.getSubPathKeys,kt=C.useMemo(function(){return{registerPath:Ur,unregisterPath:go}},[Ur,go]),qn=C.useMemo(function(){return{isSubPathKey:ws}},[ws]);C.useEffect(function(){ys(En?c1:ue.slice(Xi+1).map(function(Qt){return Qt.key}))},[Xi,En]);var dr=nl(N||R&&((t=ue[0])===null||t===void 0?void 0:t.key),{value:N}),jr=$e(dr,2),ei=jr[0],to=jr[1],$s=A1(function(Qt){to(Qt)}),Hl=A1(function(){to(void 0)});C.useImperativeHandle(e,function(){return{list:ne.current,focus:function($t){var On,Jt=ei??((On=ue.find(function(So){return!So.props.disabled}))===null||On===void 0?void 0:On.key);if(Jt){var Zt,oi,Wi;(Zt=ne.current)===null||Zt===void 0||(oi=Zt.querySelector("li[data-menu-id='".concat(dX(pe,Jt),"']")))===null||oi===void 0||(Wi=oi.focus)===null||Wi===void 0||Wi.call(oi,$t)}}}});var Oa=nl(U||[],{value:j,postState:function($t){return Array.isArray($t)?$t:$t==null?c1:[$t]}}),Uo=$e(Oa,2),wo=Uo[0],Fa=Uo[1],Ba=function($t){if(B){var On=$t.key,Jt=wo.includes(On),Zt;G?Jt?Zt=wo.filter(function(Wi){return Wi!==On}):Zt=[].concat(gt(wo),[On]):Zt=[On],Fa(Zt);var oi=te(te({},$t),{},{selectedKeys:Zt});Jt?Y==null||Y(oi):ie==null||ie(oi)}!G&&fe.length&&Yt!=="inline"&&Te(c1)},Vl=A1(function(Qt){Be==null||Be(cA(Qt)),Ba(Qt)}),fl=A1(function(Qt,$t){var On=fe.filter(function(Zt){return Zt!==Qt});if($t)On.push(Qt);else if(Yt!=="inline"){var Jt=wt(Qt);On=On.filter(function(Zt){return!Jt.has(Zt)})}Tp(fe,On,!0)||Te(On,!0)}),zl=A1(Pe),yu=function($t,On){var Jt=On??!fe.includes($t);fl($t,Jt)},wu=fje(Yt,ei,ke,pe,ne,Ee,Ut,to,yu,Ye);C.useEffect(function(){se(!0)},[]);var Ic=C.useMemo(function(){return{_internalRenderMenuItem:We,_internalRenderSubMenuItem:dt}},[We,dt]),Wa=Yt!=="horizontal"||S?ue:ue.map(function(Qt,$t){return C.createElement(KD,{key:Qt.key,overflowDisabled:$t>Xi},Qt)}),$a=C.createElement(Nf,It({id:p,ref:ne,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:W4,className:De(s,"".concat(s,"-root"),"".concat(s,"-").concat(Yt),c,(n={},we(n,"".concat(s,"-inline-collapsed"),Lt),we(n,"".concat(s,"-rtl"),ke),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Wa,renderRawItem:function($t){return $t},renderRawRest:function($t){var On=$t.length,Jt=On?ue.slice(-On):null;return C.createElement($4,{eventKey:SH,title:Ve,disabled:En,internalPopupClose:On===0,popupClassName:Le},Jt)},maxCount:Yt!=="horizontal"||S?Nf.INVALIDATE:Nf.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function($t){Ir($t)},onKeyDown:wu},re));return C.createElement(hX.Provider,{value:Ic},C.createElement(x0e.Provider,{value:pe},C.createElement(KD,{prefixCls:s,rootClassName:a,mode:Yt,openKeys:fe,rtl:ke,disabled:y,motion:q?he:null,defaultMotions:q?ge:null,activeKey:ei,onActive:$s,onInactive:Hl,selectedKeys:wo,inlineIndent:Q,subMenuOpenDelay:E,subMenuCloseDelay:k,forceSubMenuRender:T,builtinPlacements:Ge,triggerSubMenuAction:be,getPopupContainer:zl,itemIcon:nt,expandIcon:je,onItemClick:Vl,onOpenChange:fl},C.createElement(I0e.Provider,{value:qn},$a),C.createElement("div",{style:{display:"none"},"aria-hidden":!0},C.createElement(E0e.Provider,{value:kt},ue)))))}),$je=["className","title","eventKey","children"],Hje=["children"],Vje=function(e){var t=e.className,n=e.title;e.eventKey;var r=e.children,o=Mn(e,$je),s=C.useContext(dh),a=s.prefixCls,l="".concat(a,"-item-group");return C.createElement("li",It({role:"presentation"},o,{onClick:function(u){return u.stopPropagation()},className:De(l,t)}),C.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),C.createElement("ul",{role:"group",className:"".concat(l,"-list")},r))};function H4(i){var e=i.children,t=Mn(i,Hje),n=WS(t.eventKey),r=pX(e,n),o=B4();return o?r:C.createElement(Vje,cl(t,["warnKey"]),r)}function mX(i){var e=i.className,t=i.style,n=C.useContext(dh),r=n.prefixCls,o=B4();return o?null:C.createElement("li",{className:De("".concat(r,"-item-divider"),e),style:t})}var eT=Wje;eT.Item=W4;eT.SubMenu=$4;eT.ItemGroup=H4;eT.Divider=mX;const zje=i=>{const{componentCls:e,motionDurationSlow:t,menuHorizontalHeight:n,colorSplit:r,lineWidth:o,lineType:s,menuItemPaddingInline:a}=i;return{[`${e}-horizontal`]:{lineHeight:`${n}px`,border:0,borderBottom:`${o}px ${s} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:a},[`> ${e}-item:hover, > ${e}-item-active, > ${e}-submenu ${e}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${e}-item, ${e}-submenu-title`]:{transition:[`border-color ${t}`,`background ${t}`].join(",")},[`${e}-submenu-arrow`]:{display:"none"}}}},Uje=zje,jje=i=>{let{componentCls:e,menuArrowOffset:t}=i;return{[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical, ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${t})`},"&::after":{transform:`rotate(45deg) translateY(${t})`}}}}},Kje=jje,loe=i=>Object.assign({},Np(i)),Gje=(i,e)=>{const{componentCls:t,colorItemText:n,colorItemTextSelected:r,colorGroupTitle:o,colorItemBg:s,colorSubItemBg:a,colorItemBgSelected:l,colorActiveBarHeight:c,colorActiveBarWidth:u,colorActiveBarBorderSize:d,motionDurationSlow:h,motionEaseInOut:f,motionEaseOut:g,menuItemPaddingInline:p,motionDurationMid:m,colorItemTextHover:v,lineType:_,colorSplit:y,colorItemTextDisabled:S,colorDangerItemText:L,colorDangerItemTextHover:E,colorDangerItemTextSelected:D,colorDangerItemBgActive:k,colorDangerItemBgSelected:T,colorItemBgHover:M,menuSubMenuBg:P,colorItemTextSelectedHorizontal:N,colorItemBgSelectedHorizontal:R}=i;return{[`${t}-${e}, ${t}-${e} > ${t}`]:{color:n,background:s,[`&${t}-root:focus-visible`]:Object.assign({},loe(i)),[`${t}-item-group-title`]:{color:o},[`${t}-submenu-selected`]:{[`> ${t}-submenu-title`]:{color:r}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{color:`${S} !important`},[`${t}-item:hover, ${t}-submenu-title:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:v}},[`&:not(${t}-horizontal)`]:{[`${t}-item:not(${t}-item-selected)`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}},[`${t}-submenu-title`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}}},[`${t}-item-danger`]:{color:L,[`&${t}-item:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:E}},[`&${t}-item:active`]:{background:k}},[`${t}-item a`]:{"&, &:hover":{color:"inherit"}},[`${t}-item-selected`]:{color:r,[`&${t}-item-danger`]:{color:D},["a, a:hover"]:{color:"inherit"}},[`& ${t}-item-selected`]:{backgroundColor:l,[`&${t}-item-danger`]:{backgroundColor:T}},[`${t}-item, ${t}-submenu-title`]:{[`&:not(${t}-item-disabled):focus-visible`]:Object.assign({},loe(i))},[`&${t}-submenu > ${t}`]:{backgroundColor:P},[`&${t}-popup > ${t}`]:{backgroundColor:s},[`&${t}-horizontal`]:Object.assign(Object.assign({},e==="dark"?{borderBottom:0}:{}),{[`> ${t}-item, > ${t}-submenu`]:{top:d,marginTop:-d,marginBottom:0,borderRadius:0,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${c}px solid transparent`,transition:`border-color ${h} ${f}`,content:'""'},["&:hover, &-active, &-open"]:{"&::after":{borderBottomWidth:c,borderBottomColor:N}},["&-selected"]:{color:N,backgroundColor:R,"&::after":{borderBottomWidth:c,borderBottomColor:N}}}}),[`&${t}-root`]:{[`&${t}-inline, &${t}-vertical`]:{borderInlineEnd:`${d}px ${_} ${y}`}},[`&${t}-inline`]:{[`${t}-sub${t}-inline`]:{background:a},[`${t}-item, ${t}-submenu-title`]:d&&u?{width:`calc(100% + ${d}px)`}:{},[`${t}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${u}px solid ${r}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${m} ${g}`,`opacity ${m} ${g}`].join(","),content:'""'},[`&${t}-item-danger`]:{"&::after":{borderInlineEndColor:D}}},[`${t}-selected, ${t}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${m} ${f}`,`opacity ${m} ${f}`].join(",")}}}}}},coe=Gje,uoe=i=>{const{componentCls:e,menuItemHeight:t,itemMarginInline:n,padding:r,menuArrowSize:o,marginXS:s,marginXXS:a}=i,l=r+o+s;return{[`${e}-item`]:{position:"relative"},[`${e}-item, ${e}-submenu-title`]:{height:t,lineHeight:`${t}px`,paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:a,width:`calc(100% - ${n*2}px)`},[`${e}-submenu`]:{paddingBottom:.02},[`> ${e}-item, @@ -316,7 +316,7 @@ html body { > ${e}-submenu > ${e}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${u}px)`,textOverflow:"clip",[` ${e}-submenu-arrow, ${e}-submenu-expand-icon - `]:{opacity:0},[`${e}-item-icon, ${t}`]:{margin:0,fontSize:d,lineHeight:`${n}px`,"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},lb),{paddingInline:f})}}]},Xje=qje,doe=i=>{const{componentCls:e,fontSize:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:s,iconCls:a,controlHeightSM:l}=i;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${o}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:t,fontSize:t,transition:[`font-size ${r} ${s}`,`margin ${n} ${o}`,`color ${n}`].join(","),"+ span":{marginInlineStart:l-t,opacity:1,transition:[`opacity ${n} ${o}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},Kk()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},hoe=i=>{const{componentCls:e,motionDurationSlow:t,motionEaseInOut:n,borderRadius:r,menuArrowSize:o,menuArrowOffset:s}=i;return{[`${e}-submenu`]:{["&-expand-icon, &-arrow"]:{position:"absolute",top:"50%",insetInlineEnd:i.margin,width:o,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${n}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:o*.6,height:o*.15,backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${t} ${n}`,`transform ${t} ${n}`,`top ${t} ${n}`,`color ${t} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${s})`},"&::after":{transform:`rotate(-45deg) translateY(${s})`}}}}},Yje=i=>{const{antCls:e,componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:o,motionEaseInOut:s,lineHeight:a,paddingXS:l,padding:c,colorSplit:u,lineWidth:d,zIndexPopup:h,borderRadiusLG:f,radiusSubMenuItem:g,menuArrowSize:p,menuArrowOffset:m,lineType:v,menuPanelMaskInset:_}=i;return[{"":{[`${t}`]:Object.assign(Object.assign({},VD()),{["&-hidden"]:{display:"none"}})},[`${t}-submenu-hidden`]:{display:"none"}},{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),VD()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:[`background ${r}`,`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`].join(","),["ul, ol"]:{margin:0,padding:0,listStyle:"none"},["&-overflow"]:{display:"flex",[`${t}-item`]:{flex:"none"}},[`${t}-item, ${t}-submenu, ${t}-submenu-title`]:{borderRadius:i.radiusItem},[`${t}-item-group-title`]:{padding:`${l}px ${c}px`,fontSize:n,lineHeight:a,transition:`all ${r}`},[`&-horizontal ${t}-submenu`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`].join(",")},[`${t}-submenu, ${t}-submenu-inline`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`,`padding ${o} ${s}`].join(",")},[`${t}-submenu ${t}-sub`]:{cursor:"initial",transition:[`background ${r} ${s}`,`padding ${r} ${s}`].join(",")},[`${t}-title-content`]:{transition:`color ${r}`},[`${t}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${t}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:v,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),doe(i)),{[`${t}-item-group`]:{[`${t}-item-group-list`]:{margin:0,padding:0,[`${t}-item, ${t}-submenu-title`]:{paddingInline:`${n*2}px ${c}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:h,background:"transparent",borderRadius:f,boxShadow:"none",transformOrigin:"0 0","&::before":{position:"absolute",inset:`${_}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:_},[`> ${t}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},doe(i)),hoe(i)),{[`${t}-item, ${t}-submenu > ${t}-submenu-title`]:{borderRadius:g},[`${t}-submenu-title::after`]:{transition:`transform ${r} ${s}`}})}}),hoe(i)),{[`&-inline-collapsed ${t}-submenu-arrow, + `]:{opacity:0},[`${e}-item-icon, ${t}`]:{margin:0,fontSize:d,lineHeight:`${n}px`,"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},cb),{paddingInline:f})}}]},Xje=qje,doe=i=>{const{componentCls:e,fontSize:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:s,iconCls:a,controlHeightSM:l}=i;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${o}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:t,fontSize:t,transition:[`font-size ${r} ${s}`,`margin ${n} ${o}`,`color ${n}`].join(","),"+ span":{marginInlineStart:l-t,opacity:1,transition:[`opacity ${n} ${o}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},Kk()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},hoe=i=>{const{componentCls:e,motionDurationSlow:t,motionEaseInOut:n,borderRadius:r,menuArrowSize:o,menuArrowOffset:s}=i;return{[`${e}-submenu`]:{["&-expand-icon, &-arrow"]:{position:"absolute",top:"50%",insetInlineEnd:i.margin,width:o,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${n}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:o*.6,height:o*.15,backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${t} ${n}`,`transform ${t} ${n}`,`top ${t} ${n}`,`color ${t} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${s})`},"&::after":{transform:`rotate(-45deg) translateY(${s})`}}}}},Yje=i=>{const{antCls:e,componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:o,motionEaseInOut:s,lineHeight:a,paddingXS:l,padding:c,colorSplit:u,lineWidth:d,zIndexPopup:h,borderRadiusLG:f,radiusSubMenuItem:g,menuArrowSize:p,menuArrowOffset:m,lineType:v,menuPanelMaskInset:_}=i;return[{"":{[`${t}`]:Object.assign(Object.assign({},VD()),{["&-hidden"]:{display:"none"}})},[`${t}-submenu-hidden`]:{display:"none"}},{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),VD()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:[`background ${r}`,`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`].join(","),["ul, ol"]:{margin:0,padding:0,listStyle:"none"},["&-overflow"]:{display:"flex",[`${t}-item`]:{flex:"none"}},[`${t}-item, ${t}-submenu, ${t}-submenu-title`]:{borderRadius:i.radiusItem},[`${t}-item-group-title`]:{padding:`${l}px ${c}px`,fontSize:n,lineHeight:a,transition:`all ${r}`},[`&-horizontal ${t}-submenu`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`].join(",")},[`${t}-submenu, ${t}-submenu-inline`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`,`padding ${o} ${s}`].join(",")},[`${t}-submenu ${t}-sub`]:{cursor:"initial",transition:[`background ${r} ${s}`,`padding ${r} ${s}`].join(",")},[`${t}-title-content`]:{transition:`color ${r}`},[`${t}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${t}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:v,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),doe(i)),{[`${t}-item-group`]:{[`${t}-item-group-list`]:{margin:0,padding:0,[`${t}-item, ${t}-submenu-title`]:{paddingInline:`${n*2}px ${c}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:h,background:"transparent",borderRadius:f,boxShadow:"none",transformOrigin:"0 0","&::before":{position:"absolute",inset:`${_}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:_},[`> ${t}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},doe(i)),hoe(i)),{[`${t}-item, ${t}-submenu > ${t}-submenu-title`]:{borderRadius:g},[`${t}-submenu-title::after`]:{transition:`transform ${r} ${s}`}})}}),hoe(i)),{[`&-inline-collapsed ${t}-submenu-arrow, &-inline ${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${m})`},"&::after":{transform:`rotate(45deg) translateX(-${m})`}},[`${t}-submenu-open${t}-submenu-inline > ${t}-submenu-title > ${t}-submenu-arrow`]:{transform:`translateY(-${p*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${m})`},"&::before":{transform:`rotate(45deg) translateX(${m})`}}})},{[`${e}-layout-header`]:{[t]:{lineHeight:"inherit"}}}]},Zje=(i,e)=>yo("Menu",(n,r)=>{let{overrideComponentToken:o}=r;if(e===!1)return[];const{colorBgElevated:s,colorPrimary:a,colorError:l,colorErrorHover:c,colorTextLightSolid:u,controlHeightLG:d,fontSize:h}=n,f=h/7*5,g=Bi(n,{menuItemHeight:d,menuItemPaddingInline:n.margin,menuArrowSize:f,menuHorizontalHeight:d*1.15,menuArrowOffset:`${f*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:s}),p=new Jr(u).setAlpha(.65).toRgbString(),m=Bi(g,{colorItemText:p,colorItemTextHover:u,colorGroupTitle:p,colorItemTextSelected:u,colorItemBg:"#001529",colorSubItemBg:"#000c17",colorItemBgActive:"transparent",colorItemBgSelected:a,colorActiveBarWidth:0,colorActiveBarHeight:0,colorActiveBarBorderSize:0,colorItemTextDisabled:new Jr(u).setAlpha(.25).toRgbString(),colorDangerItemText:l,colorDangerItemTextHover:c,colorDangerItemTextSelected:u,colorDangerItemBgActive:l,colorDangerItemBgSelected:l,menuSubMenuBg:"#001529",colorItemTextSelectedHorizontal:u,colorItemBgSelectedHorizontal:a},Object.assign({},o));return[Yje(g),Uje(g),Xje(g),coe(g,"light"),coe(m,"dark"),Kje(g),m_e(g),Bw(g,"slide-up"),Bw(g,"slide-down"),Xk(g,"zoom-big")]},n=>{const{colorPrimary:r,colorError:o,colorTextDisabled:s,colorErrorBg:a,colorText:l,colorTextDescription:c,colorBgContainer:u,colorFillAlter:d,colorFillContent:h,lineWidth:f,lineWidthBold:g,controlItemBgActive:p,colorBgTextHover:m}=n;return{dropdownWidth:160,zIndexPopup:n.zIndexPopupBase+50,radiusItem:n.borderRadiusLG,radiusSubMenuItem:n.borderRadiusSM,colorItemText:l,colorItemTextHover:l,colorItemTextHoverHorizontal:r,colorGroupTitle:c,colorItemTextSelected:r,colorItemTextSelectedHorizontal:r,colorItemBg:u,colorItemBgHover:m,colorItemBgActive:h,colorSubItemBg:d,colorItemBgSelected:p,colorItemBgSelectedHorizontal:"transparent",colorActiveBarWidth:0,colorActiveBarHeight:g,colorActiveBarBorderSize:f,colorItemTextDisabled:s,colorDangerItemText:o,colorDangerItemTextHover:o,colorDangerItemTextSelected:o,colorDangerItemBgActive:a,colorDangerItemBgSelected:a,itemMarginInline:n.marginXXS}})(i);var Qje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{children:e}=i,t=Qje(i,["children"]),n=C.useContext(LH),r=C.useMemo(()=>Object.assign(Object.assign({},n),t),[n,t.prefixCls,t.mode,t.selectable]);return C.createElement(LH.Provider,{value:r},e)},foe=LH;var Jje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,dashed:n}=i,r=Jje(i,["prefixCls","className","dashed"]),{getPrefixCls:o}=C.useContext(Pn),s=o("menu",e),a=De({[`${s}-item-divider-dashed`]:!!n},t);return C.createElement(mX,Object.assign({className:a},r))},O0e=eKe;globalThis&&globalThis.__rest;const F0e=C.createContext({}),tKe=C.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),uA=tKe,nKe=i=>{var e;const{className:t,children:n,icon:r,title:o,danger:s}=i,{prefixCls:a,firstLevel:l,direction:c,disableMenuItemTitleTooltip:u,inlineCollapsed:d}=C.useContext(uA),h=_=>{const y=C.createElement("span",{className:`${a}-title-content`},n);return(!r||uh(n)&&n.type==="span")&&n&&_&&l&&typeof n=="string"?C.createElement("div",{className:`${a}-inline-collapsed-noicon`},n.charAt(0)):y},{siderCollapsed:f}=C.useContext(F0e);let g=o;typeof o>"u"?g=l?n:"":o===!1&&(g="");const p={title:g};!f&&!d&&(p.title=null,p.open=!1);const m=od(n).length;let v=C.createElement(W4,Object.assign({},cl(i,["title","icon","danger"]),{className:De({[`${a}-item-danger`]:s,[`${a}-item-only-child`]:(r?m+1:m)===1},t),title:typeof o=="string"?o:void 0}),ta(r,{className:De(uh(r)?(e=r.props)===null||e===void 0?void 0:e.className:"",`${a}-item-icon`)}),h(d));return u||(v=C.createElement(Qk,Object.assign({},p,{placement:c==="rtl"?"left":"right",overlayClassName:`${a}-inline-collapsed-tooltip`}),v)),v},B0e=nKe,iKe=i=>{var e;const{popupClassName:t,icon:n,title:r,theme:o}=i,s=C.useContext(uA),{prefixCls:a,inlineCollapsed:l,theme:c,mode:u}=s,d=WS();let h;if(!n)h=l&&!d.length&&r&&typeof r=="string"?C.createElement("div",{className:`${a}-inline-collapsed-noicon`},r.charAt(0)):C.createElement("span",{className:`${a}-title-content`},r);else{const p=uh(r)&&r.type==="span";h=C.createElement(C.Fragment,null,ta(n,{className:De(uh(n)?(e=n.props)===null||e===void 0?void 0:e.className:"",`${a}-item-icon`)}),p?r:C.createElement("span",{className:`${a}-title-content`},r))}const f=C.useMemo(()=>Object.assign(Object.assign({},s),{firstLevel:!1}),[s]),g=u==="horizontal"?[0,8]:[10,0];return C.createElement(uA.Provider,{value:f},C.createElement($4,Object.assign({popupOffset:g},cl(i,["icon"]),{title:h,popupClassName:De(a,t,`${a}-${o||c}`)})))},W0e=iKe;var rKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(e&&typeof e=="object"){const n=e,{label:r,children:o,key:s,type:a}=n,l=rKe(n,["label","children","key","type"]),c=s??`tmp-${t}`;return o||a==="group"?a==="group"?C.createElement(H4,Object.assign({key:c},l,{title:r}),EH(o)):C.createElement(W0e,Object.assign({key:c},l,{title:r}),EH(o)):a==="divider"?C.createElement(O0e,Object.assign({key:c},l)):C.createElement(B0e,Object.assign({key:c},l),r)}return null}).filter(e=>e)}function oKe(i){return C.useMemo(()=>i&&EH(i),[i])}var sKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(foe),o=r||{},{getPrefixCls:s,getPopupContainer:a,direction:l}=C.useContext(Pn),c=s(),{prefixCls:u,className:d,theme:h="light",expandIcon:f,_internalDisableMenuItemTitleTooltip:g,inlineCollapsed:p,siderCollapsed:m,items:v,children:_,rootClassName:y,mode:S,selectable:L,onClick:E}=i,D=sKe(i,["prefixCls","className","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick"]),k=cl(D,["collapsedWidth"]),T=oKe(v)||_;(t=o.validator)===null||t===void 0||t.call(o,{mode:S});const M=rc(function(){var Y;E==null||E.apply(void 0,arguments),(Y=o.onClick)===null||Y===void 0||Y.call(o)}),P=o.mode||S,N=L??o.selectable,R=C.useMemo(()=>m!==void 0?m:p,[p,m]),O={horizontal:{motionName:`${c}-slide-up`},inline:l_e(c),other:{motionName:`${c}-zoom-big`}},B=s("menu",u||o.prefixCls),[$,G]=Zje(B,!r),U=De(`${B}-${h}`,d);let j;if(typeof f=="function")j=f;else{const Y=f||o.expandIcon;j=ta(Y,{className:De(`${B}-submenu-expand-icon`,(n=Y==null?void 0:Y.props)===null||n===void 0?void 0:n.className)})}const ie=C.useMemo(()=>({prefixCls:B,inlineCollapsed:R||!1,direction:l,firstLevel:!0,theme:h,mode:P,disableMenuItemTitleTooltip:g}),[B,R,l,g,h]);return $(C.createElement(foe.Provider,{value:null},C.createElement(uA.Provider,{value:ie},C.createElement(eT,Object.assign({getPopupContainer:a,overflowedIndicator:C.createElement(xme,null),overflowedIndicatorPopupClassName:`${B}-${h}`,mode:P,selectable:N,onClick:M},k,{inlineCollapsed:R,className:U,prefixCls:B,direction:l,defaultMotions:O,expandIcon:j,ref:e,rootClassName:De(y,G)}),T))))}),lKe=aKe,tT=C.forwardRef((i,e)=>{const t=C.useRef(null),n=C.useContext(F0e);return C.useImperativeHandle(e,()=>({menu:t.current,focus:r=>{var o;(o=t.current)===null||o===void 0||o.focus(r)}})),C.createElement(lKe,Object.assign({ref:t},i,n))});tT.Item=B0e;tT.SubMenu=W0e;tT.Divider=O0e;tT.ItemGroup=H4;const vX=tT,$0e=()=>{const[i,e]=C.useState(!1);return C.useEffect(()=>{e(T$e())},[]),i};function cKe(i){let{className:e,direction:t,index:n,marginDirection:r,children:o,split:s,wrap:a}=i;const{horizontalSize:l,verticalSize:c,latestIndex:u,supportFlexGap:d}=C.useContext(H0e);let h={};return d||(t==="vertical"?n{const{getPrefixCls:e,space:t,direction:n}=C.useContext(Pn),{size:r=(t==null?void 0:t.size)||"small",align:o,className:s,rootClassName:a,children:l,direction:c="horizontal",prefixCls:u,split:d,style:h,wrap:f=!1}=i,g=uKe(i,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap"]),p=$0e(),[m,v]=C.useMemo(()=>(Array.isArray(r)?r:[r,r]).map(O=>hKe(O)),[r]),_=od(l,{keepEmpty:!0}),y=o===void 0&&c==="horizontal"?"center":o,S=e("space",u),[L,E]=n_e(S),D=De(S,E,`${S}-${c}`,{[`${S}-rtl`]:n==="rtl",[`${S}-align-${y}`]:y},s,a),k=`${S}-item`,T=n==="rtl"?"marginLeft":"marginRight";let M=0;const P=_.map((O,B)=>{O!=null&&(M=B);const $=O&&O.key||`${k}-${B}`;return C.createElement(cKe,{className:k,key:$,direction:c,index:B,marginDirection:T,split:d,wrap:f},O)}),N=C.useMemo(()=>({horizontalSize:m,verticalSize:v,latestIndex:M,supportFlexGap:p}),[m,v,M,p]);if(_.length===0)return null;const R={};return f&&(R.flexWrap="wrap",p||(R.marginBottom=-v)),p&&(R.columnGap=m,R.rowGap=v),L(C.createElement("div",Object.assign({className:D,style:Object.assign(Object.assign({},R),h)},g),C.createElement(H0e.Provider,{value:N},P)))},V0e=fKe;V0e.Compact=NWe;const DH=V0e,gKe=i=>{const{componentCls:e,menuCls:t,colorError:n,colorTextLightSolid:r}=i,o=`${t}-item`;return{[`${e}, ${e}-menu-submenu`]:{[`${t} ${o}`]:{[`&${o}-danger:not(${o}-disabled)`]:{color:n,"&:hover":{color:r,backgroundColor:n}}}}}},pKe=gKe,mKe=i=>{const{componentCls:e,menuCls:t,zIndexPopup:n,dropdownArrowDistance:r,sizePopupArrow:o,antCls:s,iconCls:a,motionDurationMid:l,dropdownPaddingVertical:c,fontSize:u,dropdownEdgeChildPadding:d,colorTextDisabled:h,fontSizeIcon:f,controlPaddingHorizontal:g,colorBgElevated:p}=i;return[{[e]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:n,display:"block","&::before":{position:"absolute",insetBlock:-r+o/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${s}-btn > ${a}-down`]:{fontSize:f,transform:"none"},[`${e}-wrap`]:{position:"relative",[`${s}-btn > ${a}-down`]:{fontSize:f},[`${a}-down::before`]:{transition:`transform ${l}`}},[`${e}-wrap-open`]:{[`${a}-down::before`]:{transform:"rotate(180deg)"}},[` &-hidden, &-menu-hidden, @@ -336,7 +336,7 @@ html body { &${s}-slide-down-leave${s}-slide-down-leave-active${e}-placement-bottomRight`]:{animationName:Gq},[`&${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-topLeft, &${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-top, &${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-topRight`]:{animationName:Xq}})},oX(i,{colorBg:p,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${e} ${t}`]:{position:"relative",margin:0},[`${t}-submenu-popup`]:{position:"absolute",zIndex:n,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${e}, ${e}-menu-submenu`]:{[t]:Object.assign(Object.assign({padding:d,listStyleType:"none",backgroundColor:p,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary},zD(i)),{[`${t}-item-group-title`]:{padding:`${c}px ${g}px`,color:i.colorTextDescription,transition:`all ${l}`},[`${t}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${t}-item-icon`]:{minWidth:u,marginInlineEnd:i.marginXS,fontSize:i.fontSizeSM},[`${t}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${l}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${t}-item, ${t}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${c}px ${g}px`,color:i.colorText,fontWeight:"normal",fontSize:u,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${l}`,borderRadius:i.borderRadiusSM,["&:hover, &-active"]:{backgroundColor:i.controlItemBgHover}},zD(i)),{"&-selected":{color:i.colorPrimary,backgroundColor:i.controlItemBgActive,"&:hover, &-active":{backgroundColor:i.controlItemBgActiveHover}},"&-disabled":{color:h,cursor:"not-allowed","&:hover":{color:h,backgroundColor:p,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${i.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:i.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:i.colorTextDescription,fontSize:f,fontStyle:"normal"}}}),[`${t}-item-group-list`]:{margin:`0 ${i.marginXS}px`,padding:0,listStyle:"none"},[`${t}-submenu-title`]:{paddingInlineEnd:g+i.fontSizeSM},[`${t}-submenu-vertical`]:{position:"relative"},[`${t}-submenu${t}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:h,backgroundColor:p,cursor:"not-allowed"}},[`${t}-submenu-selected ${e}-menu-submenu-title`]:{color:i.colorPrimary}})}},[Bw(i,"slide-up"),Bw(i,"slide-down"),iA(i,"move-up"),iA(i,"move-down"),Xk(i,"zoom-big")]]},z0e=yo("Dropdown",(i,e)=>{let{rootPrefixCls:t}=e;const{marginXXS:n,sizePopupArrow:r,controlHeight:o,fontSize:s,lineHeight:a,paddingXXS:l,componentCls:c,borderRadiusLG:u}=i,d=(o-s*a)/2,{dropdownArrowOffset:h}=rX({contentRadius:u}),f=Bi(i,{menuCls:`${c}-menu`,rootPrefixCls:t,dropdownArrowDistance:r/2+n,dropdownArrowOffset:h,dropdownPaddingVertical:d,dropdownEdgeChildPadding:l});return[mKe(f),pKe(f)]},i=>({zIndexPopup:i.zIndexPopupBase+50}));var vKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPopupContainer:e,getPrefixCls:t,direction:n}=C.useContext(Pn),{prefixCls:r,type:o="default",danger:s,disabled:a,loading:l,onClick:c,htmlType:u,children:d,className:h,menu:f,arrow:g,autoFocus:p,overlay:m,trigger:v,align:_,open:y,onOpenChange:S,placement:L,getPopupContainer:E,href:D,icon:k=C.createElement(xme,null),title:T,buttonsRender:M=je=>je,mouseEnterDelay:P,mouseLeaveDelay:N,overlayClassName:R,overlayStyle:O,destroyPopupOnHide:B,dropdownRender:$}=i,G=vKe(i,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),U=t("dropdown",r),j=`${U}-button`,[ie,Y]=z0e(U),J={menu:f,arrow:g,autoFocus:p,align:_,disabled:a,trigger:a?[]:v,onOpenChange:S,getPopupContainer:E||e,mouseEnterDelay:P,mouseLeaveDelay:N,overlayClassName:R,overlayStyle:O,destroyPopupOnHide:B,dropdownRender:$},{compactSize:Q,compactItemClassnames:he}=FS(U,n),ge=De(j,he,h,Y);"overlay"in i&&(J.overlay=m),"open"in i&&(J.open=y),"placement"in i?J.placement=L:J.placement=n==="rtl"?"bottomLeft":"bottomRight";const ye=C.createElement(ed,{type:o,danger:s,disabled:a,loading:l,onClick:c,htmlType:u,href:D,title:T},d),be=C.createElement(ed,{type:o,danger:s,icon:k}),[Ge,nt]=M([ye,be]);return ie(C.createElement(DH.Compact,Object.assign({className:ge,size:Q,block:!0},G),Ge,C.createElement(GD,Object.assign({},J),nt)))};U0e.__ANT_BUTTON=!0;const _Ke=U0e,V4=i=>{const{menu:e,arrow:t,prefixCls:n,children:r,trigger:o,disabled:s,dropdownRender:a,getPopupContainer:l,overlayClassName:c,rootClassName:u,open:d,onOpenChange:h,visible:f,onVisibleChange:g,mouseEnterDelay:p=.15,mouseLeaveDelay:m=.1,autoAdjustOverflow:v=!0,placement:_="",overlay:y,transitionName:S}=i,{getPopupContainer:L,getPrefixCls:E,direction:D}=C.useContext(Pn),k=C.useMemo(()=>{const ge=E();return S!==void 0?S:_.includes("top")?`${ge}-slide-down`:`${ge}-slide-up`},[E,_,S]),T=C.useMemo(()=>_?_.includes("Center")?_.slice(0,_.indexOf("Center")):_:D==="rtl"?"bottomRight":"bottomLeft",[_,D]),M=E("dropdown",n),[P,N]=z0e(M),{token:R}=n0e.useToken(),O=C.Children.only(r),B=ta(O,{className:De(`${M}-trigger`,{[`${M}-rtl`]:D==="rtl"},O.props.className),disabled:s}),$=s?[]:o;let G;$&&$.includes("contextMenu")&&(G=!0);const[U,j]=nl(!1,{value:d??f}),ie=rc(ge=>{h==null||h(ge),g==null||g(ge),j(ge)}),Y=De(c,u,N,{[`${M}-rtl`]:D==="rtl"}),J=t0e({arrowPointAtCenter:typeof t=="object"&&t.pointAtCenter,autoAdjustOverflow:v,offset:R.marginXXS,arrowWidth:t?R.sizePopupArrow:0,borderRadius:R.borderRadius}),Q=C.useCallback(()=>{j(!1)},[]),he=()=>{let ge;return e!=null&&e.items?ge=C.createElement(vX,Object.assign({},e)):typeof y=="function"?ge=y():ge=y,a&&(ge=a(ge)),ge=C.Children.only(typeof ge=="string"?C.createElement("span",null,ge):ge),C.createElement(A0e,{prefixCls:`${M}-menu`,expandIcon:C.createElement("span",{className:`${M}-menu-submenu-arrow`},C.createElement(R$,{className:`${M}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Q,validator:ye=>{}},C.createElement(Fw,null,ge))};return P(C.createElement(sje,Object.assign({alignPoint:G},cl(i,["rootClassName"]),{mouseEnterDelay:p,mouseLeaveDelay:m,visible:U,builtinPlacements:J,arrow:!!t,overlayClassName:Y,prefixCls:M,getPopupContainer:l||L,transitionName:k,trigger:$,overlay:he,placement:T,onVisibleChange:ie}),B))};V4.Button=_Ke;const bKe=j_e(V4,"dropdown",i=>i),CKe=i=>C.createElement(bKe,Object.assign({},i),C.createElement("span",null));V4._InternalPanelDoNotUseOrYouWillBeFired=CKe;const GD=V4,j0e=C.createContext(null),yKe=j0e.Provider,K0e=C.createContext(null),wKe=K0e.Provider;var SKe=["prefixCls","className","style","checked","disabled","defaultChecked","type","onChange"],G0e=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-checkbox":n,o=i.className,s=i.style,a=i.checked,l=i.disabled,c=i.defaultChecked,u=c===void 0?!1:c,d=i.type,h=d===void 0?"checkbox":d,f=i.onChange,g=Mn(i,SKe),p=C.useRef(null),m=nl(u,{value:a}),v=$e(m,2),_=v[0],y=v[1];C.useImperativeHandle(e,function(){return{focus:function(){var D;(D=p.current)===null||D===void 0||D.focus()},blur:function(){var D;(D=p.current)===null||D===void 0||D.blur()},input:p.current}});var S=De(r,o,(t={},we(t,"".concat(r,"-checked"),_),we(t,"".concat(r,"-disabled"),l),t)),L=function(D){l||("checked"in i||y(D.target.checked),f==null||f({target:te(te({},i),{},{checked:D.target.checked}),stopPropagation:function(){D.stopPropagation()},preventDefault:function(){D.preventDefault()},nativeEvent:D.nativeEvent}))};return C.createElement("span",{className:S,style:s},C.createElement("input",It({},g,{className:"".concat(r,"-input"),ref:p,onChange:L,disabled:l,checked:!!_,type:h})),C.createElement("span",{className:"".concat(r,"-inner")}))});const xKe=new vi("antRadioEffect",{"0%":{transform:"scale(1)",opacity:.5},"100%":{transform:"scale(1.6)",opacity:0}}),LKe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-group`;return{[n]:Object.assign(Object.assign({},Vr(i)),{display:"inline-block",fontSize:0,[`&${n}-rtl`]:{direction:"rtl"},[`${t}-badge ${t}-badge-count`]:{zIndex:1},[`> ${t}-badge:not(:first-child) > ${t}-button-wrapper`]:{borderInlineStart:"none"}})}},EKe=i=>{const{componentCls:e,radioWrapperMarginRight:t,radioCheckedColor:n,radioSize:r,motionDurationSlow:o,motionDurationMid:s,motionEaseInOut:a,motionEaseInOutCirc:l,radioButtonBg:c,colorBorder:u,lineWidth:d,radioDotSize:h,colorBgContainerDisabled:f,colorTextDisabled:g,paddingXS:p,radioDotDisabledColor:m,lineType:v,radioDotDisabledSize:_,wireframe:y,colorWhite:S}=i,L=`${e}-inner`;return{[`${e}-wrapper`]:Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:t,cursor:"pointer",[`&${e}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:i.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${e}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${d}px ${v} ${n}`,borderRadius:"50%",visibility:"hidden",animationName:xKe,animationDuration:o,animationTimingFunction:a,animationFillMode:"both",content:'""'},[e]:Object.assign(Object.assign({},Vr(i)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center"}),[`${e}-wrapper:hover &, - &:hover ${L}`]:{borderColor:n},[`${e}-input:focus-visible + ${L}`]:Object.assign({},Np(i)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:r,height:r,marginBlockStart:r/-2,marginInlineStart:r/-2,backgroundColor:y?n:S,borderBlockStart:0,borderInlineStart:0,borderRadius:r,transform:"scale(0)",opacity:0,transition:`all ${o} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:r,height:r,backgroundColor:c,borderColor:u,borderStyle:"solid",borderWidth:d,borderRadius:"50%",transition:`all ${s}`},[`${e}-input`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[L]:{borderColor:n,backgroundColor:y?c:n,"&::after":{transform:`scale(${h/r})`,opacity:1,transition:`all ${o} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[L]:{backgroundColor:f,borderColor:u,cursor:"not-allowed","&::after":{backgroundColor:m}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:g,cursor:"not-allowed"},[`&${e}-checked`]:{[L]:{"&::after":{transform:`scale(${_/r})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},DKe=i=>{const{radioButtonColor:e,controlHeight:t,componentCls:n,lineWidth:r,lineType:o,colorBorder:s,motionDurationSlow:a,motionDurationMid:l,radioButtonPaddingHorizontal:c,fontSize:u,radioButtonBg:d,fontSizeLG:h,controlHeightLG:f,controlHeightSM:g,paddingXS:p,borderRadius:m,borderRadiusSM:v,borderRadiusLG:_,radioCheckedColor:y,radioButtonCheckedBg:S,radioButtonHoverColor:L,radioButtonActiveColor:E,radioSolidCheckedColor:D,colorTextDisabled:k,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:M,radioDisabledButtonCheckedBg:P}=i;return{[`${n}-button-wrapper`]:{position:"relative",display:"inline-block",height:t,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:`${t-r*2}px`,background:d,border:`${r}px ${o} ${s}`,borderBlockStartWidth:r+.02,borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`border-color ${l}`,`box-shadow ${l}`].join(","),a:{color:e},[`> ${n}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-r,insetInlineStart:-r,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:s,transition:`background-color ${a}`,content:'""'}},"&:first-child":{borderInlineStart:`${r}px ${o} ${s}`,borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m},"&:first-child:last-child":{borderRadius:m},[`${n}-group-large &`]:{height:f,fontSize:h,lineHeight:`${f-r*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${n}-group-small &`]:{height:g,paddingInline:p-r,paddingBlock:0,lineHeight:`${g-r*2}px`,"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:y},"&:has(:focus-visible)":Object.assign({},Np(i)),[`${n}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${n}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:S,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:L,borderColor:L,"&::before":{backgroundColor:L}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${n}-group-solid &-checked:not(${n}-button-wrapper-disabled)`]:{color:D,background:y,borderColor:y,"&:hover":{color:D,background:L,borderColor:L},"&:active":{color:D,background:E,borderColor:E}},"&-disabled":{color:k,backgroundColor:T,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:k,backgroundColor:T,borderColor:s}},[`&-disabled${n}-button-wrapper-checked`]:{color:M,backgroundColor:P,borderColor:s,boxShadow:"none"}}}},q0e=yo("Radio",i=>{const{padding:e,lineWidth:t,controlItemBgActiveDisabled:n,colorTextDisabled:r,colorBgContainer:o,fontSizeLG:s,controlOutline:a,colorPrimaryHover:l,colorPrimaryActive:c,colorText:u,colorPrimary:d,marginXS:h,controlOutlineWidth:f,colorTextLightSolid:g,wireframe:p}=i,m=`0 0 0 ${f}px ${a}`,v=m,_=s,y=4,S=_-y*2,L=p?S:_-(y+t)*2,E=d,D=u,k=l,T=c,M=e-t,R=Bi(i,{radioFocusShadow:m,radioButtonFocusShadow:v,radioSize:_,radioDotSize:L,radioDotDisabledSize:S,radioCheckedColor:E,radioDotDisabledColor:r,radioSolidCheckedColor:g,radioButtonBg:o,radioButtonCheckedBg:o,radioButtonColor:D,radioButtonHoverColor:k,radioButtonActiveColor:T,radioButtonPaddingHorizontal:M,radioDisabledButtonCheckedBg:n,radioDisabledButtonCheckedColor:r,radioWrapperMarginRight:h});return[LKe(R),EKe(R),DKe(R)]});var IKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(j0e),o=C.useContext(K0e),{getPrefixCls:s,direction:a}=C.useContext(Pn),l=C.useRef(null),c=pu(e,l),{isFormItemInput:u}=C.useContext(Vf),d=T=>{var M,P;(M=i.onChange)===null||M===void 0||M.call(i,T),(P=r==null?void 0:r.onChange)===null||P===void 0||P.call(r,T)},{prefixCls:h,className:f,rootClassName:g,children:p,style:m}=i,v=IKe(i,["prefixCls","className","rootClassName","children","style"]),_=s("radio",h),y=((r==null?void 0:r.optionType)||o)==="button"?`${_}-button`:_,[S,L]=q0e(_),E=Object.assign({},v),D=C.useContext(D_);r&&(E.name=r.name,E.onChange=d,E.checked=i.value===r.value,E.disabled=(t=E.disabled)!==null&&t!==void 0?t:r.disabled),E.disabled=(n=E.disabled)!==null&&n!==void 0?n:D;const k=De(`${y}-wrapper`,{[`${y}-wrapper-checked`]:E.checked,[`${y}-wrapper-disabled`]:E.disabled,[`${y}-wrapper-rtl`]:a==="rtl",[`${y}-wrapper-in-form-item`]:u},f,g,L);return S(C.createElement("label",{className:k,style:m,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave},C.createElement(G0e,Object.assign({},E,{type:"radio",prefixCls:y,ref:c})),p!==void 0?C.createElement("span",null,p):null))},TKe=C.forwardRef(kKe),dA=TKe,NKe=C.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n}=C.useContext(Pn),r=C.useContext(Eh),[o,s]=nl(i.defaultValue,{value:i.value}),a=R=>{const O=o,B=R.target.value;"value"in i||s(B);const{onChange:$}=i;$&&B!==O&&$(R)},{prefixCls:l,className:c,rootClassName:u,options:d,buttonStyle:h="outline",disabled:f,children:g,size:p,style:m,id:v,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L}=i,E=t("radio",l),D=`${E}-group`,[k,T]=q0e(E);let M=g;d&&d.length>0&&(M=d.map(R=>typeof R=="string"||typeof R=="number"?C.createElement(dA,{key:R.toString(),prefixCls:E,disabled:f,value:R,checked:o===R},R):C.createElement(dA,{key:`radio-group-value-options-${R.value}`,prefixCls:E,disabled:R.disabled||f,value:R.value,checked:o===R.value,style:R.style},R.label)));const P=p||r,N=De(D,`${D}-${h}`,{[`${D}-${P}`]:P,[`${D}-rtl`]:n==="rtl"},c,u,T);return k(C.createElement("div",Object.assign({},H7e(i),{className:N,style:m,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L,id:v,ref:e}),C.createElement(yKe,{value:{onChange:a,value:o,disabled:i.disabled,name:i.name,optionType:i.optionType}},M)))}),RKe=C.memo(NKe);var MKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t}=C.useContext(Pn),{prefixCls:n}=i,r=MKe(i,["prefixCls"]),o=t("radio",n);return C.createElement(wKe,{value:"button"},C.createElement(dA,Object.assign({prefixCls:o},r,{type:"radio",ref:e})))},AKe=C.forwardRef(PKe),z4=dA;z4.Button=AKe;z4.Group=RKe;z4.__ANT_RADIO=!0;const X0e=z4,Y0e=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),nT=i=>({borderColor:i.inputBorderHoverColor,borderInlineEndWidth:i.lineWidth}),hA=i=>({borderColor:i.inputBorderHoverColor,boxShadow:`0 0 0 ${i.controlOutlineWidth}px ${i.controlOutline}`,borderInlineEndWidth:i.lineWidth,outline:0}),_X=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},nT(Bi(i,{inputBorderHoverColor:i.colorBorder})))}),Z0e=i=>{const{inputPaddingVerticalLG:e,fontSizeLG:t,lineHeightLG:n,borderRadiusLG:r,inputPaddingHorizontalLG:o}=i;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:n,borderRadius:r}},bX=i=>({padding:`${i.inputPaddingVerticalSM}px ${i.controlPaddingHorizontalSM-1}px`,borderRadius:i.borderRadiusSM}),U4=(i,e)=>{const{componentCls:t,colorError:n,colorWarning:r,colorErrorOutline:o,colorWarningOutline:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=i;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:n,"&:hover":{borderColor:a},"&:focus, &-focused":Object.assign({},hA(Bi(i,{inputBorderActiveColor:n,inputBorderHoverColor:n,controlOutline:o}))),[`${t}-prefix, ${t}-suffix`]:{color:n}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &-focused":Object.assign({},hA(Bi(i,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},iT=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${i.inputPaddingVertical}px ${i.inputPaddingHorizontal}px`,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,backgroundColor:i.colorBgContainer,backgroundImage:"none",borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:i.colorBorder,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},Y0e(i.colorTextPlaceholder)),{"&:hover":Object.assign({},nT(i)),"&:focus, &-focused":Object.assign({},hA(i)),"&-disabled, &[disabled]":Object.assign({},_X(i)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},Z0e(i)),"&-sm":Object.assign({},bX(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Q0e=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},Z0e(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},bX(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.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 ${i.inputPaddingHorizontal}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,textAlign:"center",backgroundColor:i.colorFillAlter,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${i.inputPaddingVertical+1}px -${i.inputPaddingHorizontal}px`,[`&${t}-select-single:not(${t}-select-customize-input)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${i.lineWidth}px ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${i.inputPaddingHorizontal}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},VD()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`& > ${e}-affix-wrapper`]:{display:"inline-flex"},[`& > ${t}-picker-range`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-i.lineWidth,borderInlineEndWidth:i.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector, + &:hover ${L}`]:{borderColor:n},[`${e}-input:focus-visible + ${L}`]:Object.assign({},Np(i)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:r,height:r,marginBlockStart:r/-2,marginInlineStart:r/-2,backgroundColor:y?n:S,borderBlockStart:0,borderInlineStart:0,borderRadius:r,transform:"scale(0)",opacity:0,transition:`all ${o} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:r,height:r,backgroundColor:c,borderColor:u,borderStyle:"solid",borderWidth:d,borderRadius:"50%",transition:`all ${s}`},[`${e}-input`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[L]:{borderColor:n,backgroundColor:y?c:n,"&::after":{transform:`scale(${h/r})`,opacity:1,transition:`all ${o} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[L]:{backgroundColor:f,borderColor:u,cursor:"not-allowed","&::after":{backgroundColor:m}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:g,cursor:"not-allowed"},[`&${e}-checked`]:{[L]:{"&::after":{transform:`scale(${_/r})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},DKe=i=>{const{radioButtonColor:e,controlHeight:t,componentCls:n,lineWidth:r,lineType:o,colorBorder:s,motionDurationSlow:a,motionDurationMid:l,radioButtonPaddingHorizontal:c,fontSize:u,radioButtonBg:d,fontSizeLG:h,controlHeightLG:f,controlHeightSM:g,paddingXS:p,borderRadius:m,borderRadiusSM:v,borderRadiusLG:_,radioCheckedColor:y,radioButtonCheckedBg:S,radioButtonHoverColor:L,radioButtonActiveColor:E,radioSolidCheckedColor:D,colorTextDisabled:k,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:M,radioDisabledButtonCheckedBg:P}=i;return{[`${n}-button-wrapper`]:{position:"relative",display:"inline-block",height:t,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:`${t-r*2}px`,background:d,border:`${r}px ${o} ${s}`,borderBlockStartWidth:r+.02,borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`border-color ${l}`,`box-shadow ${l}`].join(","),a:{color:e},[`> ${n}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-r,insetInlineStart:-r,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:s,transition:`background-color ${a}`,content:'""'}},"&:first-child":{borderInlineStart:`${r}px ${o} ${s}`,borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m},"&:first-child:last-child":{borderRadius:m},[`${n}-group-large &`]:{height:f,fontSize:h,lineHeight:`${f-r*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${n}-group-small &`]:{height:g,paddingInline:p-r,paddingBlock:0,lineHeight:`${g-r*2}px`,"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:y},"&:has(:focus-visible)":Object.assign({},Np(i)),[`${n}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${n}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:S,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:L,borderColor:L,"&::before":{backgroundColor:L}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${n}-group-solid &-checked:not(${n}-button-wrapper-disabled)`]:{color:D,background:y,borderColor:y,"&:hover":{color:D,background:L,borderColor:L},"&:active":{color:D,background:E,borderColor:E}},"&-disabled":{color:k,backgroundColor:T,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:k,backgroundColor:T,borderColor:s}},[`&-disabled${n}-button-wrapper-checked`]:{color:M,backgroundColor:P,borderColor:s,boxShadow:"none"}}}},q0e=yo("Radio",i=>{const{padding:e,lineWidth:t,controlItemBgActiveDisabled:n,colorTextDisabled:r,colorBgContainer:o,fontSizeLG:s,controlOutline:a,colorPrimaryHover:l,colorPrimaryActive:c,colorText:u,colorPrimary:d,marginXS:h,controlOutlineWidth:f,colorTextLightSolid:g,wireframe:p}=i,m=`0 0 0 ${f}px ${a}`,v=m,_=s,y=4,S=_-y*2,L=p?S:_-(y+t)*2,E=d,D=u,k=l,T=c,M=e-t,R=Bi(i,{radioFocusShadow:m,radioButtonFocusShadow:v,radioSize:_,radioDotSize:L,radioDotDisabledSize:S,radioCheckedColor:E,radioDotDisabledColor:r,radioSolidCheckedColor:g,radioButtonBg:o,radioButtonCheckedBg:o,radioButtonColor:D,radioButtonHoverColor:k,radioButtonActiveColor:T,radioButtonPaddingHorizontal:M,radioDisabledButtonCheckedBg:n,radioDisabledButtonCheckedColor:r,radioWrapperMarginRight:h});return[LKe(R),EKe(R),DKe(R)]});var IKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(j0e),o=C.useContext(K0e),{getPrefixCls:s,direction:a}=C.useContext(Pn),l=C.useRef(null),c=pu(e,l),{isFormItemInput:u}=C.useContext(Vf),d=T=>{var M,P;(M=i.onChange)===null||M===void 0||M.call(i,T),(P=r==null?void 0:r.onChange)===null||P===void 0||P.call(r,T)},{prefixCls:h,className:f,rootClassName:g,children:p,style:m}=i,v=IKe(i,["prefixCls","className","rootClassName","children","style"]),_=s("radio",h),y=((r==null?void 0:r.optionType)||o)==="button"?`${_}-button`:_,[S,L]=q0e(_),E=Object.assign({},v),D=C.useContext(I_);r&&(E.name=r.name,E.onChange=d,E.checked=i.value===r.value,E.disabled=(t=E.disabled)!==null&&t!==void 0?t:r.disabled),E.disabled=(n=E.disabled)!==null&&n!==void 0?n:D;const k=De(`${y}-wrapper`,{[`${y}-wrapper-checked`]:E.checked,[`${y}-wrapper-disabled`]:E.disabled,[`${y}-wrapper-rtl`]:a==="rtl",[`${y}-wrapper-in-form-item`]:u},f,g,L);return S(C.createElement("label",{className:k,style:m,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave},C.createElement(G0e,Object.assign({},E,{type:"radio",prefixCls:y,ref:c})),p!==void 0?C.createElement("span",null,p):null))},TKe=C.forwardRef(kKe),dA=TKe,NKe=C.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n}=C.useContext(Pn),r=C.useContext(Eh),[o,s]=nl(i.defaultValue,{value:i.value}),a=R=>{const O=o,B=R.target.value;"value"in i||s(B);const{onChange:$}=i;$&&B!==O&&$(R)},{prefixCls:l,className:c,rootClassName:u,options:d,buttonStyle:h="outline",disabled:f,children:g,size:p,style:m,id:v,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L}=i,E=t("radio",l),D=`${E}-group`,[k,T]=q0e(E);let M=g;d&&d.length>0&&(M=d.map(R=>typeof R=="string"||typeof R=="number"?C.createElement(dA,{key:R.toString(),prefixCls:E,disabled:f,value:R,checked:o===R},R):C.createElement(dA,{key:`radio-group-value-options-${R.value}`,prefixCls:E,disabled:R.disabled||f,value:R.value,checked:o===R.value,style:R.style},R.label)));const P=p||r,N=De(D,`${D}-${h}`,{[`${D}-${P}`]:P,[`${D}-rtl`]:n==="rtl"},c,u,T);return k(C.createElement("div",Object.assign({},H7e(i),{className:N,style:m,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L,id:v,ref:e}),C.createElement(yKe,{value:{onChange:a,value:o,disabled:i.disabled,name:i.name,optionType:i.optionType}},M)))}),RKe=C.memo(NKe);var MKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t}=C.useContext(Pn),{prefixCls:n}=i,r=MKe(i,["prefixCls"]),o=t("radio",n);return C.createElement(wKe,{value:"button"},C.createElement(dA,Object.assign({prefixCls:o},r,{type:"radio",ref:e})))},AKe=C.forwardRef(PKe),z4=dA;z4.Button=AKe;z4.Group=RKe;z4.__ANT_RADIO=!0;const X0e=z4,Y0e=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),nT=i=>({borderColor:i.inputBorderHoverColor,borderInlineEndWidth:i.lineWidth}),hA=i=>({borderColor:i.inputBorderHoverColor,boxShadow:`0 0 0 ${i.controlOutlineWidth}px ${i.controlOutline}`,borderInlineEndWidth:i.lineWidth,outline:0}),_X=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},nT(Bi(i,{inputBorderHoverColor:i.colorBorder})))}),Z0e=i=>{const{inputPaddingVerticalLG:e,fontSizeLG:t,lineHeightLG:n,borderRadiusLG:r,inputPaddingHorizontalLG:o}=i;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:n,borderRadius:r}},bX=i=>({padding:`${i.inputPaddingVerticalSM}px ${i.controlPaddingHorizontalSM-1}px`,borderRadius:i.borderRadiusSM}),U4=(i,e)=>{const{componentCls:t,colorError:n,colorWarning:r,colorErrorOutline:o,colorWarningOutline:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=i;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:n,"&:hover":{borderColor:a},"&:focus, &-focused":Object.assign({},hA(Bi(i,{inputBorderActiveColor:n,inputBorderHoverColor:n,controlOutline:o}))),[`${t}-prefix, ${t}-suffix`]:{color:n}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &-focused":Object.assign({},hA(Bi(i,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},iT=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${i.inputPaddingVertical}px ${i.inputPaddingHorizontal}px`,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,backgroundColor:i.colorBgContainer,backgroundImage:"none",borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:i.colorBorder,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},Y0e(i.colorTextPlaceholder)),{"&:hover":Object.assign({},nT(i)),"&:focus, &-focused":Object.assign({},hA(i)),"&-disabled, &[disabled]":Object.assign({},_X(i)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},Z0e(i)),"&-sm":Object.assign({},bX(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Q0e=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},Z0e(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},bX(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.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 ${i.inputPaddingHorizontal}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,textAlign:"center",backgroundColor:i.colorFillAlter,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${i.inputPaddingVertical+1}px -${i.inputPaddingHorizontal}px`,[`&${t}-select-single:not(${t}-select-customize-input)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${i.lineWidth}px ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${i.inputPaddingHorizontal}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},VD()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`& > ${e}-affix-wrapper`]:{display:"inline-flex"},[`& > ${t}-picker-range`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-i.lineWidth,borderInlineEndWidth:i.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector, & > ${t}-select-auto-complete ${e}, & > ${t}-cascader-picker ${e}, & > ${e}-group-wrapper ${e}`]:{borderInlineEndWidth:i.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${t}-select-focused`]:{zIndex:1},[`& > ${t}-select > ${t}-select-arrow`]:{zIndex:1},[`& > *:first-child, @@ -353,7 +353,7 @@ html body { `]:{[`&:hover ${e}-inner`]:{borderColor:i.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}-checked:not(${e}-disabled):after`]:{borderColor:i.colorPrimaryHover}}},{[`${e}-checked`]:{[`${e}-inner`]:{backgroundColor:i.colorPrimary,borderColor:i.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${i.motionDurationMid} ${i.motionEaseOutBack} ${i.motionDurationFast}`}},"&:after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderRadius:i.borderRadiusSM,visibility:"hidden",border:`${i.lineWidthBold}px solid ${i.colorPrimary}`,animationName:rGe,animationDuration:i.motionDurationSlow,animationTimingFunction:"ease-in-out",animationFillMode:"backwards",content:'""',transition:`all ${i.motionDurationSlow}`}},[` ${t}-checked:not(${t}-disabled), ${e}-checked:not(${e}-disabled) - `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}:after`]:{borderColor:i.colorPrimaryHover}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function nbe(i,e){const t=Bi(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[oGe(t)]}const ibe=yo("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[nbe(t,i)]});var sGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultValue:t,children:n,options:r=[],prefixCls:o,className:s,rootClassName:a,style:l,onChange:c}=i,u=sGe(i,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]);const{getPrefixCls:d,direction:h}=C.useContext(Pn),[f,g]=C.useState(u.value||t||[]),[p,m]=C.useState([]);C.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const v=()=>r.map(N=>typeof N=="string"||typeof N=="number"?{label:N,value:N}:N),_=N=>{m(R=>R.filter(O=>O!==N))},y=N=>{m(R=>[].concat(gt(R),[N]))},S=N=>{const R=f.indexOf(N.value),O=gt(f);R===-1?O.push(N.value):O.splice(R,1),"value"in u||g(O);const B=v();c==null||c(O.filter($=>p.includes($)).sort(($,G)=>{const U=B.findIndex(ie=>ie.value===$),j=B.findIndex(ie=>ie.value===G);return U-j}))},L=d("checkbox",o),E=`${L}-group`,[D,k]=ibe(L),T=cl(u,["value","disabled"]);r&&r.length>0&&(n=v().map(N=>C.createElement(obe,{prefixCls:L,key:N.value.toString(),disabled:"disabled"in N?N.disabled:u.disabled,value:N.value,checked:f.includes(N.value),onChange:N.onChange,className:`${E}-item`,style:N.style},N.label)));const M={toggleOption:S,value:f,disabled:u.disabled,name:u.name,registerValue:y,cancelValue:_},P=De(E,{[`${E}-rtl`]:h==="rtl"},s,a,k);return D(C.createElement("div",Object.assign({className:P,style:l},T,{ref:e}),C.createElement(rbe.Provider,{value:M},n)))},lGe=C.forwardRef(aGe),cGe=C.memo(lGe);var uGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,{prefixCls:n,className:r,rootClassName:o,children:s,indeterminate:a=!1,style:l,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:h}=i,f=uGe(i,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]);const{getPrefixCls:g,direction:p}=C.useContext(Pn),m=C.useContext(rbe),{isFormItemInput:v}=C.useContext(Vf),_=C.useContext(D_),y=(t=(m==null?void 0:m.disabled)||h)!==null&&t!==void 0?t:_,S=C.useRef(f.value);C.useEffect(()=>{m==null||m.registerValue(f.value)},[]),C.useEffect(()=>{if(!d)return f.value!==S.current&&(m==null||m.cancelValue(S.current),m==null||m.registerValue(f.value),S.current=f.value),()=>m==null?void 0:m.cancelValue(f.value)},[f.value]);const L=g("checkbox",n),[E,D]=ibe(L),k=Object.assign({},f);m&&!d&&(k.onChange=function(){f.onChange&&f.onChange.apply(f,arguments),m.toggleOption&&m.toggleOption({label:s,value:f.value})},k.name=m.name,k.checked=m.value.includes(f.value));const T=De({[`${L}-wrapper`]:!0,[`${L}-rtl`]:p==="rtl",[`${L}-wrapper-checked`]:k.checked,[`${L}-wrapper-disabled`]:y,[`${L}-wrapper-in-form-item`]:v},r,o,D),M=De({[`${L}-indeterminate`]:a},D),P=a?"mixed":void 0;return E(C.createElement("label",{className:T,style:l,onMouseEnter:c,onMouseLeave:u},C.createElement(G0e,Object.assign({"aria-checked":P},k,{prefixCls:L,className:M,disabled:y,ref:e})),s!==void 0&&C.createElement("span",null,s)))},hGe=C.forwardRef(dGe),obe=hGe,LX=obe;LX.Group=cGe;LX.__ANT_CHECKBOX=!0;const gA=LX,fGe=C.createContext({}),sbe=fGe,gGe=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},pGe=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},mGe=(i,e)=>{const{componentCls:t,gridColumns:n}=i,r={};for(let o=n;o>=0;o--)o===0?(r[`${t}${e}-${o}`]={display:"none"},r[`${t}-push-${o}`]={insetInlineStart:"auto"},r[`${t}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-push-${o}`]={insetInlineStart:"auto"},r[`${t}${e}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-offset-${o}`]={marginInlineStart:0},r[`${t}${e}-order-${o}`]={order:0}):(r[`${t}${e}-${o}`]={display:"block",flex:`0 0 ${o/n*100}%`,maxWidth:`${o/n*100}%`},r[`${t}${e}-push-${o}`]={insetInlineStart:`${o/n*100}%`},r[`${t}${e}-pull-${o}`]={insetInlineEnd:`${o/n*100}%`},r[`${t}${e}-offset-${o}`]={marginInlineStart:`${o/n*100}%`},r[`${t}${e}-order-${o}`]={order:o});return r},kH=(i,e)=>mGe(i,e),vGe=(i,e,t)=>({[`@media (min-width: ${e}px)`]:Object.assign({},kH(i,t))}),_Ge=yo("Grid",i=>[gGe(i)]),bGe=yo("Grid",i=>{const e=Bi(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[pGe(e),kH(e,""),kH(e,"-xs"),Object.keys(t).map(n=>vGe(e,t[n],n)).reduce((n,r)=>Object.assign(Object.assign({},n),r),{})]});var CGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Pn),{gutter:r,wrap:o,supportFlexGap:s}=C.useContext(sbe),{prefixCls:a,span:l,order:c,offset:u,push:d,pull:h,className:f,children:g,flex:p,style:m}=i,v=CGe(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),_=t("col",a),[y,S]=bGe(_);let L={};wGe.forEach(k=>{let T={};const M=i[k];typeof M=="number"?T.span=M:typeof M=="object"&&(T=M||{}),delete v[k],L=Object.assign(Object.assign({},L),{[`${_}-${k}-${T.span}`]:T.span!==void 0,[`${_}-${k}-order-${T.order}`]:T.order||T.order===0,[`${_}-${k}-offset-${T.offset}`]:T.offset||T.offset===0,[`${_}-${k}-push-${T.push}`]:T.push||T.push===0,[`${_}-${k}-pull-${T.pull}`]:T.pull||T.pull===0,[`${_}-rtl`]:n==="rtl"})});const E=De(_,{[`${_}-${l}`]:l!==void 0,[`${_}-order-${c}`]:c,[`${_}-offset-${u}`]:u,[`${_}-push-${d}`]:d,[`${_}-pull-${h}`]:h},f,L,S),D={};if(r&&r[0]>0){const k=r[0]/2;D.paddingLeft=k,D.paddingRight=k}if(r&&r[1]>0&&!s){const k=r[1]/2;D.paddingTop=k,D.paddingBottom=k}return p&&(D.flex=yGe(p),o===!1&&!D.minWidth&&(D.minWidth=0)),y(C.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},D),m),className:E,ref:e}),g))}),xGe=SGe;var LGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(typeof i=="string"&&n(i),typeof i=="object")for(let o=0;o{r()},[JSON.stringify(i),e]),t}const EGe=C.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:r,className:o,style:s,children:a,gutter:l=0,wrap:c}=i,u=LGe(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=C.useContext(Pn),[f,g]=C.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,m]=C.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),v=_oe(r,p),_=_oe(n,p),y=$0e(),S=C.useRef(l),L=Z_e();C.useEffect(()=>{const U=L.subscribe(j=>{m(j);const ie=S.current||0;(!Array.isArray(ie)&&typeof ie=="object"||Array.isArray(ie)&&(typeof ie[0]=="object"||typeof ie[1]=="object"))&&g(j)});return()=>L.unsubscribe(U)},[]);const E=()=>{const U=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((ie,Y)=>{if(typeof ie=="object")for(let J=0;J0?M[0]/-2:void 0,O=M[1]!=null&&M[1]>0?M[1]/-2:void 0;R&&(N.marginLeft=R,N.marginRight=R),y?[,N.rowGap]=M:O&&(N.marginTop=O,N.marginBottom=O);const[B,$]=M,G=C.useMemo(()=>({gutter:[B,$],wrap:c,supportFlexGap:y}),[B,$,c,y]);return k(C.createElement(sbe.Provider,{value:G},C.createElement("div",Object.assign({},u,{className:P,style:Object.assign(Object.assign({},N),s),ref:e}),a)))}),DGe=EGe;function boe(i){var e=i.getBoundingClientRect(),t=document.documentElement;return{left:e.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}const IGe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,className:r=""}=i,o=e("input-group",n),s=e("input"),[a,l]=yX(s),c=De(o,{[`${o}-lg`]:i.size==="large",[`${o}-sm`]:i.size==="small",[`${o}-compact`]:i.compact,[`${o}-rtl`]:t==="rtl"},l,r),u=C.useContext(Vf),d=C.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(C.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},C.createElement(Vf.Provider,{value:d},i.children)))},kGe=IGe;function u1(i){return!!(i.addonBefore||i.addonAfter)}function H6(i){return!!(i.prefix||i.suffix||i.allowClear)}function NE(i,e,t,n){if(t){var r=e;if(e.type==="click"){var o=i.cloneNode(!0);r=Object.create(e,{target:{value:o},currentTarget:{value:o}}),o.value="",t(r);return}if(n!==void 0){r=Object.create(e,{target:{value:i},currentTarget:{value:i}}),i.value=n,t(r);return}t(r)}}function TGe(i,e){if(i){i.focus(e);var t=e||{},n=t.cursor;if(n){var r=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(r,r);break;default:i.setSelectionRange(0,r)}}}}function TH(i){return typeof i>"u"||i===null?"":String(i)}var abe=function(e){var t,n,r=e.inputElement,o=e.prefixCls,s=e.prefix,a=e.suffix,l=e.addonBefore,c=e.addonAfter,u=e.className,d=e.style,h=e.disabled,f=e.readOnly,g=e.focused,p=e.triggerFocus,m=e.allowClear,v=e.value,_=e.handleReset,y=e.hidden,S=e.classes,L=e.classNames,E=e.dataAttrs,D=e.styles,k=C.useRef(null),T=function(Y){var J;(J=k.current)!==null&&J!==void 0&&J.contains(Y.target)&&(p==null||p())},M=function(){var Y;if(!m)return null;var J=!h&&!f&&v,Q="".concat(o,"-clear-icon"),he=Un(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"✖";return qe.createElement("span",{onClick:_,onMouseDown:function(ye){return ye.preventDefault()},className:De(Q,(Y={},we(Y,"".concat(Q,"-hidden"),!J),we(Y,"".concat(Q,"-has-suffix"),!!a),Y)),role:"button",tabIndex:-1},he)},P=C.cloneElement(r,{value:v,hidden:y,className:De((t=r.props)===null||t===void 0?void 0:t.className,!H6(e)&&!u1(e)&&u)||null,style:te(te({},(n=r.props)===null||n===void 0?void 0:n.style),!H6(e)&&!u1(e)?d:{})});if(H6(e)){var N,R="".concat(o,"-affix-wrapper"),O=De(R,(N={},we(N,"".concat(R,"-disabled"),h),we(N,"".concat(R,"-focused"),g),we(N,"".concat(R,"-readonly"),f),we(N,"".concat(R,"-input-with-clear-btn"),a&&m&&v),N),!u1(e)&&u,S==null?void 0:S.affixWrapper),B=(a||m)&&qe.createElement("span",{className:De("".concat(o,"-suffix"),L==null?void 0:L.suffix),style:D==null?void 0:D.suffix},M(),a);P=qe.createElement("span",It({className:O,style:u1(e)?void 0:d,hidden:!u1(e)&&y,onClick:T},E==null?void 0:E.affixWrapper,{ref:k}),s&&qe.createElement("span",{className:De("".concat(o,"-prefix"),L==null?void 0:L.prefix),style:D==null?void 0:D.prefix},s),C.cloneElement(r,{value:v,hidden:null}),B)}if(u1(e)){var $="".concat(o,"-group"),G="".concat($,"-addon"),U=De("".concat(o,"-wrapper"),$,S==null?void 0:S.wrapper),j=De("".concat(o,"-group-wrapper"),u,S==null?void 0:S.group);return qe.createElement("span",{className:j,style:d,hidden:y},qe.createElement("span",{className:U},l&&qe.createElement("span",{className:G},l),C.cloneElement(P,{hidden:null}),c&&qe.createElement("span",{className:G},c)))}return P},NGe=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],RGe=C.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,r=i.onFocus,o=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,m=i.type,v=m===void 0?"text":m,_=i.classes,y=i.classNames,S=i.styles,L=Mn(i,NGe),E=nl(i.defaultValue,{value:i.value}),D=$e(E,2),k=D[0],T=D[1],M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=C.useRef(null),B=function(he){O.current&&TGe(O.current,he)};C.useImperativeHandle(e,function(){return{focus:B,blur:function(){var he;(he=O.current)===null||he===void 0||he.blur()},setSelectionRange:function(he,ge,ye){var be;(be=O.current)===null||be===void 0||be.setSelectionRange(he,ge,ye)},select:function(){var he;(he=O.current)===null||he===void 0||he.select()},input:O.current}}),C.useEffect(function(){R(function(Q){return Q&&u?!1:Q})},[u]);var $=function(he){i.value===void 0&&T(he.target.value),O.current&&NE(O.current,he,n)},G=function(he){s&&he.key==="Enter"&&s(he),a==null||a(he)},U=function(he){R(!0),r==null||r(he)},j=function(he){R(!1),o==null||o(he)},ie=function(he){T(""),B(),O.current&&NE(O.current,he,n)},Y=function(){var he=cl(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return qe.createElement("input",It({autoComplete:t},he,{onChange:$,onFocus:U,onBlur:j,onKeyDown:G,className:De(c,we({},"".concat(c,"-disabled"),u),y==null?void 0:y.input),style:S==null?void 0:S.input,ref:O,size:d,type:v}))},J=function(){var he=Number(f)>0;if(g||p){var ge=TH(k),ye=gt(ge).length,be=Un(p)==="object"?p.formatter({value:ge,count:ye,maxLength:f}):"".concat(ye).concat(he?" / ".concat(f):"");return qe.createElement(qe.Fragment,null,!!p&&qe.createElement("span",{className:De("".concat(c,"-show-count-suffix"),we({},"".concat(c,"-show-count-has-suffix"),!!g),y==null?void 0:y.count),style:te({},S==null?void 0:S.count)},be),g)}return null};return qe.createElement(abe,It({},L,{prefixCls:c,className:h,inputElement:Y(),handleReset:ie,value:TH(k),focused:N,triggerFocus:B,suffix:J(),disabled:u,classes:_,classNames:y,styles:S}))});function lbe(i,e){const t=C.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var r,o,s,a;!((r=i.current)===null||r===void 0)&&r.input&&((o=i.current)===null||o===void 0?void 0:o.input.getAttribute("type"))==="password"&&(!((s=i.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return C.useEffect(()=>(e&&n(),()=>t.current.forEach(r=>{r&&clearTimeout(r)})),[]),n}function MGe(i){return!!(i.prefix||i.suffix||i.allowClear)}var PGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,bordered:n=!0,status:r,size:o,disabled:s,onBlur:a,onFocus:l,suffix:c,allowClear:u,addonAfter:d,addonBefore:h,className:f,rootClassName:g,onChange:p,classNames:m}=i,v=PGe(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","rootClassName","onChange","classNames"]),{getPrefixCls:_,direction:y,input:S}=qe.useContext(Pn),L=_("input",t),E=C.useRef(null),[D,k]=yX(L),{compactSize:T,compactItemClassnames:M}=FS(L,y),P=qe.useContext(Eh),N=T||o||P,R=qe.useContext(D_),O=s??R,{status:B,hasFeedback:$,feedbackIcon:G}=C.useContext(Vf),U=P4(B,r),j=MGe(i)||!!$,ie=C.useRef(j);C.useEffect(()=>{j&&ie.current,ie.current=j},[j]);const Y=lbe(E,!0),J=be=>{Y(),a==null||a(be)},Q=be=>{Y(),l==null||l(be)},he=be=>{Y(),p==null||p(be)},ge=($||c)&&qe.createElement(qe.Fragment,null,c,$&&G);let ye;return typeof u=="object"&&(u!=null&&u.clearIcon)?ye=u:u&&(ye={clearIcon:qe.createElement(PS,null)}),D(qe.createElement(RGe,Object.assign({ref:pu(e,E),prefixCls:L,autoComplete:S==null?void 0:S.autoComplete},v,{disabled:O,onBlur:J,onFocus:Q,suffix:ge,allowClear:ye,className:De(f,g,M),onChange:he,addonAfter:d&&qe.createElement(Fw,null,qe.createElement(UD,{override:!0,status:!0},d)),addonBefore:h&&qe.createElement(Fw,null,qe.createElement(UD,{override:!0,status:!0},h)),classNames:Object.assign(Object.assign({},m),{input:De({[`${L}-sm`]:N==="small",[`${L}-lg`]:N==="large",[`${L}-rtl`]:y==="rtl",[`${L}-borderless`]:!n},!j&&pp(L,U),m==null?void 0:m.input,k)}),classes:{affixWrapper:De({[`${L}-affix-wrapper-sm`]:N==="small",[`${L}-affix-wrapper-lg`]:N==="large",[`${L}-affix-wrapper-rtl`]:y==="rtl",[`${L}-affix-wrapper-borderless`]:!n},pp(`${L}-affix-wrapper`,U,$),k),wrapper:De({[`${L}-group-rtl`]:y==="rtl"},k),group:De({[`${L}-group-wrapper-sm`]:N==="small",[`${L}-group-wrapper-lg`]:N==="large",[`${L}-group-wrapper-rtl`]:y==="rtl",[`${L}-group-wrapper-disabled`]:O},pp(`${L}-group-wrapper`,U,$),k)}})))}),EX=OGe;var FGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);ri?C.createElement(kme,null):C.createElement(mBe,null),WGe={click:"onClick",hover:"onMouseOver"},$Ge=C.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[r,o]=C.useState(()=>n?t.visible:!1),s=C.useRef(null);C.useEffect(()=>{n&&o(t.visible)},[n,t]);const a=lbe(s),l=()=>{const{disabled:L}=i;L||(r&&a(),o(E=>{var D;const k=!E;return typeof t=="object"&&((D=t.onVisibleChange)===null||D===void 0||D.call(t,k)),k}))},c=L=>{const{action:E="click",iconRender:D=BGe}=i,k=WGe[E]||"",T=D(r),M={[k]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:P=>{P.preventDefault()},onMouseUp:P=>{P.preventDefault()}};return C.cloneElement(C.isValidElement(T)?T:C.createElement("span",null,T),M)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=FGe(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=C.useContext(Pn),m=p("input",h),v=p("input-password",d),_=t&&c(v),y=De(v,u,{[`${v}-${f}`]:!!f}),S=Object.assign(Object.assign({},cl(g,["suffix","iconRender","visibilityToggle"])),{type:r?"text":"password",className:y,prefixCls:m,suffix:_});return f&&(S.size=f),C.createElement(EX,Object.assign({ref:pu(e,s)},S))}),HGe=$Ge;var VGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,inputPrefixCls:n,className:r,size:o,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=VGe(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:m,direction:v}=C.useContext(Pn),_=C.useContext(Eh),y=C.useRef(!1),S=m("input-search",t),L=m("input",n),{compactSize:E}=FS(S,v),D=E||o||_,k=C.useRef(null),T=Y=>{Y&&Y.target&&Y.type==="click"&&d&&d(Y.target.value,Y),h&&h(Y)},M=Y=>{var J;document.activeElement===((J=k.current)===null||J===void 0?void 0:J.input)&&Y.preventDefault()},P=Y=>{var J,Q;d&&d((Q=(J=k.current)===null||J===void 0?void 0:J.input)===null||Q===void 0?void 0:Q.value,Y)},N=Y=>{y.current||c||P(Y)},R=typeof a=="boolean"?C.createElement(Iq,null):null,O=`${S}-button`;let B;const $=a||{},G=$.type&&$.type.__ANT_BUTTON===!0;G||$.type==="button"?B=ta($,Object.assign({onMouseDown:M,onClick:Y=>{var J,Q;(Q=(J=$==null?void 0:$.props)===null||J===void 0?void 0:J.onClick)===null||Q===void 0||Q.call(J,Y),P(Y)},key:"enterButton"},G?{className:O,size:D}:{})):B=C.createElement(ed,{className:O,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:M,onClick:P,loading:c,icon:R},a),l&&(B=[B,ta(l,{key:"addonAfter"})]);const U=De(S,{[`${S}-rtl`]:v==="rtl",[`${S}-${D}`]:!!D,[`${S}-with-button`]:!!a},r),j=Y=>{y.current=!0,f==null||f(Y)},ie=Y=>{y.current=!1,g==null||g(Y)};return C.createElement(EX,Object.assign({ref:pu(k,e),onPressEnter:N},p,{size:D,onCompositionStart:j,onCompositionEnd:ie,prefixCls:L,addonAfter:B,suffix:s,onChange:T,className:U,disabled:u}))}),UGe=zGe;var jGe=` + `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}:after`]:{borderColor:i.colorPrimaryHover}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function nbe(i,e){const t=Bi(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[oGe(t)]}const ibe=yo("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[nbe(t,i)]});var sGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultValue:t,children:n,options:r=[],prefixCls:o,className:s,rootClassName:a,style:l,onChange:c}=i,u=sGe(i,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]);const{getPrefixCls:d,direction:h}=C.useContext(Pn),[f,g]=C.useState(u.value||t||[]),[p,m]=C.useState([]);C.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const v=()=>r.map(N=>typeof N=="string"||typeof N=="number"?{label:N,value:N}:N),_=N=>{m(R=>R.filter(O=>O!==N))},y=N=>{m(R=>[].concat(gt(R),[N]))},S=N=>{const R=f.indexOf(N.value),O=gt(f);R===-1?O.push(N.value):O.splice(R,1),"value"in u||g(O);const B=v();c==null||c(O.filter($=>p.includes($)).sort(($,G)=>{const U=B.findIndex(ie=>ie.value===$),j=B.findIndex(ie=>ie.value===G);return U-j}))},L=d("checkbox",o),E=`${L}-group`,[D,k]=ibe(L),T=cl(u,["value","disabled"]);r&&r.length>0&&(n=v().map(N=>C.createElement(obe,{prefixCls:L,key:N.value.toString(),disabled:"disabled"in N?N.disabled:u.disabled,value:N.value,checked:f.includes(N.value),onChange:N.onChange,className:`${E}-item`,style:N.style},N.label)));const M={toggleOption:S,value:f,disabled:u.disabled,name:u.name,registerValue:y,cancelValue:_},P=De(E,{[`${E}-rtl`]:h==="rtl"},s,a,k);return D(C.createElement("div",Object.assign({className:P,style:l},T,{ref:e}),C.createElement(rbe.Provider,{value:M},n)))},lGe=C.forwardRef(aGe),cGe=C.memo(lGe);var uGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,{prefixCls:n,className:r,rootClassName:o,children:s,indeterminate:a=!1,style:l,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:h}=i,f=uGe(i,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]);const{getPrefixCls:g,direction:p}=C.useContext(Pn),m=C.useContext(rbe),{isFormItemInput:v}=C.useContext(Vf),_=C.useContext(I_),y=(t=(m==null?void 0:m.disabled)||h)!==null&&t!==void 0?t:_,S=C.useRef(f.value);C.useEffect(()=>{m==null||m.registerValue(f.value)},[]),C.useEffect(()=>{if(!d)return f.value!==S.current&&(m==null||m.cancelValue(S.current),m==null||m.registerValue(f.value),S.current=f.value),()=>m==null?void 0:m.cancelValue(f.value)},[f.value]);const L=g("checkbox",n),[E,D]=ibe(L),k=Object.assign({},f);m&&!d&&(k.onChange=function(){f.onChange&&f.onChange.apply(f,arguments),m.toggleOption&&m.toggleOption({label:s,value:f.value})},k.name=m.name,k.checked=m.value.includes(f.value));const T=De({[`${L}-wrapper`]:!0,[`${L}-rtl`]:p==="rtl",[`${L}-wrapper-checked`]:k.checked,[`${L}-wrapper-disabled`]:y,[`${L}-wrapper-in-form-item`]:v},r,o,D),M=De({[`${L}-indeterminate`]:a},D),P=a?"mixed":void 0;return E(C.createElement("label",{className:T,style:l,onMouseEnter:c,onMouseLeave:u},C.createElement(G0e,Object.assign({"aria-checked":P},k,{prefixCls:L,className:M,disabled:y,ref:e})),s!==void 0&&C.createElement("span",null,s)))},hGe=C.forwardRef(dGe),obe=hGe,LX=obe;LX.Group=cGe;LX.__ANT_CHECKBOX=!0;const gA=LX,fGe=C.createContext({}),sbe=fGe,gGe=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},pGe=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},mGe=(i,e)=>{const{componentCls:t,gridColumns:n}=i,r={};for(let o=n;o>=0;o--)o===0?(r[`${t}${e}-${o}`]={display:"none"},r[`${t}-push-${o}`]={insetInlineStart:"auto"},r[`${t}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-push-${o}`]={insetInlineStart:"auto"},r[`${t}${e}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-offset-${o}`]={marginInlineStart:0},r[`${t}${e}-order-${o}`]={order:0}):(r[`${t}${e}-${o}`]={display:"block",flex:`0 0 ${o/n*100}%`,maxWidth:`${o/n*100}%`},r[`${t}${e}-push-${o}`]={insetInlineStart:`${o/n*100}%`},r[`${t}${e}-pull-${o}`]={insetInlineEnd:`${o/n*100}%`},r[`${t}${e}-offset-${o}`]={marginInlineStart:`${o/n*100}%`},r[`${t}${e}-order-${o}`]={order:o});return r},kH=(i,e)=>mGe(i,e),vGe=(i,e,t)=>({[`@media (min-width: ${e}px)`]:Object.assign({},kH(i,t))}),_Ge=yo("Grid",i=>[gGe(i)]),bGe=yo("Grid",i=>{const e=Bi(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[pGe(e),kH(e,""),kH(e,"-xs"),Object.keys(t).map(n=>vGe(e,t[n],n)).reduce((n,r)=>Object.assign(Object.assign({},n),r),{})]});var CGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Pn),{gutter:r,wrap:o,supportFlexGap:s}=C.useContext(sbe),{prefixCls:a,span:l,order:c,offset:u,push:d,pull:h,className:f,children:g,flex:p,style:m}=i,v=CGe(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),_=t("col",a),[y,S]=bGe(_);let L={};wGe.forEach(k=>{let T={};const M=i[k];typeof M=="number"?T.span=M:typeof M=="object"&&(T=M||{}),delete v[k],L=Object.assign(Object.assign({},L),{[`${_}-${k}-${T.span}`]:T.span!==void 0,[`${_}-${k}-order-${T.order}`]:T.order||T.order===0,[`${_}-${k}-offset-${T.offset}`]:T.offset||T.offset===0,[`${_}-${k}-push-${T.push}`]:T.push||T.push===0,[`${_}-${k}-pull-${T.pull}`]:T.pull||T.pull===0,[`${_}-rtl`]:n==="rtl"})});const E=De(_,{[`${_}-${l}`]:l!==void 0,[`${_}-order-${c}`]:c,[`${_}-offset-${u}`]:u,[`${_}-push-${d}`]:d,[`${_}-pull-${h}`]:h},f,L,S),D={};if(r&&r[0]>0){const k=r[0]/2;D.paddingLeft=k,D.paddingRight=k}if(r&&r[1]>0&&!s){const k=r[1]/2;D.paddingTop=k,D.paddingBottom=k}return p&&(D.flex=yGe(p),o===!1&&!D.minWidth&&(D.minWidth=0)),y(C.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},D),m),className:E,ref:e}),g))}),xGe=SGe;var LGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(typeof i=="string"&&n(i),typeof i=="object")for(let o=0;o{r()},[JSON.stringify(i),e]),t}const EGe=C.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:r,className:o,style:s,children:a,gutter:l=0,wrap:c}=i,u=LGe(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=C.useContext(Pn),[f,g]=C.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,m]=C.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),v=_oe(r,p),_=_oe(n,p),y=$0e(),S=C.useRef(l),L=Z_e();C.useEffect(()=>{const U=L.subscribe(j=>{m(j);const ie=S.current||0;(!Array.isArray(ie)&&typeof ie=="object"||Array.isArray(ie)&&(typeof ie[0]=="object"||typeof ie[1]=="object"))&&g(j)});return()=>L.unsubscribe(U)},[]);const E=()=>{const U=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((ie,Y)=>{if(typeof ie=="object")for(let J=0;J0?M[0]/-2:void 0,O=M[1]!=null&&M[1]>0?M[1]/-2:void 0;R&&(N.marginLeft=R,N.marginRight=R),y?[,N.rowGap]=M:O&&(N.marginTop=O,N.marginBottom=O);const[B,$]=M,G=C.useMemo(()=>({gutter:[B,$],wrap:c,supportFlexGap:y}),[B,$,c,y]);return k(C.createElement(sbe.Provider,{value:G},C.createElement("div",Object.assign({},u,{className:P,style:Object.assign(Object.assign({},N),s),ref:e}),a)))}),DGe=EGe;function boe(i){var e=i.getBoundingClientRect(),t=document.documentElement;return{left:e.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}const IGe=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Pn),{prefixCls:n,className:r=""}=i,o=e("input-group",n),s=e("input"),[a,l]=yX(s),c=De(o,{[`${o}-lg`]:i.size==="large",[`${o}-sm`]:i.size==="small",[`${o}-compact`]:i.compact,[`${o}-rtl`]:t==="rtl"},l,r),u=C.useContext(Vf),d=C.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(C.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},C.createElement(Vf.Provider,{value:d},i.children)))},kGe=IGe;function u1(i){return!!(i.addonBefore||i.addonAfter)}function H6(i){return!!(i.prefix||i.suffix||i.allowClear)}function NE(i,e,t,n){if(t){var r=e;if(e.type==="click"){var o=i.cloneNode(!0);r=Object.create(e,{target:{value:o},currentTarget:{value:o}}),o.value="",t(r);return}if(n!==void 0){r=Object.create(e,{target:{value:i},currentTarget:{value:i}}),i.value=n,t(r);return}t(r)}}function TGe(i,e){if(i){i.focus(e);var t=e||{},n=t.cursor;if(n){var r=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(r,r);break;default:i.setSelectionRange(0,r)}}}}function TH(i){return typeof i>"u"||i===null?"":String(i)}var abe=function(e){var t,n,r=e.inputElement,o=e.prefixCls,s=e.prefix,a=e.suffix,l=e.addonBefore,c=e.addonAfter,u=e.className,d=e.style,h=e.disabled,f=e.readOnly,g=e.focused,p=e.triggerFocus,m=e.allowClear,v=e.value,_=e.handleReset,y=e.hidden,S=e.classes,L=e.classNames,E=e.dataAttrs,D=e.styles,k=C.useRef(null),T=function(Y){var J;(J=k.current)!==null&&J!==void 0&&J.contains(Y.target)&&(p==null||p())},M=function(){var Y;if(!m)return null;var J=!h&&!f&&v,Q="".concat(o,"-clear-icon"),he=Un(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"✖";return qe.createElement("span",{onClick:_,onMouseDown:function(ye){return ye.preventDefault()},className:De(Q,(Y={},we(Y,"".concat(Q,"-hidden"),!J),we(Y,"".concat(Q,"-has-suffix"),!!a),Y)),role:"button",tabIndex:-1},he)},P=C.cloneElement(r,{value:v,hidden:y,className:De((t=r.props)===null||t===void 0?void 0:t.className,!H6(e)&&!u1(e)&&u)||null,style:te(te({},(n=r.props)===null||n===void 0?void 0:n.style),!H6(e)&&!u1(e)?d:{})});if(H6(e)){var N,R="".concat(o,"-affix-wrapper"),O=De(R,(N={},we(N,"".concat(R,"-disabled"),h),we(N,"".concat(R,"-focused"),g),we(N,"".concat(R,"-readonly"),f),we(N,"".concat(R,"-input-with-clear-btn"),a&&m&&v),N),!u1(e)&&u,S==null?void 0:S.affixWrapper),B=(a||m)&&qe.createElement("span",{className:De("".concat(o,"-suffix"),L==null?void 0:L.suffix),style:D==null?void 0:D.suffix},M(),a);P=qe.createElement("span",It({className:O,style:u1(e)?void 0:d,hidden:!u1(e)&&y,onClick:T},E==null?void 0:E.affixWrapper,{ref:k}),s&&qe.createElement("span",{className:De("".concat(o,"-prefix"),L==null?void 0:L.prefix),style:D==null?void 0:D.prefix},s),C.cloneElement(r,{value:v,hidden:null}),B)}if(u1(e)){var $="".concat(o,"-group"),G="".concat($,"-addon"),U=De("".concat(o,"-wrapper"),$,S==null?void 0:S.wrapper),j=De("".concat(o,"-group-wrapper"),u,S==null?void 0:S.group);return qe.createElement("span",{className:j,style:d,hidden:y},qe.createElement("span",{className:U},l&&qe.createElement("span",{className:G},l),C.cloneElement(P,{hidden:null}),c&&qe.createElement("span",{className:G},c)))}return P},NGe=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],RGe=C.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,r=i.onFocus,o=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,m=i.type,v=m===void 0?"text":m,_=i.classes,y=i.classNames,S=i.styles,L=Mn(i,NGe),E=nl(i.defaultValue,{value:i.value}),D=$e(E,2),k=D[0],T=D[1],M=C.useState(!1),P=$e(M,2),N=P[0],R=P[1],O=C.useRef(null),B=function(he){O.current&&TGe(O.current,he)};C.useImperativeHandle(e,function(){return{focus:B,blur:function(){var he;(he=O.current)===null||he===void 0||he.blur()},setSelectionRange:function(he,ge,ye){var be;(be=O.current)===null||be===void 0||be.setSelectionRange(he,ge,ye)},select:function(){var he;(he=O.current)===null||he===void 0||he.select()},input:O.current}}),C.useEffect(function(){R(function(Q){return Q&&u?!1:Q})},[u]);var $=function(he){i.value===void 0&&T(he.target.value),O.current&&NE(O.current,he,n)},G=function(he){s&&he.key==="Enter"&&s(he),a==null||a(he)},U=function(he){R(!0),r==null||r(he)},j=function(he){R(!1),o==null||o(he)},ie=function(he){T(""),B(),O.current&&NE(O.current,he,n)},Y=function(){var he=cl(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return qe.createElement("input",It({autoComplete:t},he,{onChange:$,onFocus:U,onBlur:j,onKeyDown:G,className:De(c,we({},"".concat(c,"-disabled"),u),y==null?void 0:y.input),style:S==null?void 0:S.input,ref:O,size:d,type:v}))},J=function(){var he=Number(f)>0;if(g||p){var ge=TH(k),ye=gt(ge).length,be=Un(p)==="object"?p.formatter({value:ge,count:ye,maxLength:f}):"".concat(ye).concat(he?" / ".concat(f):"");return qe.createElement(qe.Fragment,null,!!p&&qe.createElement("span",{className:De("".concat(c,"-show-count-suffix"),we({},"".concat(c,"-show-count-has-suffix"),!!g),y==null?void 0:y.count),style:te({},S==null?void 0:S.count)},be),g)}return null};return qe.createElement(abe,It({},L,{prefixCls:c,className:h,inputElement:Y(),handleReset:ie,value:TH(k),focused:N,triggerFocus:B,suffix:J(),disabled:u,classes:_,classNames:y,styles:S}))});function lbe(i,e){const t=C.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var r,o,s,a;!((r=i.current)===null||r===void 0)&&r.input&&((o=i.current)===null||o===void 0?void 0:o.input.getAttribute("type"))==="password"&&(!((s=i.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return C.useEffect(()=>(e&&n(),()=>t.current.forEach(r=>{r&&clearTimeout(r)})),[]),n}function MGe(i){return!!(i.prefix||i.suffix||i.allowClear)}var PGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,bordered:n=!0,status:r,size:o,disabled:s,onBlur:a,onFocus:l,suffix:c,allowClear:u,addonAfter:d,addonBefore:h,className:f,rootClassName:g,onChange:p,classNames:m}=i,v=PGe(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","rootClassName","onChange","classNames"]),{getPrefixCls:_,direction:y,input:S}=qe.useContext(Pn),L=_("input",t),E=C.useRef(null),[D,k]=yX(L),{compactSize:T,compactItemClassnames:M}=FS(L,y),P=qe.useContext(Eh),N=T||o||P,R=qe.useContext(I_),O=s??R,{status:B,hasFeedback:$,feedbackIcon:G}=C.useContext(Vf),U=P4(B,r),j=MGe(i)||!!$,ie=C.useRef(j);C.useEffect(()=>{j&&ie.current,ie.current=j},[j]);const Y=lbe(E,!0),J=be=>{Y(),a==null||a(be)},Q=be=>{Y(),l==null||l(be)},he=be=>{Y(),p==null||p(be)},ge=($||c)&&qe.createElement(qe.Fragment,null,c,$&&G);let ye;return typeof u=="object"&&(u!=null&&u.clearIcon)?ye=u:u&&(ye={clearIcon:qe.createElement(PS,null)}),D(qe.createElement(RGe,Object.assign({ref:pu(e,E),prefixCls:L,autoComplete:S==null?void 0:S.autoComplete},v,{disabled:O,onBlur:J,onFocus:Q,suffix:ge,allowClear:ye,className:De(f,g,M),onChange:he,addonAfter:d&&qe.createElement(Fw,null,qe.createElement(UD,{override:!0,status:!0},d)),addonBefore:h&&qe.createElement(Fw,null,qe.createElement(UD,{override:!0,status:!0},h)),classNames:Object.assign(Object.assign({},m),{input:De({[`${L}-sm`]:N==="small",[`${L}-lg`]:N==="large",[`${L}-rtl`]:y==="rtl",[`${L}-borderless`]:!n},!j&&pp(L,U),m==null?void 0:m.input,k)}),classes:{affixWrapper:De({[`${L}-affix-wrapper-sm`]:N==="small",[`${L}-affix-wrapper-lg`]:N==="large",[`${L}-affix-wrapper-rtl`]:y==="rtl",[`${L}-affix-wrapper-borderless`]:!n},pp(`${L}-affix-wrapper`,U,$),k),wrapper:De({[`${L}-group-rtl`]:y==="rtl"},k),group:De({[`${L}-group-wrapper-sm`]:N==="small",[`${L}-group-wrapper-lg`]:N==="large",[`${L}-group-wrapper-rtl`]:y==="rtl",[`${L}-group-wrapper-disabled`]:O},pp(`${L}-group-wrapper`,U,$),k)}})))}),EX=OGe;var FGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);ri?C.createElement(kme,null):C.createElement(mBe,null),WGe={click:"onClick",hover:"onMouseOver"},$Ge=C.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[r,o]=C.useState(()=>n?t.visible:!1),s=C.useRef(null);C.useEffect(()=>{n&&o(t.visible)},[n,t]);const a=lbe(s),l=()=>{const{disabled:L}=i;L||(r&&a(),o(E=>{var D;const k=!E;return typeof t=="object"&&((D=t.onVisibleChange)===null||D===void 0||D.call(t,k)),k}))},c=L=>{const{action:E="click",iconRender:D=BGe}=i,k=WGe[E]||"",T=D(r),M={[k]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:P=>{P.preventDefault()},onMouseUp:P=>{P.preventDefault()}};return C.cloneElement(C.isValidElement(T)?T:C.createElement("span",null,T),M)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=FGe(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=C.useContext(Pn),m=p("input",h),v=p("input-password",d),_=t&&c(v),y=De(v,u,{[`${v}-${f}`]:!!f}),S=Object.assign(Object.assign({},cl(g,["suffix","iconRender","visibilityToggle"])),{type:r?"text":"password",className:y,prefixCls:m,suffix:_});return f&&(S.size=f),C.createElement(EX,Object.assign({ref:pu(e,s)},S))}),HGe=$Ge;var VGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,inputPrefixCls:n,className:r,size:o,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=VGe(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:m,direction:v}=C.useContext(Pn),_=C.useContext(Eh),y=C.useRef(!1),S=m("input-search",t),L=m("input",n),{compactSize:E}=FS(S,v),D=E||o||_,k=C.useRef(null),T=Y=>{Y&&Y.target&&Y.type==="click"&&d&&d(Y.target.value,Y),h&&h(Y)},M=Y=>{var J;document.activeElement===((J=k.current)===null||J===void 0?void 0:J.input)&&Y.preventDefault()},P=Y=>{var J,Q;d&&d((Q=(J=k.current)===null||J===void 0?void 0:J.input)===null||Q===void 0?void 0:Q.value,Y)},N=Y=>{y.current||c||P(Y)},R=typeof a=="boolean"?C.createElement(Iq,null):null,O=`${S}-button`;let B;const $=a||{},G=$.type&&$.type.__ANT_BUTTON===!0;G||$.type==="button"?B=ta($,Object.assign({onMouseDown:M,onClick:Y=>{var J,Q;(Q=(J=$==null?void 0:$.props)===null||J===void 0?void 0:J.onClick)===null||Q===void 0||Q.call(J,Y),P(Y)},key:"enterButton"},G?{className:O,size:D}:{})):B=C.createElement(ed,{className:O,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:M,onClick:P,loading:c,icon:R},a),l&&(B=[B,ta(l,{key:"addonAfter"})]);const U=De(S,{[`${S}-rtl`]:v==="rtl",[`${S}-${D}`]:!!D,[`${S}-with-button`]:!!a},r),j=Y=>{y.current=!0,f==null||f(Y)},ie=Y=>{y.current=!1,g==null||g(Y)};return C.createElement(EX,Object.assign({ref:pu(k,e),onPressEnter:N},p,{size:D,onCompositionStart:j,onCompositionEnd:ie,prefixCls:L,addonAfter:B,suffix:s,onChange:T,className:U,disabled:u}))}),UGe=zGe;var jGe=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -364,7 +364,7 @@ html body { top:0 !important; right:0 !important; pointer-events: none !important; -`,KGe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],V6={},Mu;function GGe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&V6[t])return V6[t];var n=window.getComputedStyle(i),r=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),o=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=KGe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:r};return e&&t&&(V6[t]=l),l}function qGe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Mu||(Mu=document.createElement("textarea"),Mu.setAttribute("tab-index","-1"),Mu.setAttribute("aria-hidden","true"),document.body.appendChild(Mu)),i.getAttribute("wrap")?Mu.setAttribute("wrap",i.getAttribute("wrap")):Mu.removeAttribute("wrap");var r=GGe(i,e),o=r.paddingSize,s=r.borderSize,a=r.boxSizing,l=r.sizingStyle;Mu.setAttribute("style","".concat(l,";").concat(jGe)),Mu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=Mu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=o),t!==null||n!==null){Mu.value=" ";var f=Mu.scrollHeight-o;t!==null&&(c=f*t,a==="border-box"&&(c=c+o+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+o+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var XGe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],z6=0,U6=1,j6=2,YGe=C.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var r=t.defaultValue,o=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Mn(t,XGe),f=nl(r,{value:o,postState:function(he){return he??""}}),g=$e(f,2),p=g[0],m=g[1],v=function(he){m(he.target.value),d==null||d(he)},_=C.useRef();C.useImperativeHandle(e,function(){return{textArea:_.current}});var y=C.useMemo(function(){return s&&Un(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),S=$e(y,2),L=S[0],E=S[1],D=!!s,k=function(){try{if(document.activeElement===_.current){var he=_.current,ge=he.selectionStart,ye=he.selectionEnd,be=he.scrollTop;_.current.setSelectionRange(ge,ye),_.current.scrollTop=be}}catch{}},T=C.useState(j6),M=$e(T,2),P=M[0],N=M[1],R=C.useState(),O=$e(R,2),B=O[0],$=O[1],G=function(){N(z6)};Cr(function(){D&&G()},[o,L,E,D]),Cr(function(){if(P===z6)N(U6);else if(P===U6){var Q=qGe(_.current,!1,L,E);N(j6),$(Q)}else k()},[P]);var U=C.useRef(),j=function(){er.cancel(U.current)},ie=function(he){P===j6&&(a==null||a(he),s&&(j(),U.current=er(function(){G()})))};C.useEffect(function(){return j},[]);var Y=D?B:null,J=te(te({},c),Y);return(P===z6||P===U6)&&(J.overflowY="hidden",J.overflowX="hidden"),C.createElement(Lh,{onResize:ie,disabled:!(s||a)},C.createElement("textarea",It({},h,{ref:_,style:J,className:De(n,l,we({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:v})))}),ZGe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles"];function cbe(i,e){return gt(i||"").slice(0,e).join("")}function Coe(i,e,t,n){var r=t;return i?r=cbe(t,n):gt(e||"").lengthn&&(r=e),r}var QGe=qe.forwardRef(function(i,e){var t,n=i.defaultValue,r=i.value,o=i.onFocus,s=i.onBlur,a=i.onChange,l=i.allowClear,c=i.maxLength,u=i.onCompositionStart,d=i.onCompositionEnd,h=i.suffix,f=i.prefixCls,g=f===void 0?"rc-textarea":f,p=i.classes,m=i.showCount,v=i.className,_=i.style,y=i.disabled,S=i.hidden,L=i.classNames,E=i.styles,D=Mn(i,ZGe),k=nl(n,{value:r,defaultValue:n}),T=$e(k,2),M=T[0],P=T[1],N=C.useRef(null),R=qe.useState(!1),O=$e(R,2),B=O[0],$=O[1],G=qe.useState(!1),U=$e(G,2),j=U[0],ie=U[1],Y=qe.useRef(),J=qe.useRef(0),Q=function(){N.current.textArea.focus()};C.useImperativeHandle(e,function(){return{resizableTextArea:N.current,focus:Q,blur:function(){N.current.textArea.blur()}}}),C.useEffect(function(){$(function(Ye){return!y&&Ye})},[y]);var he=Number(c)>0,ge=function(We){ie(!0),Y.current=M,J.current=We.currentTarget.selectionStart,u==null||u(We)},ye=function(We){ie(!1);var dt=We.currentTarget.value;if(he){var re,ue=J.current>=c+1||J.current===((re=Y.current)===null||re===void 0?void 0:re.length);dt=Coe(ue,Y.current,dt,c)}dt!==M&&(P(dt),NE(We.currentTarget,We,a,dt)),d==null||d(We)},be=function(We){var dt=We.target.value;if(!j&&he){var re=We.target.selectionStart>=c+1||We.target.selectionStart===dt.length||!We.target.selectionStart;dt=Coe(re,M,dt,c)}P(dt),NE(We.currentTarget,We,a,dt)},Ge=function(We){var dt=D.onPressEnter,re=D.onKeyDown;We.key==="Enter"&&dt&&dt(We),re==null||re(We)},nt=function(We){$(!0),o==null||o(We)},je=function(We){$(!1),s==null||s(We)},_e=function(We){P(""),Q(),NE(N.current.textArea,We,a)},Ve=TH(M);!j&&he&&r==null&&(Ve=cbe(Ve,c));var Le=h,Pe;if(m){var Be=gt(Ve).length;Un(m)==="object"?Pe=m.formatter({value:Ve,count:Be,maxLength:c}):Pe="".concat(Be).concat(he?" / ".concat(c):""),Le=qe.createElement(qe.Fragment,null,Le,qe.createElement("span",{className:De("".concat(g,"-data-count"),L==null?void 0:L.count),style:E==null?void 0:E.count},Pe))}var Qe=qe.createElement(abe,{value:Ve,allowClear:l,handleReset:_e,suffix:Le,prefixCls:g,classes:{affixWrapper:De(p==null?void 0:p.affixWrapper,(t={},we(t,"".concat(g,"-show-count"),m),we(t,"".concat(g,"-textarea-allow-clear"),l),t))},disabled:y,focused:B,className:v,style:_,dataAttrs:{affixWrapper:{"data-count":typeof Pe=="string"?Pe:void 0}},hidden:S,inputElement:qe.createElement(YGe,It({},D,{onKeyDown:Ge,onChange:be,onFocus:nt,onBlur:je,onCompositionStart:ge,onCompositionEnd:ye,className:L==null?void 0:L.textarea,style:te(te({},E==null?void 0:E.textarea),{},{resize:_==null?void 0:_.resize}),disabled:y,prefixCls:g,ref:N}))});return Qe}),JGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,size:r,disabled:o,status:s,allowClear:a,showCount:l,classNames:c}=i,u=JGe(i,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames"]);const{getPrefixCls:d,direction:h}=C.useContext(Pn),f=C.useContext(Eh),g=r||f,p=C.useContext(D_),m=o??p,{status:v,hasFeedback:_,feedbackIcon:y}=C.useContext(Vf),S=P4(v,s),L=C.useRef(null);C.useImperativeHandle(e,()=>{var M;return{resizableTextArea:(M=L.current)===null||M===void 0?void 0:M.resizableTextArea,focus:P=>{var N,R;AGe((R=(N=L.current)===null||N===void 0?void 0:N.resizableTextArea)===null||R===void 0?void 0:R.textArea,P)},blur:()=>{var P;return(P=L.current)===null||P===void 0?void 0:P.blur()}}});const E=d("input",t);let D;typeof a=="object"&&(a!=null&&a.clearIcon)?D=a:a&&(D={clearIcon:C.createElement(PS,null)});const[k,T]=yX(E);return k(C.createElement(QGe,Object.assign({},u,{disabled:m,allowClear:D,classes:{affixWrapper:De(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:h==="rtl",[`${E}-affix-wrapper-borderless`]:!n,[`${E}-affix-wrapper-sm`]:g==="small",[`${E}-affix-wrapper-lg`]:g==="large",[`${E}-textarea-show-count`]:l},pp(`${E}-affix-wrapper`,S),T)},classNames:Object.assign(Object.assign({},c),{textarea:De({[`${E}-borderless`]:!n,[`${E}-sm`]:g==="small",[`${E}-lg`]:g==="large"},pp(E,S),T,c==null?void 0:c.textarea)}),prefixCls:E,suffix:_&&C.createElement("span",{className:`${E}-textarea-suffix`},y),showCount:l,ref:L})))}),tqe=eqe,oT=EX;oT.Group=kGe;oT.Search=UGe;oT.TextArea=tqe;oT.Password=HGe;const nqe=oT;function NH(){return typeof BigInt=="function"}function cb(i){var e=i.trim(),t=e.startsWith("-");t&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var n=e||"0",r=n.split("."),o=r[0]||"0",s=r[1]||"0";o==="0"&&s==="0"&&(t=!1);var a=t?"-":"";return{negative:t,negativeStr:a,trimStr:n,integerStr:o,decimalStr:s,fullStr:"".concat(a).concat(n)}}function DX(i){var e=String(i);return!Number.isNaN(Number(e))&&e.includes("e")}function qD(i){var e=String(i);if(DX(i)){var t=Number(e.slice(e.indexOf("e-")+2)),n=e.match(/\.(\d+)/);return n!=null&&n[1]&&(t+=n[1].length),t}return e.includes(".")&&IX(e)?e.length-e.indexOf(".")-1:0}function j4(i){var e=String(i);if(DX(i)){if(i>Number.MAX_SAFE_INTEGER)return String(NH()?BigInt(i).toString():Number.MAX_SAFE_INTEGER);if(iNumber.MAX_SAFE_INTEGER)return new i(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":j4(this.number):this.origin}}]),i}(),rqe=function(){function i(e){if(bs(this,i),we(this,"origin",""),we(this,"negative",void 0),we(this,"integer",void 0),we(this,"decimal",void 0),we(this,"decimalLen",void 0),we(this,"empty",void 0),we(this,"nan",void 0),ube(e)){this.empty=!0;return}if(this.origin=String(e),e==="-"||Number.isNaN(e)){this.nan=!0;return}var t=e;if(DX(t)&&(t=Number(t)),t=typeof t=="string"?t:j4(t),IX(t)){var n=cb(t);this.negative=n.negative;var r=n.trimStr.split(".");this.integer=BigInt(r[0]);var o=r[1]||"0";this.decimal=BigInt(o),this.decimalLen=o.length}else this.nan=!0}return Cs(i,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var n="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(n)}},{key:"negate",value:function(){var t=new i(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new i(t);var n=new i(t);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),o=this.alignDecimal(r),s=n.alignDecimal(r),a=(o+s).toString(),l=cb(a),c=l.negativeStr,u=l.trimStr,d="".concat(c).concat(u.padStart(r+1,"0"));return new i("".concat(d.slice(0,-r),".").concat(d.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(t==null?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":cb("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),i}();function Td(i){return NH()?new rqe(i):new iqe(i)}function LM(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(i==="")return"";var r=cb(i),o=r.negativeStr,s=r.integerStr,a=r.decimalStr,l="".concat(e).concat(a),c="".concat(o).concat(s);if(t>=0){var u=Number(a[t]);if(u>=5&&!n){var d=Td(i).add("".concat(o,"0.").concat("0".repeat(t)).concat(10-u));return LM(d.toString(),e,t,n)}return t===0?c:"".concat(c).concat(e).concat(a.padEnd(t,"0").slice(0,t))}return l===".0"?c:"".concat(c).concat(l)}var oqe=function(){var e=C.useState(!1),t=$e(e,2),n=t[0],r=t[1];return Cr(function(){r(M4())},[]),n},sqe=200,aqe=600;function lqe(i){var e=i.prefixCls,t=i.upNode,n=i.downNode,r=i.upDisabled,o=i.downDisabled,s=i.onStep,a=C.useRef(),l=C.useRef();l.current=s;var c=function(v,_){v.preventDefault(),l.current(_);function y(){l.current(_),a.current=setTimeout(y,sqe)}a.current=setTimeout(y,aqe)},u=function(){clearTimeout(a.current)};C.useEffect(function(){return u},[]);var d=oqe();if(d)return null;var h="".concat(e,"-handler"),f=De(h,"".concat(h,"-up"),we({},"".concat(h,"-up-disabled"),r)),g=De(h,"".concat(h,"-down"),we({},"".concat(h,"-down-disabled"),o)),p={unselectable:"on",role:"button",onMouseUp:u,onMouseLeave:u};return C.createElement("div",{className:"".concat(h,"-wrap")},C.createElement("span",It({},p,{onMouseDown:function(v){c(v,!0)},"aria-label":"Increase Value","aria-disabled":r,className:f}),t||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),C.createElement("span",It({},p,{onMouseDown:function(v){c(v,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:g}),n||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function yoe(i){var e=typeof i=="number"?j4(i):cb(i).fullStr,t=e.includes(".");return t?cb(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:i+"0"}function cqe(i,e){var t=C.useRef(null);function n(){try{var o=i.selectionStart,s=i.selectionEnd,a=i.value,l=a.substring(0,o),c=a.substring(s);t.current={start:o,end:s,value:a,beforeTxt:l,afterTxt:c}}catch{}}function r(){if(i&&t.current&&e)try{var o=i.value,s=t.current,a=s.beforeTxt,l=s.afterTxt,c=s.start,u=o.length;if(o.endsWith(l))u=o.length-t.current.afterTxt.length;else if(o.startsWith(a))u=a.length;else{var d=a[c-1],h=o.indexOf(d,c-1);h!==-1&&(u=h+1)}i.setSelectionRange(u,u)}catch(f){uo(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(f.message))}}return[n,r]}const uqe=function(){var i=C.useRef(0),e=function(){er.cancel(i.current)};return C.useEffect(function(){return e},[]),function(t){e(),i.current=er(function(){t()})}};var dqe=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],woe=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},Soe=function(e){var t=Td(e);return t.isInvalidate()?null:t},dbe=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-input-number":n,o=i.className,s=i.style,a=i.min,l=i.max,c=i.step,u=c===void 0?1:c,d=i.defaultValue,h=i.value,f=i.disabled,g=i.readOnly,p=i.upHandler,m=i.downHandler,v=i.keyboard,_=i.controls,y=_===void 0?!0:_,S=i.stringMode,L=i.parser,E=i.formatter,D=i.precision,k=i.decimalSeparator,T=i.onChange,M=i.onInput,P=i.onPressEnter,N=i.onStep,R=Mn(i,dqe),O="".concat(r,"-input"),B=C.useRef(null),$=C.useState(!1),G=$e($,2),U=G[0],j=G[1],ie=C.useRef(!1),Y=C.useRef(!1),J=C.useRef(!1),Q=C.useState(function(){return Td(h??d)}),he=$e(Q,2),ge=he[0],ye=he[1];function be(Ue){h===void 0&&ye(Ue)}var Ge=C.useCallback(function(Ue,Ct){if(!Ct)return D>=0?D:Math.max(qD(Ue),qD(u))},[D,u]),nt=C.useCallback(function(Ue){var Ct=String(Ue);if(L)return L(Ct);var Dt=Ct;return k&&(Dt=Dt.replace(k,".")),Dt.replace(/[^\w.-]+/g,"")},[L,k]),je=C.useRef(""),_e=C.useCallback(function(Ue,Ct){if(E)return E(Ue,{userTyping:Ct,input:String(je.current)});var Dt=typeof Ue=="number"?j4(Ue):Ue;if(!Ct){var St=Ge(Dt,Ct);if(IX(Dt)&&(k||St>=0)){var Kt=k||".";Dt=LM(Dt,Kt,St)}}return Dt},[E,Ge,k]),Ve=C.useState(function(){var Ue=d??h;return ge.isInvalidate()&&["string","number"].includes(Un(Ue))?Number.isNaN(Ue)?"":Ue:_e(ge.toString(),!1)}),Le=$e(Ve,2),Pe=Le[0],Be=Le[1];je.current=Pe;function Qe(Ue,Ct){Be(_e(Ue.isInvalidate()?Ue.toString(!1):Ue.toString(!Ct),Ct))}var Ye=C.useMemo(function(){return Soe(l)},[l,D]),We=C.useMemo(function(){return Soe(a)},[a,D]),dt=C.useMemo(function(){return!Ye||!ge||ge.isInvalidate()?!1:Ye.lessEquals(ge)},[Ye,ge]),re=C.useMemo(function(){return!We||!ge||ge.isInvalidate()?!1:ge.lessEquals(We)},[We,ge]),ue=cqe(B.current,U),de=$e(ue,2),z=de[0],q=de[1],se=function(Ct){return Ye&&!Ct.lessEquals(Ye)?Ye:We&&!We.lessEquals(Ct)?We:null},ne=function(Ct){return!se(Ct)},pe=function(Ct,Dt){var St=Ct,Kt=ne(St)||St.isEmpty();if(!St.isEmpty()&&!Dt&&(St=se(St)||St,Kt=!0),!g&&!f&&Kt){var _n=St.toString(),zt=Ge(_n,Dt);return zt>=0&&(St=Td(LM(_n,".",zt)),ne(St)||(St=Td(LM(_n,".",zt,!0)))),St.equals(ge)||(be(St),T==null||T(St.isEmpty()?null:woe(S,St)),h===void 0&&Qe(St,Dt)),St}return ge},ke=uqe(),oe=function Ue(Ct){if(z(),Be(Ct),!Y.current){var Dt=nt(Ct),St=Td(Dt);St.isNaN()||pe(St,!0)}M==null||M(Ct),ke(function(){var Kt=Ct;L||(Kt=Ct.replace(/。/g,".")),Kt!==Ct&&Ue(Kt)})},ce=function(){Y.current=!0},fe=function(){Y.current=!1,oe(B.current.value)},Ie=function(Ct){oe(Ct.target.value)},Te=function(Ct){var Dt;if(!(Ct&&dt||!Ct&&re)){ie.current=!1;var St=Td(J.current?yoe(u):u);Ct||(St=St.negate());var Kt=(ge||Td(0)).add(St.toString()),_n=pe(Kt,!1);N==null||N(woe(S,_n),{offset:J.current?yoe(u):u,type:Ct?"up":"down"}),(Dt=B.current)===null||Dt===void 0||Dt.focus()}},He=function(Ct){var Dt=Td(nt(Pe)),St=Dt;Dt.isNaN()?St=ge:St=pe(Dt,Ct),h!==void 0?Qe(ge,!1):St.isNaN()||Qe(St,!1)},Me=function(){ie.current=!0},bt=function(Ct){var Dt=Ct.which,St=Ct.shiftKey;ie.current=!0,St?J.current=!0:J.current=!1,Dt===_t.ENTER&&(Y.current||(ie.current=!1),He(!1),P==null||P(Ct)),v!==!1&&!Y.current&&[_t.UP,_t.DOWN].includes(Dt)&&(Te(_t.UP===Dt),Ct.preventDefault())},rt=function(){ie.current=!1,J.current=!1},Ht=function(){He(!1),j(!1),ie.current=!1};return IE(function(){ge.isInvalidate()||Qe(ge,!1)},[D]),IE(function(){var Ue=Td(h);ye(Ue);var Ct=Td(nt(Pe));(!Ue.equals(Ct)||!ie.current||E)&&Qe(Ue,ie.current)},[h]),IE(function(){E&&q()},[Pe]),C.createElement("div",{className:De(r,o,(t={},we(t,"".concat(r,"-focused"),U),we(t,"".concat(r,"-disabled"),f),we(t,"".concat(r,"-readonly"),g),we(t,"".concat(r,"-not-a-number"),ge.isNaN()),we(t,"".concat(r,"-out-of-range"),!ge.isInvalidate()&&!ne(ge)),t)),style:s,onFocus:function(){j(!0)},onBlur:Ht,onKeyDown:bt,onKeyUp:rt,onCompositionStart:ce,onCompositionEnd:fe,onBeforeInput:Me},y&&C.createElement(lqe,{prefixCls:r,upNode:p,downNode:m,upDisabled:dt,downDisabled:re,onStep:Te}),C.createElement("div",{className:"".concat(O,"-wrap")},C.createElement("input",It({autoComplete:"off",role:"spinbutton","aria-valuemin":a,"aria-valuemax":l,"aria-valuenow":ge.isInvalidate()?null:ge.toString(),step:u},R,{ref:pu(B,e),className:O,value:Pe,onChange:Ie,disabled:f,readOnly:g}))))});dbe.displayName="InputNumber";const hqe=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorBorder:r,borderRadius:o,fontSizeLG:s,controlHeightLG:a,controlHeightSM:l,colorError:c,inputPaddingHorizontalSM:u,colorTextDescription:d,motionDurationMid:h,colorPrimary:f,controlHeight:g,inputPaddingHorizontal:p,colorBgContainer:m,colorTextDisabled:v,borderRadiusSM:_,borderRadiusLG:y,controlWidth:S,handleVisible:L}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),iT(i)),U4(i,e)),{display:"inline-block",width:S,margin:0,padding:0,border:`${t}px ${n} ${r}`,borderRadius:o,"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:s,borderRadius:y,[`input${e}-input`]:{height:a-2*t}},"&-sm":{padding:0,borderRadius:_,[`input${e}-input`]:{height:l-2*t,padding:`0 ${u}px`}},"&:hover":Object.assign({},nT(i)),"&-focused":Object.assign({},hA(i)),"&-disabled":Object.assign(Object.assign({},_X(i)),{[`${e}-input`]:{cursor:"not-allowed"}}),"&-out-of-range":{input:{color:c}},"&-group":Object.assign(Object.assign(Object.assign({},Vr(i)),Q0e(i)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:y}},"&-sm":{[`${e}-group-addon`]:{borderRadius:_}}}}),[e]:{"&-input":Object.assign(Object.assign({width:"100%",height:g-2*t,padding:`0 ${p}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:`all ${h} linear`,appearance:"textfield",color:i.colorText,fontSize:"inherit",verticalAlign:"top"},Y0e(i.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:{[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:i.handleWidth,height:"100%",background:m,borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:L===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${h} linear ${h}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` +`,KGe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],V6={},Mu;function GGe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&V6[t])return V6[t];var n=window.getComputedStyle(i),r=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),o=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=KGe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:r};return e&&t&&(V6[t]=l),l}function qGe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Mu||(Mu=document.createElement("textarea"),Mu.setAttribute("tab-index","-1"),Mu.setAttribute("aria-hidden","true"),document.body.appendChild(Mu)),i.getAttribute("wrap")?Mu.setAttribute("wrap",i.getAttribute("wrap")):Mu.removeAttribute("wrap");var r=GGe(i,e),o=r.paddingSize,s=r.borderSize,a=r.boxSizing,l=r.sizingStyle;Mu.setAttribute("style","".concat(l,";").concat(jGe)),Mu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=Mu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=o),t!==null||n!==null){Mu.value=" ";var f=Mu.scrollHeight-o;t!==null&&(c=f*t,a==="border-box"&&(c=c+o+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+o+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var XGe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],z6=0,U6=1,j6=2,YGe=C.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var r=t.defaultValue,o=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Mn(t,XGe),f=nl(r,{value:o,postState:function(he){return he??""}}),g=$e(f,2),p=g[0],m=g[1],v=function(he){m(he.target.value),d==null||d(he)},_=C.useRef();C.useImperativeHandle(e,function(){return{textArea:_.current}});var y=C.useMemo(function(){return s&&Un(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),S=$e(y,2),L=S[0],E=S[1],D=!!s,k=function(){try{if(document.activeElement===_.current){var he=_.current,ge=he.selectionStart,ye=he.selectionEnd,be=he.scrollTop;_.current.setSelectionRange(ge,ye),_.current.scrollTop=be}}catch{}},T=C.useState(j6),M=$e(T,2),P=M[0],N=M[1],R=C.useState(),O=$e(R,2),B=O[0],$=O[1],G=function(){N(z6)};Cr(function(){D&&G()},[o,L,E,D]),Cr(function(){if(P===z6)N(U6);else if(P===U6){var Q=qGe(_.current,!1,L,E);N(j6),$(Q)}else k()},[P]);var U=C.useRef(),j=function(){tr.cancel(U.current)},ie=function(he){P===j6&&(a==null||a(he),s&&(j(),U.current=tr(function(){G()})))};C.useEffect(function(){return j},[]);var Y=D?B:null,J=te(te({},c),Y);return(P===z6||P===U6)&&(J.overflowY="hidden",J.overflowX="hidden"),C.createElement(Lh,{onResize:ie,disabled:!(s||a)},C.createElement("textarea",It({},h,{ref:_,style:J,className:De(n,l,we({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:v})))}),ZGe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles"];function cbe(i,e){return gt(i||"").slice(0,e).join("")}function Coe(i,e,t,n){var r=t;return i?r=cbe(t,n):gt(e||"").lengthn&&(r=e),r}var QGe=qe.forwardRef(function(i,e){var t,n=i.defaultValue,r=i.value,o=i.onFocus,s=i.onBlur,a=i.onChange,l=i.allowClear,c=i.maxLength,u=i.onCompositionStart,d=i.onCompositionEnd,h=i.suffix,f=i.prefixCls,g=f===void 0?"rc-textarea":f,p=i.classes,m=i.showCount,v=i.className,_=i.style,y=i.disabled,S=i.hidden,L=i.classNames,E=i.styles,D=Mn(i,ZGe),k=nl(n,{value:r,defaultValue:n}),T=$e(k,2),M=T[0],P=T[1],N=C.useRef(null),R=qe.useState(!1),O=$e(R,2),B=O[0],$=O[1],G=qe.useState(!1),U=$e(G,2),j=U[0],ie=U[1],Y=qe.useRef(),J=qe.useRef(0),Q=function(){N.current.textArea.focus()};C.useImperativeHandle(e,function(){return{resizableTextArea:N.current,focus:Q,blur:function(){N.current.textArea.blur()}}}),C.useEffect(function(){$(function(Ye){return!y&&Ye})},[y]);var he=Number(c)>0,ge=function(We){ie(!0),Y.current=M,J.current=We.currentTarget.selectionStart,u==null||u(We)},ye=function(We){ie(!1);var dt=We.currentTarget.value;if(he){var re,ue=J.current>=c+1||J.current===((re=Y.current)===null||re===void 0?void 0:re.length);dt=Coe(ue,Y.current,dt,c)}dt!==M&&(P(dt),NE(We.currentTarget,We,a,dt)),d==null||d(We)},be=function(We){var dt=We.target.value;if(!j&&he){var re=We.target.selectionStart>=c+1||We.target.selectionStart===dt.length||!We.target.selectionStart;dt=Coe(re,M,dt,c)}P(dt),NE(We.currentTarget,We,a,dt)},Ge=function(We){var dt=D.onPressEnter,re=D.onKeyDown;We.key==="Enter"&&dt&&dt(We),re==null||re(We)},nt=function(We){$(!0),o==null||o(We)},je=function(We){$(!1),s==null||s(We)},_e=function(We){P(""),Q(),NE(N.current.textArea,We,a)},Ve=TH(M);!j&&he&&r==null&&(Ve=cbe(Ve,c));var Le=h,Pe;if(m){var Be=gt(Ve).length;Un(m)==="object"?Pe=m.formatter({value:Ve,count:Be,maxLength:c}):Pe="".concat(Be).concat(he?" / ".concat(c):""),Le=qe.createElement(qe.Fragment,null,Le,qe.createElement("span",{className:De("".concat(g,"-data-count"),L==null?void 0:L.count),style:E==null?void 0:E.count},Pe))}var Qe=qe.createElement(abe,{value:Ve,allowClear:l,handleReset:_e,suffix:Le,prefixCls:g,classes:{affixWrapper:De(p==null?void 0:p.affixWrapper,(t={},we(t,"".concat(g,"-show-count"),m),we(t,"".concat(g,"-textarea-allow-clear"),l),t))},disabled:y,focused:B,className:v,style:_,dataAttrs:{affixWrapper:{"data-count":typeof Pe=="string"?Pe:void 0}},hidden:S,inputElement:qe.createElement(YGe,It({},D,{onKeyDown:Ge,onChange:be,onFocus:nt,onBlur:je,onCompositionStart:ge,onCompositionEnd:ye,className:L==null?void 0:L.textarea,style:te(te({},E==null?void 0:E.textarea),{},{resize:_==null?void 0:_.resize}),disabled:y,prefixCls:g,ref:N}))});return Qe}),JGe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,size:r,disabled:o,status:s,allowClear:a,showCount:l,classNames:c}=i,u=JGe(i,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames"]);const{getPrefixCls:d,direction:h}=C.useContext(Pn),f=C.useContext(Eh),g=r||f,p=C.useContext(I_),m=o??p,{status:v,hasFeedback:_,feedbackIcon:y}=C.useContext(Vf),S=P4(v,s),L=C.useRef(null);C.useImperativeHandle(e,()=>{var M;return{resizableTextArea:(M=L.current)===null||M===void 0?void 0:M.resizableTextArea,focus:P=>{var N,R;AGe((R=(N=L.current)===null||N===void 0?void 0:N.resizableTextArea)===null||R===void 0?void 0:R.textArea,P)},blur:()=>{var P;return(P=L.current)===null||P===void 0?void 0:P.blur()}}});const E=d("input",t);let D;typeof a=="object"&&(a!=null&&a.clearIcon)?D=a:a&&(D={clearIcon:C.createElement(PS,null)});const[k,T]=yX(E);return k(C.createElement(QGe,Object.assign({},u,{disabled:m,allowClear:D,classes:{affixWrapper:De(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:h==="rtl",[`${E}-affix-wrapper-borderless`]:!n,[`${E}-affix-wrapper-sm`]:g==="small",[`${E}-affix-wrapper-lg`]:g==="large",[`${E}-textarea-show-count`]:l},pp(`${E}-affix-wrapper`,S),T)},classNames:Object.assign(Object.assign({},c),{textarea:De({[`${E}-borderless`]:!n,[`${E}-sm`]:g==="small",[`${E}-lg`]:g==="large"},pp(E,S),T,c==null?void 0:c.textarea)}),prefixCls:E,suffix:_&&C.createElement("span",{className:`${E}-textarea-suffix`},y),showCount:l,ref:L})))}),tqe=eqe,oT=EX;oT.Group=kGe;oT.Search=UGe;oT.TextArea=tqe;oT.Password=HGe;const nqe=oT;function NH(){return typeof BigInt=="function"}function ub(i){var e=i.trim(),t=e.startsWith("-");t&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var n=e||"0",r=n.split("."),o=r[0]||"0",s=r[1]||"0";o==="0"&&s==="0"&&(t=!1);var a=t?"-":"";return{negative:t,negativeStr:a,trimStr:n,integerStr:o,decimalStr:s,fullStr:"".concat(a).concat(n)}}function DX(i){var e=String(i);return!Number.isNaN(Number(e))&&e.includes("e")}function qD(i){var e=String(i);if(DX(i)){var t=Number(e.slice(e.indexOf("e-")+2)),n=e.match(/\.(\d+)/);return n!=null&&n[1]&&(t+=n[1].length),t}return e.includes(".")&&IX(e)?e.length-e.indexOf(".")-1:0}function j4(i){var e=String(i);if(DX(i)){if(i>Number.MAX_SAFE_INTEGER)return String(NH()?BigInt(i).toString():Number.MAX_SAFE_INTEGER);if(iNumber.MAX_SAFE_INTEGER)return new i(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":j4(this.number):this.origin}}]),i}(),rqe=function(){function i(e){if(bs(this,i),we(this,"origin",""),we(this,"negative",void 0),we(this,"integer",void 0),we(this,"decimal",void 0),we(this,"decimalLen",void 0),we(this,"empty",void 0),we(this,"nan",void 0),ube(e)){this.empty=!0;return}if(this.origin=String(e),e==="-"||Number.isNaN(e)){this.nan=!0;return}var t=e;if(DX(t)&&(t=Number(t)),t=typeof t=="string"?t:j4(t),IX(t)){var n=ub(t);this.negative=n.negative;var r=n.trimStr.split(".");this.integer=BigInt(r[0]);var o=r[1]||"0";this.decimal=BigInt(o),this.decimalLen=o.length}else this.nan=!0}return Cs(i,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var n="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(n)}},{key:"negate",value:function(){var t=new i(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new i(t);var n=new i(t);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),o=this.alignDecimal(r),s=n.alignDecimal(r),a=(o+s).toString(),l=ub(a),c=l.negativeStr,u=l.trimStr,d="".concat(c).concat(u.padStart(r+1,"0"));return new i("".concat(d.slice(0,-r),".").concat(d.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(t==null?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":ub("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),i}();function Td(i){return NH()?new rqe(i):new iqe(i)}function LM(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(i==="")return"";var r=ub(i),o=r.negativeStr,s=r.integerStr,a=r.decimalStr,l="".concat(e).concat(a),c="".concat(o).concat(s);if(t>=0){var u=Number(a[t]);if(u>=5&&!n){var d=Td(i).add("".concat(o,"0.").concat("0".repeat(t)).concat(10-u));return LM(d.toString(),e,t,n)}return t===0?c:"".concat(c).concat(e).concat(a.padEnd(t,"0").slice(0,t))}return l===".0"?c:"".concat(c).concat(l)}var oqe=function(){var e=C.useState(!1),t=$e(e,2),n=t[0],r=t[1];return Cr(function(){r(M4())},[]),n},sqe=200,aqe=600;function lqe(i){var e=i.prefixCls,t=i.upNode,n=i.downNode,r=i.upDisabled,o=i.downDisabled,s=i.onStep,a=C.useRef(),l=C.useRef();l.current=s;var c=function(v,_){v.preventDefault(),l.current(_);function y(){l.current(_),a.current=setTimeout(y,sqe)}a.current=setTimeout(y,aqe)},u=function(){clearTimeout(a.current)};C.useEffect(function(){return u},[]);var d=oqe();if(d)return null;var h="".concat(e,"-handler"),f=De(h,"".concat(h,"-up"),we({},"".concat(h,"-up-disabled"),r)),g=De(h,"".concat(h,"-down"),we({},"".concat(h,"-down-disabled"),o)),p={unselectable:"on",role:"button",onMouseUp:u,onMouseLeave:u};return C.createElement("div",{className:"".concat(h,"-wrap")},C.createElement("span",It({},p,{onMouseDown:function(v){c(v,!0)},"aria-label":"Increase Value","aria-disabled":r,className:f}),t||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),C.createElement("span",It({},p,{onMouseDown:function(v){c(v,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:g}),n||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function yoe(i){var e=typeof i=="number"?j4(i):ub(i).fullStr,t=e.includes(".");return t?ub(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:i+"0"}function cqe(i,e){var t=C.useRef(null);function n(){try{var o=i.selectionStart,s=i.selectionEnd,a=i.value,l=a.substring(0,o),c=a.substring(s);t.current={start:o,end:s,value:a,beforeTxt:l,afterTxt:c}}catch{}}function r(){if(i&&t.current&&e)try{var o=i.value,s=t.current,a=s.beforeTxt,l=s.afterTxt,c=s.start,u=o.length;if(o.endsWith(l))u=o.length-t.current.afterTxt.length;else if(o.startsWith(a))u=a.length;else{var d=a[c-1],h=o.indexOf(d,c-1);h!==-1&&(u=h+1)}i.setSelectionRange(u,u)}catch(f){uo(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(f.message))}}return[n,r]}const uqe=function(){var i=C.useRef(0),e=function(){tr.cancel(i.current)};return C.useEffect(function(){return e},[]),function(t){e(),i.current=tr(function(){t()})}};var dqe=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],woe=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},Soe=function(e){var t=Td(e);return t.isInvalidate()?null:t},dbe=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-input-number":n,o=i.className,s=i.style,a=i.min,l=i.max,c=i.step,u=c===void 0?1:c,d=i.defaultValue,h=i.value,f=i.disabled,g=i.readOnly,p=i.upHandler,m=i.downHandler,v=i.keyboard,_=i.controls,y=_===void 0?!0:_,S=i.stringMode,L=i.parser,E=i.formatter,D=i.precision,k=i.decimalSeparator,T=i.onChange,M=i.onInput,P=i.onPressEnter,N=i.onStep,R=Mn(i,dqe),O="".concat(r,"-input"),B=C.useRef(null),$=C.useState(!1),G=$e($,2),U=G[0],j=G[1],ie=C.useRef(!1),Y=C.useRef(!1),J=C.useRef(!1),Q=C.useState(function(){return Td(h??d)}),he=$e(Q,2),ge=he[0],ye=he[1];function be(Ue){h===void 0&&ye(Ue)}var Ge=C.useCallback(function(Ue,Ct){if(!Ct)return D>=0?D:Math.max(qD(Ue),qD(u))},[D,u]),nt=C.useCallback(function(Ue){var Ct=String(Ue);if(L)return L(Ct);var Dt=Ct;return k&&(Dt=Dt.replace(k,".")),Dt.replace(/[^\w.-]+/g,"")},[L,k]),je=C.useRef(""),_e=C.useCallback(function(Ue,Ct){if(E)return E(Ue,{userTyping:Ct,input:String(je.current)});var Dt=typeof Ue=="number"?j4(Ue):Ue;if(!Ct){var St=Ge(Dt,Ct);if(IX(Dt)&&(k||St>=0)){var Kt=k||".";Dt=LM(Dt,Kt,St)}}return Dt},[E,Ge,k]),Ve=C.useState(function(){var Ue=d??h;return ge.isInvalidate()&&["string","number"].includes(Un(Ue))?Number.isNaN(Ue)?"":Ue:_e(ge.toString(),!1)}),Le=$e(Ve,2),Pe=Le[0],Be=Le[1];je.current=Pe;function Qe(Ue,Ct){Be(_e(Ue.isInvalidate()?Ue.toString(!1):Ue.toString(!Ct),Ct))}var Ye=C.useMemo(function(){return Soe(l)},[l,D]),We=C.useMemo(function(){return Soe(a)},[a,D]),dt=C.useMemo(function(){return!Ye||!ge||ge.isInvalidate()?!1:Ye.lessEquals(ge)},[Ye,ge]),re=C.useMemo(function(){return!We||!ge||ge.isInvalidate()?!1:ge.lessEquals(We)},[We,ge]),ue=cqe(B.current,U),de=$e(ue,2),z=de[0],q=de[1],se=function(Ct){return Ye&&!Ct.lessEquals(Ye)?Ye:We&&!We.lessEquals(Ct)?We:null},ne=function(Ct){return!se(Ct)},pe=function(Ct,Dt){var St=Ct,Kt=ne(St)||St.isEmpty();if(!St.isEmpty()&&!Dt&&(St=se(St)||St,Kt=!0),!g&&!f&&Kt){var _n=St.toString(),zt=Ge(_n,Dt);return zt>=0&&(St=Td(LM(_n,".",zt)),ne(St)||(St=Td(LM(_n,".",zt,!0)))),St.equals(ge)||(be(St),T==null||T(St.isEmpty()?null:woe(S,St)),h===void 0&&Qe(St,Dt)),St}return ge},ke=uqe(),oe=function Ue(Ct){if(z(),Be(Ct),!Y.current){var Dt=nt(Ct),St=Td(Dt);St.isNaN()||pe(St,!0)}M==null||M(Ct),ke(function(){var Kt=Ct;L||(Kt=Ct.replace(/。/g,".")),Kt!==Ct&&Ue(Kt)})},ce=function(){Y.current=!0},fe=function(){Y.current=!1,oe(B.current.value)},Ie=function(Ct){oe(Ct.target.value)},Te=function(Ct){var Dt;if(!(Ct&&dt||!Ct&&re)){ie.current=!1;var St=Td(J.current?yoe(u):u);Ct||(St=St.negate());var Kt=(ge||Td(0)).add(St.toString()),_n=pe(Kt,!1);N==null||N(woe(S,_n),{offset:J.current?yoe(u):u,type:Ct?"up":"down"}),(Dt=B.current)===null||Dt===void 0||Dt.focus()}},He=function(Ct){var Dt=Td(nt(Pe)),St=Dt;Dt.isNaN()?St=ge:St=pe(Dt,Ct),h!==void 0?Qe(ge,!1):St.isNaN()||Qe(St,!1)},Me=function(){ie.current=!0},bt=function(Ct){var Dt=Ct.which,St=Ct.shiftKey;ie.current=!0,St?J.current=!0:J.current=!1,Dt===_t.ENTER&&(Y.current||(ie.current=!1),He(!1),P==null||P(Ct)),v!==!1&&!Y.current&&[_t.UP,_t.DOWN].includes(Dt)&&(Te(_t.UP===Dt),Ct.preventDefault())},rt=function(){ie.current=!1,J.current=!1},Ht=function(){He(!1),j(!1),ie.current=!1};return IE(function(){ge.isInvalidate()||Qe(ge,!1)},[D]),IE(function(){var Ue=Td(h);ye(Ue);var Ct=Td(nt(Pe));(!Ue.equals(Ct)||!ie.current||E)&&Qe(Ue,ie.current)},[h]),IE(function(){E&&q()},[Pe]),C.createElement("div",{className:De(r,o,(t={},we(t,"".concat(r,"-focused"),U),we(t,"".concat(r,"-disabled"),f),we(t,"".concat(r,"-readonly"),g),we(t,"".concat(r,"-not-a-number"),ge.isNaN()),we(t,"".concat(r,"-out-of-range"),!ge.isInvalidate()&&!ne(ge)),t)),style:s,onFocus:function(){j(!0)},onBlur:Ht,onKeyDown:bt,onKeyUp:rt,onCompositionStart:ce,onCompositionEnd:fe,onBeforeInput:Me},y&&C.createElement(lqe,{prefixCls:r,upNode:p,downNode:m,upDisabled:dt,downDisabled:re,onStep:Te}),C.createElement("div",{className:"".concat(O,"-wrap")},C.createElement("input",It({autoComplete:"off",role:"spinbutton","aria-valuemin":a,"aria-valuemax":l,"aria-valuenow":ge.isInvalidate()?null:ge.toString(),step:u},R,{ref:pu(B,e),className:O,value:Pe,onChange:Ie,disabled:f,readOnly:g}))))});dbe.displayName="InputNumber";const hqe=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorBorder:r,borderRadius:o,fontSizeLG:s,controlHeightLG:a,controlHeightSM:l,colorError:c,inputPaddingHorizontalSM:u,colorTextDescription:d,motionDurationMid:h,colorPrimary:f,controlHeight:g,inputPaddingHorizontal:p,colorBgContainer:m,colorTextDisabled:v,borderRadiusSM:_,borderRadiusLG:y,controlWidth:S,handleVisible:L}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),iT(i)),U4(i,e)),{display:"inline-block",width:S,margin:0,padding:0,border:`${t}px ${n} ${r}`,borderRadius:o,"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:s,borderRadius:y,[`input${e}-input`]:{height:a-2*t}},"&-sm":{padding:0,borderRadius:_,[`input${e}-input`]:{height:l-2*t,padding:`0 ${u}px`}},"&:hover":Object.assign({},nT(i)),"&-focused":Object.assign({},hA(i)),"&-disabled":Object.assign(Object.assign({},_X(i)),{[`${e}-input`]:{cursor:"not-allowed"}}),"&-out-of-range":{input:{color:c}},"&-group":Object.assign(Object.assign(Object.assign({},Vr(i)),Q0e(i)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:y}},"&-sm":{[`${e}-group-addon`]:{borderRadius:_}}}}),[e]:{"&-input":Object.assign(Object.assign({width:"100%",height:g-2*t,padding:`0 ${p}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:`all ${h} linear`,appearance:"textfield",color:i.colorText,fontSize:"inherit",verticalAlign:"top"},Y0e(i.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:{[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:i.handleWidth,height:"100%",background:m,borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:L===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${h} linear ${h}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` ${e}-handler-up-inner, ${e}-handler-down-inner `]:{marginInlineEnd:0,fontSize:i.handleFontSize}}},[`${e}-handler`]:{height:"50%",overflow:"hidden",color:d,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${t}px ${n} ${r}`,transition:`all ${h} linear`,"&:active":{background:i.colorFillAlter},"&:hover":{height:"60%",[` @@ -376,7 +376,7 @@ html body { `]:{cursor:"not-allowed"},[` ${e}-handler-up-disabled:hover &-handler-up-inner, ${e}-handler-down-disabled:hover &-handler-down-inner - `]:{color:v}}},{[`${e}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${e}-handler-down`]:{borderBlockStartWidth:0}}}]},fqe=i=>{const{componentCls:e,inputPaddingHorizontal:t,inputAffixPadding:n,controlWidth:r,borderRadiusLG:o,borderRadiusSM:s}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},iT(i)),U4(i,`${e}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:r,padding:0,paddingInlineStart:t,"&-lg":{borderRadius:o},"&-sm":{borderRadius:s},[`&:not(${e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},nT(i)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},[`input${e}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:n},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:t,marginInlineStart:n}}})}},gqe=yo("InputNumber",i=>{const e=CX(i);return[hqe(e),fqe(e),N4(e)]},i=>({controlWidth:90,handleWidth:i.controlHeightSM-i.lineWidth*2,handleFontSize:i.fontSize/2,handleVisible:"auto"}));var pqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Pn),r=C.useContext(Eh),[o,s]=C.useState(!1),a=C.useRef(null);C.useImperativeHandle(e,()=>a.current);const{className:l,rootClassName:c,size:u,disabled:d,prefixCls:h,addonBefore:f,addonAfter:g,prefix:p,bordered:m=!0,readOnly:v,status:_,controls:y}=i,S=pqe(i,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),L=t("input-number",h),[E,D]=gqe(L),{compactSize:k,compactItemClassnames:T}=FS(L,n);let M=C.createElement(b8e,{className:`${L}-handler-up-inner`}),P=C.createElement(Dq,{className:`${L}-handler-down-inner`});const N=typeof y=="boolean"?y:void 0;typeof y=="object"&&(M=typeof y.upIcon>"u"?M:C.createElement("span",{className:`${L}-handler-up-inner`},y.upIcon),P=typeof y.downIcon>"u"?P:C.createElement("span",{className:`${L}-handler-down-inner`},y.downIcon));const{hasFeedback:R,status:O,isFormItemInput:B,feedbackIcon:$}=C.useContext(Vf),G=P4(O,_),U=k||u||r,j=p!=null||R,ie=!!(f||g),Y=C.useContext(D_),J=d??Y,Q=De({[`${L}-lg`]:U==="large",[`${L}-sm`]:U==="small",[`${L}-rtl`]:n==="rtl",[`${L}-borderless`]:!m,[`${L}-in-form-item`]:B},pp(L,G),T,D,l,!j&&!ie&&c);let he=C.createElement(dbe,Object.assign({ref:a,disabled:J,className:Q,upHandler:M,downHandler:P,prefixCls:L,readOnly:v,controls:N},S));if(j){const ge=De(`${L}-affix-wrapper`,pp(`${L}-affix-wrapper`,G,R),{[`${L}-affix-wrapper-focused`]:o,[`${L}-affix-wrapper-disabled`]:i.disabled,[`${L}-affix-wrapper-sm`]:U==="small",[`${L}-affix-wrapper-lg`]:U==="large",[`${L}-affix-wrapper-rtl`]:n==="rtl",[`${L}-affix-wrapper-readonly`]:v,[`${L}-affix-wrapper-borderless`]:!m},!ie&&l,!ie&&c,D);he=C.createElement("div",{className:ge,style:i.style,onMouseUp:()=>a.current.focus()},p&&C.createElement("span",{className:`${L}-prefix`},p),ta(he,{style:null,value:i.value,onFocus:ye=>{var be;s(!0),(be=i.onFocus)===null||be===void 0||be.call(i,ye)},onBlur:ye=>{var be;s(!1),(be=i.onBlur)===null||be===void 0||be.call(i,ye)}}),R&&C.createElement("span",{className:`${L}-suffix`},$))}if(ie){const ge=`${L}-group`,ye=`${ge}-addon`,be=f?C.createElement("div",{className:ye},f):null,Ge=g?C.createElement("div",{className:ye},g):null,nt=De(`${L}-wrapper`,ge,D,{[`${ge}-rtl`]:n==="rtl"}),je=De(`${L}-group-wrapper`,{[`${L}-group-wrapper-sm`]:U==="small",[`${L}-group-wrapper-lg`]:U==="large",[`${L}-group-wrapper-rtl`]:n==="rtl"},pp(`${L}-group-wrapper`,G,R),D,l,c);he=C.createElement("div",{className:je,style:i.style},C.createElement("div",{className:nt},be&&C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},be)),ta(he,{style:null,disabled:J}),Ge&&C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},Ge))))}return E(he)}),fbe=hbe,mqe=i=>C.createElement(I4,{theme:{components:{InputNumber:{handleVisible:!0}}}},C.createElement(hbe,Object.assign({},i)));fbe._InternalPanelDoNotUseOrYouWillBeFired=mqe;const K6=fbe;var g0={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};const vqe={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};var gbe=function(i){Sh(t,i);var e=xh(t);function t(){var n;bs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s=0||a.relatedTarget.className.indexOf("".concat(d,"-item"))>=0))&&u(n.getValidValue()))},n.go=function(a){var l=n.state.goInputText;l!==""&&(a.keyCode===g0.ENTER||a.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return Cs(t,[{key:"getPageSizeOptions",value:function(){var r=this.props,o=r.pageSize,s=r.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,l){var c=Number.isNaN(Number(a))?0:Number(a),u=Number.isNaN(Number(l))?0:Number(l);return c-u})}},{key:"render",value:function(){var r=this,o=this.props,s=o.pageSize,a=o.locale,l=o.rootPrefixCls,c=o.changeSize,u=o.quickGo,d=o.goButton,h=o.selectComponentClass,f=o.buildOptionText,g=o.selectPrefixCls,p=o.disabled,m=this.state.goInputText,v="".concat(l,"-options"),_=h,y=null,S=null,L=null;if(!c&&!u)return null;var E=this.getPageSizeOptions();if(c&&_){var D=E.map(function(k,T){return qe.createElement(_.Option,{key:T,value:k.toString()},(f||r.buildOptionText)(k))});y=qe.createElement(_,{disabled:p,prefixCls:g,showSearch:!1,className:"".concat(v,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||E[0]).toString(),onChange:this.changeSize,getPopupContainer:function(T){return T.parentNode},"aria-label":a.page_size,defaultOpen:!1},D)}return u&&(d&&(L=typeof d=="boolean"?qe.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:p,className:"".concat(v,"-quick-jumper-button")},a.jump_to_confirm):qe.createElement("span",{onClick:this.go,onKeyUp:this.go},d)),S=qe.createElement("div",{className:"".concat(v,"-quick-jumper")},a.jump_to,qe.createElement("input",{disabled:p,type:"text",value:m,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,L)),qe.createElement("li",{className:"".concat(v)},y,S)}}]),t}(qe.Component);gbe.defaultProps={pageSizeOptions:["10","20","50","100"]};var qx=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,s=e.className,a=e.showTitle,l=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),h=De(d,"".concat(d,"-").concat(r),(t={},we(t,"".concat(d,"-active"),o),we(t,"".concat(d,"-disabled"),!r),we(t,e.className,s),t)),f=function(){l(r)},g=function(m){c(m,l,r)};return qe.createElement("li",{title:a?r.toString():null,className:h,onClick:f,onKeyPress:g,tabIndex:0},u(r,"page",qe.createElement("a",{rel:"nofollow"},r)))};function RH(){}function xoe(i){var e=Number(i);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}var _qe=function(e,t,n){return n};function dm(i,e,t){var n=typeof i>"u"?e.pageSize:i;return Math.floor((t.total-1)/n)+1}var pbe=function(i){Sh(t,i);var e=xh(t);function t(n){var r;bs(this,t),r=e.call(this,n),r.paginationNode=qe.createRef(),r.getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(dm(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(c,u){var d=r.props.prefixCls,h=c||qe.createElement("button",{type:"button","aria-label":u,className:"".concat(d,"-item-link")});return typeof c=="function"&&(h=qe.createElement(c,te({},r.props))),h},r.isValid=function(c){var u=r.props.total;return xoe(c)&&c!==r.state.current&&xoe(u)&&u>0},r.shouldDisplayQuickJumper=function(){var c=r.props,u=c.showQuickJumper,d=c.total,h=r.state.pageSize;return d<=h?!1:u},r.handleKeyDown=function(c){(c.keyCode===g0.ARROW_UP||c.keyCode===g0.ARROW_DOWN)&&c.preventDefault()},r.handleKeyUp=function(c){var u=r.getValidValue(c),d=r.state.currentInputValue;u!==d&&r.setState({currentInputValue:u}),c.keyCode===g0.ENTER?r.handleChange(u):c.keyCode===g0.ARROW_UP?r.handleChange(u-1):c.keyCode===g0.ARROW_DOWN&&r.handleChange(u+1)},r.handleBlur=function(c){var u=r.getValidValue(c);r.handleChange(u)},r.changePageSize=function(c){var u=r.state.current,d=dm(c,r.state,r.props);u=u>d?d:u,d===0&&(u=r.state.current),typeof c=="number"&&("pageSize"in r.props||r.setState({pageSize:c}),"current"in r.props||r.setState({current:u,currentInputValue:u})),r.props.onShowSizeChange(u,c),"onChange"in r.props&&r.props.onChange&&r.props.onChange(u,c)},r.handleChange=function(c){var u=r.props,d=u.disabled,h=u.onChange,f=r.state,g=f.pageSize,p=f.current,m=f.currentInputValue;if(r.isValid(c)&&!d){var v=dm(void 0,r.state,r.props),_=c;return c>v?_=v:c<1&&(_=1),"current"in r.props||r.setState({current:_}),_!==m&&r.setState({currentInputValue:_}),h(_,g),_}return p},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?d-2:0),f=2;f=s?l=s:l=Number(o),l}},{key:"getShowSizeChanger",value:function(){var r=this.props,o=r.showSizeChanger,s=r.total,a=r.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"render",value:function(){var r=this,o=this.props,s=o.prefixCls,a=o.className,l=o.style,c=o.disabled,u=o.hideOnSinglePage,d=o.total,h=o.locale,f=o.showQuickJumper,g=o.showLessItems,p=o.showTitle,m=o.showTotal,v=o.simple,_=o.itemRender,y=o.showPrevNextJumpers,S=o.jumpPrevIcon,L=o.jumpNextIcon,E=o.selectComponentClass,D=o.selectPrefixCls,k=o.pageSizeOptions,T=this.state,M=T.current,P=T.pageSize,N=T.currentInputValue;if(u===!0&&d<=P)return null;var R=dm(void 0,this.state,this.props),O=[],B=null,$=null,G=null,U=null,j=null,ie=f&&f.goButton,Y=g?1:2,J=M-1>0?M-1:0,Q=M+1d?d:M*P]));if(v)return ie&&(typeof ie=="boolean"?j=qe.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},h.jump_to_confirm):j=qe.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ie),j=qe.createElement("li",{title:p?"".concat(h.jump_to).concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},j)),qe.createElement("ul",It({className:De(s,"".concat(s,"-simple"),we({},"".concat(s,"-disabled"),c),a),style:l,ref:this.paginationNode},he),ge,qe.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:De("".concat(s,"-prev"),we({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(J)),qe.createElement("li",{title:p?"".concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},qe.createElement("input",{type:"text",value:N,disabled:c,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),qe.createElement("span",{className:"".concat(s,"-slash")},"/"),R),qe.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:De("".concat(s,"-next"),we({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Q)),j);if(R<=3+Y*2){var ye={locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:p,itemRender:_};R||O.push(qe.createElement(qx,It({},ye,{key:"noPager",page:1,className:"".concat(s,"-item-disabled")})));for(var be=1;be<=R;be+=1){var Ge=M===be;O.push(qe.createElement(qx,It({},ye,{key:be,page:be,active:Ge})))}}else{var nt=g?h.prev_3:h.prev_5,je=g?h.next_3:h.next_5;y&&(B=qe.createElement("li",{title:p?nt:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:De("".concat(s,"-jump-prev"),we({},"".concat(s,"-jump-prev-custom-icon"),!!S))},_(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),$=qe.createElement("li",{title:p?je:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:De("".concat(s,"-jump-next"),we({},"".concat(s,"-jump-next-custom-icon"),!!L))},_(this.getJumpNextPage(),"jump-next",this.getItemIcon(L,"next page")))),U=qe.createElement(qx,{locale:h,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:R,page:R,active:!1,showTitle:p,itemRender:_}),G=qe.createElement(qx,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:p,itemRender:_});var _e=Math.max(1,M-Y),Ve=Math.min(M+Y,R);M-1<=Y&&(Ve=1+Y*2),R-M<=Y&&(_e=R-Y*2);for(var Le=_e;Le<=Ve;Le+=1){var Pe=M===Le;O.push(qe.createElement(qx,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Le,page:Le,active:Pe,showTitle:p,itemRender:_}))}M-1>=Y*2&&M!==1+2&&(O[0]=C.cloneElement(O[0],{className:"".concat(s,"-item-after-jump-prev")}),O.unshift(B)),R-M>=Y*2&&M!==R-2&&(O[O.length-1]=C.cloneElement(O[O.length-1],{className:"".concat(s,"-item-before-jump-next")}),O.push($)),_e!==1&&O.unshift(G),Ve!==R&&O.push(U)}var Be=!this.hasPrev()||!R,Qe=!this.hasNext()||!R;return qe.createElement("ul",It({className:De(s,a,we({},"".concat(s,"-disabled"),c)),style:l,ref:this.paginationNode},he),ge,qe.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:Be?null:0,onKeyPress:this.runIfEnterPrev,className:De("".concat(s,"-prev"),we({},"".concat(s,"-disabled"),Be)),"aria-disabled":Be},this.renderPrev(J)),O,qe.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:Qe?null:0,onKeyPress:this.runIfEnterNext,className:De("".concat(s,"-next"),we({},"".concat(s,"-disabled"),Qe)),"aria-disabled":Qe},this.renderNext(Q)),qe.createElement(gbe,{disabled:c,locale:h,rootPrefixCls:s,selectComponentClass:E,selectPrefixCls:D,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:M,pageSize:P,pageSizeOptions:k,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ie}))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s={};if("current"in r&&(s.current=r.current,r.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in r&&r.pageSize!==o.pageSize){var a=o.current,l=dm(r.pageSize,o,r);a=a>l?l:a,"current"in r||(s.current=a,s.currentInputValue=a),s.pageSize=r.pageSize}return s}}]),t}(qe.Component);pbe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:RH,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:RH,locale:vqe,style:{},itemRender:_qe,totalBoundaryShowSizeChanger:50};const mbe=i=>C.createElement(A4,Object.assign({},i,{size:"small"})),vbe=i=>C.createElement(A4,Object.assign({},i,{size:"middle"}));mbe.Option=A4.Option;vbe.Option=A4.Option;const bqe=i=>{const{componentCls:e}=i;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`&${e}-mini`]:{[` + `]:{color:v}}},{[`${e}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${e}-handler-down`]:{borderBlockStartWidth:0}}}]},fqe=i=>{const{componentCls:e,inputPaddingHorizontal:t,inputAffixPadding:n,controlWidth:r,borderRadiusLG:o,borderRadiusSM:s}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},iT(i)),U4(i,`${e}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:r,padding:0,paddingInlineStart:t,"&-lg":{borderRadius:o},"&-sm":{borderRadius:s},[`&:not(${e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},nT(i)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},[`input${e}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:n},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:t,marginInlineStart:n}}})}},gqe=yo("InputNumber",i=>{const e=CX(i);return[hqe(e),fqe(e),N4(e)]},i=>({controlWidth:90,handleWidth:i.controlHeightSM-i.lineWidth*2,handleFontSize:i.fontSize/2,handleVisible:"auto"}));var pqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Pn),r=C.useContext(Eh),[o,s]=C.useState(!1),a=C.useRef(null);C.useImperativeHandle(e,()=>a.current);const{className:l,rootClassName:c,size:u,disabled:d,prefixCls:h,addonBefore:f,addonAfter:g,prefix:p,bordered:m=!0,readOnly:v,status:_,controls:y}=i,S=pqe(i,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),L=t("input-number",h),[E,D]=gqe(L),{compactSize:k,compactItemClassnames:T}=FS(L,n);let M=C.createElement(b8e,{className:`${L}-handler-up-inner`}),P=C.createElement(Dq,{className:`${L}-handler-down-inner`});const N=typeof y=="boolean"?y:void 0;typeof y=="object"&&(M=typeof y.upIcon>"u"?M:C.createElement("span",{className:`${L}-handler-up-inner`},y.upIcon),P=typeof y.downIcon>"u"?P:C.createElement("span",{className:`${L}-handler-down-inner`},y.downIcon));const{hasFeedback:R,status:O,isFormItemInput:B,feedbackIcon:$}=C.useContext(Vf),G=P4(O,_),U=k||u||r,j=p!=null||R,ie=!!(f||g),Y=C.useContext(I_),J=d??Y,Q=De({[`${L}-lg`]:U==="large",[`${L}-sm`]:U==="small",[`${L}-rtl`]:n==="rtl",[`${L}-borderless`]:!m,[`${L}-in-form-item`]:B},pp(L,G),T,D,l,!j&&!ie&&c);let he=C.createElement(dbe,Object.assign({ref:a,disabled:J,className:Q,upHandler:M,downHandler:P,prefixCls:L,readOnly:v,controls:N},S));if(j){const ge=De(`${L}-affix-wrapper`,pp(`${L}-affix-wrapper`,G,R),{[`${L}-affix-wrapper-focused`]:o,[`${L}-affix-wrapper-disabled`]:i.disabled,[`${L}-affix-wrapper-sm`]:U==="small",[`${L}-affix-wrapper-lg`]:U==="large",[`${L}-affix-wrapper-rtl`]:n==="rtl",[`${L}-affix-wrapper-readonly`]:v,[`${L}-affix-wrapper-borderless`]:!m},!ie&&l,!ie&&c,D);he=C.createElement("div",{className:ge,style:i.style,onMouseUp:()=>a.current.focus()},p&&C.createElement("span",{className:`${L}-prefix`},p),ta(he,{style:null,value:i.value,onFocus:ye=>{var be;s(!0),(be=i.onFocus)===null||be===void 0||be.call(i,ye)},onBlur:ye=>{var be;s(!1),(be=i.onBlur)===null||be===void 0||be.call(i,ye)}}),R&&C.createElement("span",{className:`${L}-suffix`},$))}if(ie){const ge=`${L}-group`,ye=`${ge}-addon`,be=f?C.createElement("div",{className:ye},f):null,Ge=g?C.createElement("div",{className:ye},g):null,nt=De(`${L}-wrapper`,ge,D,{[`${ge}-rtl`]:n==="rtl"}),je=De(`${L}-group-wrapper`,{[`${L}-group-wrapper-sm`]:U==="small",[`${L}-group-wrapper-lg`]:U==="large",[`${L}-group-wrapper-rtl`]:n==="rtl"},pp(`${L}-group-wrapper`,G,R),D,l,c);he=C.createElement("div",{className:je,style:i.style},C.createElement("div",{className:nt},be&&C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},be)),ta(he,{style:null,disabled:J}),Ge&&C.createElement(Fw,null,C.createElement(UD,{status:!0,override:!0},Ge))))}return E(he)}),fbe=hbe,mqe=i=>C.createElement(I4,{theme:{components:{InputNumber:{handleVisible:!0}}}},C.createElement(hbe,Object.assign({},i)));fbe._InternalPanelDoNotUseOrYouWillBeFired=mqe;const K6=fbe;var p0={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};const vqe={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};var gbe=function(i){Sh(t,i);var e=xh(t);function t(){var n;bs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s=0||a.relatedTarget.className.indexOf("".concat(d,"-item"))>=0))&&u(n.getValidValue()))},n.go=function(a){var l=n.state.goInputText;l!==""&&(a.keyCode===p0.ENTER||a.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return Cs(t,[{key:"getPageSizeOptions",value:function(){var r=this.props,o=r.pageSize,s=r.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,l){var c=Number.isNaN(Number(a))?0:Number(a),u=Number.isNaN(Number(l))?0:Number(l);return c-u})}},{key:"render",value:function(){var r=this,o=this.props,s=o.pageSize,a=o.locale,l=o.rootPrefixCls,c=o.changeSize,u=o.quickGo,d=o.goButton,h=o.selectComponentClass,f=o.buildOptionText,g=o.selectPrefixCls,p=o.disabled,m=this.state.goInputText,v="".concat(l,"-options"),_=h,y=null,S=null,L=null;if(!c&&!u)return null;var E=this.getPageSizeOptions();if(c&&_){var D=E.map(function(k,T){return qe.createElement(_.Option,{key:T,value:k.toString()},(f||r.buildOptionText)(k))});y=qe.createElement(_,{disabled:p,prefixCls:g,showSearch:!1,className:"".concat(v,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||E[0]).toString(),onChange:this.changeSize,getPopupContainer:function(T){return T.parentNode},"aria-label":a.page_size,defaultOpen:!1},D)}return u&&(d&&(L=typeof d=="boolean"?qe.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:p,className:"".concat(v,"-quick-jumper-button")},a.jump_to_confirm):qe.createElement("span",{onClick:this.go,onKeyUp:this.go},d)),S=qe.createElement("div",{className:"".concat(v,"-quick-jumper")},a.jump_to,qe.createElement("input",{disabled:p,type:"text",value:m,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,L)),qe.createElement("li",{className:"".concat(v)},y,S)}}]),t}(qe.Component);gbe.defaultProps={pageSizeOptions:["10","20","50","100"]};var qx=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,s=e.className,a=e.showTitle,l=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),h=De(d,"".concat(d,"-").concat(r),(t={},we(t,"".concat(d,"-active"),o),we(t,"".concat(d,"-disabled"),!r),we(t,e.className,s),t)),f=function(){l(r)},g=function(m){c(m,l,r)};return qe.createElement("li",{title:a?r.toString():null,className:h,onClick:f,onKeyPress:g,tabIndex:0},u(r,"page",qe.createElement("a",{rel:"nofollow"},r)))};function RH(){}function xoe(i){var e=Number(i);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}var _qe=function(e,t,n){return n};function dm(i,e,t){var n=typeof i>"u"?e.pageSize:i;return Math.floor((t.total-1)/n)+1}var pbe=function(i){Sh(t,i);var e=xh(t);function t(n){var r;bs(this,t),r=e.call(this,n),r.paginationNode=qe.createRef(),r.getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(dm(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(c,u){var d=r.props.prefixCls,h=c||qe.createElement("button",{type:"button","aria-label":u,className:"".concat(d,"-item-link")});return typeof c=="function"&&(h=qe.createElement(c,te({},r.props))),h},r.isValid=function(c){var u=r.props.total;return xoe(c)&&c!==r.state.current&&xoe(u)&&u>0},r.shouldDisplayQuickJumper=function(){var c=r.props,u=c.showQuickJumper,d=c.total,h=r.state.pageSize;return d<=h?!1:u},r.handleKeyDown=function(c){(c.keyCode===p0.ARROW_UP||c.keyCode===p0.ARROW_DOWN)&&c.preventDefault()},r.handleKeyUp=function(c){var u=r.getValidValue(c),d=r.state.currentInputValue;u!==d&&r.setState({currentInputValue:u}),c.keyCode===p0.ENTER?r.handleChange(u):c.keyCode===p0.ARROW_UP?r.handleChange(u-1):c.keyCode===p0.ARROW_DOWN&&r.handleChange(u+1)},r.handleBlur=function(c){var u=r.getValidValue(c);r.handleChange(u)},r.changePageSize=function(c){var u=r.state.current,d=dm(c,r.state,r.props);u=u>d?d:u,d===0&&(u=r.state.current),typeof c=="number"&&("pageSize"in r.props||r.setState({pageSize:c}),"current"in r.props||r.setState({current:u,currentInputValue:u})),r.props.onShowSizeChange(u,c),"onChange"in r.props&&r.props.onChange&&r.props.onChange(u,c)},r.handleChange=function(c){var u=r.props,d=u.disabled,h=u.onChange,f=r.state,g=f.pageSize,p=f.current,m=f.currentInputValue;if(r.isValid(c)&&!d){var v=dm(void 0,r.state,r.props),_=c;return c>v?_=v:c<1&&(_=1),"current"in r.props||r.setState({current:_}),_!==m&&r.setState({currentInputValue:_}),h(_,g),_}return p},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?d-2:0),f=2;f=s?l=s:l=Number(o),l}},{key:"getShowSizeChanger",value:function(){var r=this.props,o=r.showSizeChanger,s=r.total,a=r.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"render",value:function(){var r=this,o=this.props,s=o.prefixCls,a=o.className,l=o.style,c=o.disabled,u=o.hideOnSinglePage,d=o.total,h=o.locale,f=o.showQuickJumper,g=o.showLessItems,p=o.showTitle,m=o.showTotal,v=o.simple,_=o.itemRender,y=o.showPrevNextJumpers,S=o.jumpPrevIcon,L=o.jumpNextIcon,E=o.selectComponentClass,D=o.selectPrefixCls,k=o.pageSizeOptions,T=this.state,M=T.current,P=T.pageSize,N=T.currentInputValue;if(u===!0&&d<=P)return null;var R=dm(void 0,this.state,this.props),O=[],B=null,$=null,G=null,U=null,j=null,ie=f&&f.goButton,Y=g?1:2,J=M-1>0?M-1:0,Q=M+1d?d:M*P]));if(v)return ie&&(typeof ie=="boolean"?j=qe.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},h.jump_to_confirm):j=qe.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ie),j=qe.createElement("li",{title:p?"".concat(h.jump_to).concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},j)),qe.createElement("ul",It({className:De(s,"".concat(s,"-simple"),we({},"".concat(s,"-disabled"),c),a),style:l,ref:this.paginationNode},he),ge,qe.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:De("".concat(s,"-prev"),we({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(J)),qe.createElement("li",{title:p?"".concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},qe.createElement("input",{type:"text",value:N,disabled:c,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),qe.createElement("span",{className:"".concat(s,"-slash")},"/"),R),qe.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:De("".concat(s,"-next"),we({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Q)),j);if(R<=3+Y*2){var ye={locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:p,itemRender:_};R||O.push(qe.createElement(qx,It({},ye,{key:"noPager",page:1,className:"".concat(s,"-item-disabled")})));for(var be=1;be<=R;be+=1){var Ge=M===be;O.push(qe.createElement(qx,It({},ye,{key:be,page:be,active:Ge})))}}else{var nt=g?h.prev_3:h.prev_5,je=g?h.next_3:h.next_5;y&&(B=qe.createElement("li",{title:p?nt:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:De("".concat(s,"-jump-prev"),we({},"".concat(s,"-jump-prev-custom-icon"),!!S))},_(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),$=qe.createElement("li",{title:p?je:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:De("".concat(s,"-jump-next"),we({},"".concat(s,"-jump-next-custom-icon"),!!L))},_(this.getJumpNextPage(),"jump-next",this.getItemIcon(L,"next page")))),U=qe.createElement(qx,{locale:h,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:R,page:R,active:!1,showTitle:p,itemRender:_}),G=qe.createElement(qx,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:p,itemRender:_});var _e=Math.max(1,M-Y),Ve=Math.min(M+Y,R);M-1<=Y&&(Ve=1+Y*2),R-M<=Y&&(_e=R-Y*2);for(var Le=_e;Le<=Ve;Le+=1){var Pe=M===Le;O.push(qe.createElement(qx,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Le,page:Le,active:Pe,showTitle:p,itemRender:_}))}M-1>=Y*2&&M!==1+2&&(O[0]=C.cloneElement(O[0],{className:"".concat(s,"-item-after-jump-prev")}),O.unshift(B)),R-M>=Y*2&&M!==R-2&&(O[O.length-1]=C.cloneElement(O[O.length-1],{className:"".concat(s,"-item-before-jump-next")}),O.push($)),_e!==1&&O.unshift(G),Ve!==R&&O.push(U)}var Be=!this.hasPrev()||!R,Qe=!this.hasNext()||!R;return qe.createElement("ul",It({className:De(s,a,we({},"".concat(s,"-disabled"),c)),style:l,ref:this.paginationNode},he),ge,qe.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:Be?null:0,onKeyPress:this.runIfEnterPrev,className:De("".concat(s,"-prev"),we({},"".concat(s,"-disabled"),Be)),"aria-disabled":Be},this.renderPrev(J)),O,qe.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:Qe?null:0,onKeyPress:this.runIfEnterNext,className:De("".concat(s,"-next"),we({},"".concat(s,"-disabled"),Qe)),"aria-disabled":Qe},this.renderNext(Q)),qe.createElement(gbe,{disabled:c,locale:h,rootPrefixCls:s,selectComponentClass:E,selectPrefixCls:D,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:M,pageSize:P,pageSizeOptions:k,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ie}))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s={};if("current"in r&&(s.current=r.current,r.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in r&&r.pageSize!==o.pageSize){var a=o.current,l=dm(r.pageSize,o,r);a=a>l?l:a,"current"in r||(s.current=a,s.currentInputValue=a),s.pageSize=r.pageSize}return s}}]),t}(qe.Component);pbe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:RH,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:RH,locale:vqe,style:{},itemRender:_qe,totalBoundaryShowSizeChanger:50};const mbe=i=>C.createElement(A4,Object.assign({},i,{size:"small"})),vbe=i=>C.createElement(A4,Object.assign({},i,{size:"middle"}));mbe.Option=A4.Option;vbe.Option=A4.Option;const bqe=i=>{const{componentCls:e}=i;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`&${e}-mini`]:{[` &:hover ${e}-item:not(${e}-item-active), &:active ${e}-item:not(${e}-item-active), &:hover ${e}-item-link, @@ -396,10 +396,10 @@ html body { ${e}-next, ${e}-jump-prev, ${e}-jump-next - `]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,color:i.colorText,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:i.borderRadius,cursor:"pointer",transition:`all ${i.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:i.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:i.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:"none",transition:`border ${i.motionDurationMid}`},[`&:focus-visible ${e}-item-link`]:Object.assign({},Np(i)),[`&:hover ${e}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:i.paginationSlashMarginInlineEnd,marginInlineStart:i.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:i.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:i.controlHeight,marginInlineStart:i.marginXS,lineHeight:`${i.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},iT(i)),{width:i.controlHeightLG*1.25,height:i.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:i.marginXS,marginInlineEnd:i.marginXS})}}}},Sqe=i=>{const{componentCls:e}=i;return{[`${e}-item`]:Object.assign(Object.assign({display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,marginInlineEnd:i.marginXS,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${i.paginationItemPaddingInline}px`,color:i.colorText,transition:"none","&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${i.motionDurationMid}`,backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}}},zD(i)),{"&-active":{fontWeight:i.paginationFontWeightActive,backgroundColor:i.paginationItemBgActive,borderColor:i.colorPrimary,a:{color:i.colorPrimary},"&:hover":{borderColor:i.colorPrimaryHover},"&:hover a":{color:i.colorPrimaryHover}}})}},xqe=i=>{const{componentCls:e}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:i.paginationItemSize,marginInlineEnd:i.marginXS,lineHeight:`${i.paginationItemSize-2}px`,verticalAlign:"middle"}}),Sqe(i)),wqe(i)),yqe(i)),Cqe(i)),bqe(i)),{[`@media only screen and (max-width: ${i.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${i.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${i.componentCls}-rtl`]:{direction:"rtl"}}},Lqe=i=>{const{componentCls:e}=i;return{[`${e}${e}-disabled`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:i.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:i.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,a:{color:i.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:i.paginationItemDisabledBgActive}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,color:i.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder}}},[e]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:i.colorPrimaryHover,backgroundColor:i.paginationItemBg},[`${e}-item-link`]:{backgroundColor:i.paginationItemLinkBg,borderColor:i.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,color:i.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:i.colorBorder,color:i.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:i.paginationItemBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,a:{color:i.colorPrimary}},"&-active":{borderColor:i.colorPrimary}}}}},Eqe=yo("Pagination",i=>{const e=Bi(i,{paginationItemSize:i.controlHeight,paginationFontFamily:i.fontFamily,paginationItemBg:i.colorBgContainer,paginationItemBgActive:i.colorBgContainer,paginationFontWeightActive:i.fontWeightStrong,paginationItemSizeSM:i.controlHeightSM,paginationItemInputBg:i.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:i.controlItemBgActiveDisabled,paginationItemDisabledColorActive:i.colorTextDisabled,paginationItemLinkBg:i.colorBgContainer,inputOutlineOffset:"0 0",paginationMiniOptionsMarginInlineStart:i.marginXXS/2,paginationMiniQuickJumperInputWidth:i.controlHeightLG*1.1,paginationItemPaddingInline:i.marginXXS*1.5,paginationEllipsisLetterSpacing:i.marginXXS/2,paginationSlashMarginInlineStart:i.marginXXS,paginationSlashMarginInlineEnd:i.marginSM,paginationEllipsisTextIndent:"0.13em"},CX(i));return[xqe(e),i.wireframe&&Lqe(e)]});var Dqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,selectPrefixCls:t,className:n,rootClassName:r,size:o,locale:s,selectComponentClass:a,responsive:l,showSizeChanger:c}=i,u=Dqe(i,["prefixCls","selectPrefixCls","className","rootClassName","size","locale","selectComponentClass","responsive","showSizeChanger"]);const{xs:d}=O4(l),{getPrefixCls:h,direction:f,pagination:g={}}=C.useContext(Pn),p=h("pagination",e),[m,v]=Eqe(p),_=c??g.showSizeChanger,y=C.useMemo(()=>{const T=C.createElement("span",{className:`${p}-item-ellipsis`},"•••"),M=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(R$,null):C.createElement(Die,null)),P=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(Die,null):C.createElement(R$,null)),N=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(Eie,{className:`${p}-item-link-icon`}):C.createElement(Lie,{className:`${p}-item-link-icon`}),T)),R=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(Lie,{className:`${p}-item-link-icon`}):C.createElement(Eie,{className:`${p}-item-link-icon`}),T));return{prevIcon:M,nextIcon:P,jumpPrevIcon:N,jumpNextIcon:R}},[f,p]),[S]=jk("Pagination",kve),L=Object.assign(Object.assign({},S),s),E=o==="small"||!!(d&&!o&&l),D=h("select",t),k=De({[`${p}-mini`]:E,[`${p}-rtl`]:f==="rtl"},n,r,v);return m(C.createElement(pbe,Object.assign({},y,u,{prefixCls:p,selectPrefixCls:D,className:k,selectComponentClass:a||(E?mbe:vbe),locale:L,showSizeChanger:_})))},kX=Iqe,kqe=new vi("antSpinMove",{to:{opacity:1}}),Tqe=new vi("antRotate",{to:{transform:"rotate(405deg)"}}),Nqe=i=>({[`${i.componentCls}`]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",display:"none",color:i.colorPrimary,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${i.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:i.contentHeight,[`${i.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-i.spinDotSize/2},[`${i.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(i.spinDotSize-i.fontSize)/2+2,textShadow:`0 1px 2px ${i.colorBgContainer}`},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSize/2)-10},"&-sm":{[`${i.componentCls}-dot`]:{margin:-i.spinDotSizeSM/2},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeSM-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeSM/2)-10}},"&-lg":{[`${i.componentCls}-dot`]:{margin:-(i.spinDotSizeLG/2)},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeLG-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeLG/2)-10}}},[`${i.componentCls}-container`]:{position:"relative",transition:`opacity ${i.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:i.colorBgContainer,opacity:0,transition:`all ${i.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${i.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:i.spinDotDefault},[`${i.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:i.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(i.spinDotSize-i.marginXXS/2)/2,height:(i.spinDotSize-i.marginXXS/2)/2,backgroundColor:i.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:kqe,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Tqe,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeSM,i:{width:(i.spinDotSizeSM-i.marginXXS/2)/2,height:(i.spinDotSizeSM-i.marginXXS/2)/2}},[`&-lg ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeLG,i:{width:(i.spinDotSizeLG-i.marginXXS)/2,height:(i.spinDotSizeLG-i.marginXXS)/2}},[`&${i.componentCls}-show-text ${i.componentCls}-text`]:{display:"block"}})}),Rqe=yo("Spin",i=>{const e=Bi(i,{spinDotDefault:i.colorTextDescription,spinDotSize:i.controlHeightLG/2,spinDotSizeSM:i.controlHeightLG*.35,spinDotSizeLG:i.controlHeight});return[Nqe(e)]},{contentHeight:400});var Mqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{spinPrefixCls:e,spinning:t=!0,delay:n=0,className:r,rootClassName:o,size:s="default",tip:a,wrapperClassName:l,style:c,children:u,hashId:d}=i,h=Mqe(i,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[f,g]=C.useState(()=>t&&!Aqe(t,n));C.useEffect(()=>{if(t){const L=zKe(n,()=>{g(!0)});return L(),()=>{var E;(E=L==null?void 0:L.cancel)===null||E===void 0||E.call(L)}}g(!1)},[n,t]);const p=C.useMemo(()=>typeof u<"u",[u]),{direction:m}=C.useContext(Pn),v=De(e,{[`${e}-sm`]:s==="small",[`${e}-lg`]:s==="large",[`${e}-spinning`]:f,[`${e}-show-text`]:!!a,[`${e}-rtl`]:m==="rtl"},r,o,d),_=De(`${e}-container`,{[`${e}-blur`]:f}),y=cl(h,["indicator","prefixCls"]),S=C.createElement("div",Object.assign({},y,{style:c,className:v,"aria-live":"polite","aria-busy":f}),Pqe(e,i),a?C.createElement("div",{className:`${e}-text`},a):null);return p?C.createElement("div",Object.assign({},y,{className:De(`${e}-nested-loading`,l,d)}),f&&C.createElement("div",{key:"loading"},S),C.createElement("div",{className:_,key:"container"},u)):S},_be=i=>{const{prefixCls:e}=i,{getPrefixCls:t}=C.useContext(Pn),n=t("spin",e),[r,o]=Rqe(n),s=Object.assign(Object.assign({},i),{spinPrefixCls:n,hashId:o});return r(C.createElement(Oqe,Object.assign({},s)))};_be.setDefaultIndicator=i=>{EM=i};const bbe=_be;function Cbe(){const i=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=t[n];r!==void 0&&(i[n]=r)})}return i}var ybe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,className:t,avatar:n,title:r,description:o}=i,s=ybe(i,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:a}=C.useContext(Pn),l=a("list",e),c=De(`${l}-item-meta`,t),u=qe.createElement("div",{className:`${l}-item-meta-content`},r&&qe.createElement("h4",{className:`${l}-item-meta-title`},r),o&&qe.createElement("div",{className:`${l}-item-meta-description`},o));return qe.createElement("div",Object.assign({},s,{className:c}),n&&qe.createElement("div",{className:`${l}-item-meta-avatar`},n),(r||o)&&u)},Bqe=(i,e)=>{var{prefixCls:t,children:n,actions:r,extra:o,className:s,colStyle:a}=i,l=ybe(i,["prefixCls","children","actions","extra","className","colStyle"]);const{grid:c,itemLayout:u}=C.useContext(TX),{getPrefixCls:d}=C.useContext(Pn),h=()=>{let _;return C.Children.forEach(n,y=>{typeof y=="string"&&(_=!0)}),_&&C.Children.count(n)>1},f=()=>u==="vertical"?!!o:!h(),g=d("list",t),p=r&&r.length>0&&qe.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((_,y)=>qe.createElement("li",{key:`${g}-item-action-${y}`},_,y!==r.length-1&&qe.createElement("em",{className:`${g}-item-action-split`})))),m=c?"div":"li",v=qe.createElement(m,Object.assign({},l,c?{}:{ref:e},{className:De(`${g}-item`,{[`${g}-item-no-flex`]:!f()},s)}),u==="vertical"&&o?[qe.createElement("div",{className:`${g}-item-main`,key:"content"},n,p),qe.createElement("div",{className:`${g}-item-extra`,key:"extra"},o)]:[n,p,ta(o,{key:"extra"})]);return c?qe.createElement(xGe,{ref:e,flex:1,style:a},v):v},wbe=C.forwardRef(Bqe);wbe.Meta=Fqe;const Wqe=wbe,$qe=i=>{const{listBorderedCls:e,componentCls:t,paddingLG:n,margin:r,padding:o,listItemPaddingSM:s,marginLG:a,borderRadiusLG:l}=i;return{[`${e}`]:{border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:l,[`${t}-header,${t}-footer,${t}-item`]:{paddingInline:n},[`${t}-pagination`]:{margin:`${r}px ${a}px`}},[`${e}${t}-sm`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:s}},[`${e}${t}-lg`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:`${o}px ${n}px`}}}},Hqe=i=>{const{componentCls:e,screenSM:t,screenMD:n,marginLG:r,marginSM:o,margin:s}=i;return{[`@media screen and (max-width:${n})`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${t})`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:i.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${s}px`}}}}}},Vqe=i=>{const{componentCls:e,antCls:t,controlHeight:n,minHeight:r,paddingSM:o,marginLG:s,padding:a,listItemPadding:l,colorPrimary:c,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:h,margin:f,colorText:g,colorTextDescription:p,motionDurationSlow:m,lineWidth:v}=i,_={};return["start","center","end"].forEach(y=>{_[`&-align-${y}`]={textAlign:y}}),{[`${e}`]:Object.assign(Object.assign({},Vr(i)),{position:"relative","*":{outline:"none"},[`${e}-header, ${e}-footer`]:{background:"transparent",paddingBlock:o},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:s},_),{[`${t}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:a},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${i.marginXXS}px 0`,color:g,fontSize:i.fontSize,lineHeight:i.lineHeight,"> a":{color:g,transition:`all ${m}`,["&:hover"]:{color:c}}},[`${e}-item-meta-description`]:{color:p,fontSize:i.fontSize,lineHeight:i.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:i.marginXXL,padding:0,fontSize:0,listStyle:"none",["& > li"]:{position:"relative",display:"inline-block",padding:`0 ${h}px`,color:p,fontSize:i.fontSize,lineHeight:i.lineHeight,textAlign:"center",["&:first-child"]:{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:v,height:Math.ceil(i.fontSize*i.lineHeight)-i.marginXXS*2,transform:"translateY(-50%)",backgroundColor:i.colorSplit}}},[`${e}-empty`]:{padding:`${a}px 0`,color:p,fontSize:i.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:a,color:i.colorTextDisabled,fontSize:i.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${t}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:f,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:s},[`${e}-item-meta`]:{marginBlockEnd:a,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:o,color:g,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:a,marginInlineStart:"auto","> li":{padding:`0 ${a}px`,["&:first-child"]:{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`,["&:last-child"]:{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:n},[`${e}-split${e}-something-after-last-item ${t}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},zqe=yo("List",i=>{const e=Bi(i,{listBorderedCls:`${i.componentCls}-bordered`,minHeight:i.controlHeightLG,listItemPadding:`${i.paddingContentVertical}px 0`,listItemPaddingSM:`${i.paddingContentVerticalSM}px ${i.paddingContentHorizontal}px`,listItemPaddingLG:`${i.paddingContentVerticalLG}px ${i.paddingContentHorizontalLG}px`});return[Vqe(e),$qe(e),Hqe(e)]},{contentWidth:220});var Uqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r(We,dt)=>{D(We),T(dt),t&&t[Ye]&&t[Ye](We,dt)},B=O("onChange"),$=O("onShowSizeChange"),G=(Ye,We)=>{if(!_)return null;let dt;return typeof v=="function"?dt=v(Ye):v?dt=Ye[v]:dt=Ye.key,dt||(dt=`list-item-${We}`),C.createElement(C.Fragment,{key:dt},_(Ye,We))},U=()=>!!(u||t||p),j=M("list",n),[ie,Y]=zqe(j);let J=m;typeof J=="boolean"&&(J={spinning:J});const Q=J&&J.spinning;let he="";switch(f){case"large":he="lg";break;case"small":he="sm";break}const ge=De(j,{[`${j}-vertical`]:c==="vertical",[`${j}-${he}`]:he,[`${j}-split`]:o,[`${j}-bordered`]:r,[`${j}-loading`]:Q,[`${j}-grid`]:!!d,[`${j}-something-after-last-item`]:U(),[`${j}-rtl`]:N==="rtl"},s,a,Y),ye=Cbe(R,{total:h.length,current:E,pageSize:k},t||{}),be=Math.ceil(ye.total/ye.pageSize);ye.current>be&&(ye.current=be);const Ge=t?C.createElement("div",{className:De(`${j}-pagination`,`${j}-pagination-align-${(e=ye==null?void 0:ye.align)!==null&&e!==void 0?e:"end"}`)},C.createElement(kX,Object.assign({},ye,{onChange:B,onShowSizeChange:$}))):null;let nt=gt(h);t&&h.length>(ye.current-1)*ye.pageSize&&(nt=gt(h).splice((ye.current-1)*ye.pageSize,ye.pageSize));const je=Object.keys(d||{}).some(Ye=>["xs","sm","md","lg","xl","xxl"].includes(Ye)),_e=O4(je),Ve=C.useMemo(()=>{for(let Ye=0;Ye{if(!d)return;const Ye=Ve&&d[Ve]?d[Ve]:d.column;if(Ye)return{width:`${100/Ye}%`,maxWidth:`${100/Ye}%`}},[d==null?void 0:d.column,Ve]);let Pe=Q&&C.createElement("div",{style:{minHeight:53}});if(nt.length>0){const Ye=nt.map((We,dt)=>G(We,dt));Pe=d?C.createElement(DGe,{gutter:d.gutter},C.Children.map(Ye,We=>C.createElement("div",{key:We==null?void 0:We.key,style:Le},We))):C.createElement("ul",{className:`${j}-items`},Ye)}else!l&&!Q&&(Pe=C.createElement("div",{className:`${j}-empty-text`},y&&y.emptyText||(P==null?void 0:P("List"))||C.createElement(nX,{componentName:"List"})));const Be=ye.position||"bottom",Qe=C.useMemo(()=>({grid:d,itemLayout:c}),[JSON.stringify(d),c]);return ie(C.createElement(TX.Provider,{value:Qe},C.createElement("div",Object.assign({className:ge},S),(Be==="top"||Be==="both")&&Ge,g&&C.createElement("div",{className:`${j}-header`},g),C.createElement(bbe,Object.assign({},J),Pe,l),p&&C.createElement("div",{className:`${j}-footer`},p),u||(Be==="bottom"||Be==="both")&&Ge)))}DM.Item=Wqe;let Wu=null,j0=i=>i(),XD=[],pA={};function jqe(){const{prefixCls:i,getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=pA,s=i??Fq().getPrefixCls("message"),a=(e==null?void 0:e())||document.body;return{prefixCls:s,container:a,duration:t,rtl:n,maxCount:r,top:o}}const Kqe=C.forwardRef((i,e)=>{const t=()=>{const{prefixCls:d,container:h,maxCount:f,duration:g,rtl:p,top:m}=jqe();return{prefixCls:d,getContainer:()=>h,maxCount:f,duration:g,rtl:p,top:m}},[n,r]=C.useState(t),[o,s]=e_e(n),a=Fq(),l=a.getRootPrefixCls(),c=a.getIconPrefixCls(),u=()=>{r(t)};return C.useEffect(u,[]),C.useImperativeHandle(e,()=>{const d=Object.assign({},o);return Object.keys(d).forEach(h=>{d[h]=function(){return u(),o[h].apply(o,arguments)}}),{instance:d,sync:u}}),C.createElement(I4,{prefixCls:l,iconPrefixCls:c},s)});function K4(){if(!Wu){const i=document.createDocumentFragment(),e={fragment:i};Wu=e,j0(()=>{Hq(C.createElement(Kqe,{ref:t=>{const{instance:n,sync:r}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=r,K4())})}}),i)});return}Wu.instance&&(XD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{j0(()=>{const n=Wu.instance.open(Object.assign(Object.assign({},pA),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":j0(()=>{Wu==null||Wu.instance.destroy(i.key)});break;default:j0(()=>{var n;const r=(n=Wu.instance)[e].apply(n,gt(i.args));r==null||r.then(i.resolve),i.setCloseFn(r)})}}),XD=[])}function Gqe(i){pA=Object.assign(Object.assign({},pA),i),j0(()=>{var e;(e=Wu==null?void 0:Wu.sync)===null||e===void 0||e.call(Wu)})}function qqe(i){const e=$q(t=>{let n;const r={type:"open",config:i,resolve:t,setCloseFn:o=>{n=o}};return XD.push(r),()=>{n?j0(()=>{n()}):r.skipped=!0}});return K4(),e}function Xqe(i,e){const t=$q(n=>{let r;const o={type:i,args:e,resolve:n,setCloseFn:s=>{r=s}};return XD.push(o),()=>{r?j0(()=>{r()}):o.skipped=!0}});return K4(),t}function Yqe(i){XD.push({type:"destroy",key:i}),K4()}const Zqe=["success","info","warning","error","loading"],Qqe={open:qqe,destroy:Yqe,config:Gqe,useMessage:aWe,_InternalPanelDoNotUseOrYouWillBeFired:nWe},Sbe=Qqe;Zqe.forEach(i=>{Sbe[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n10&&arguments[10]!==void 0?arguments[10]:0,h=n/100*360*((360-s)/360),f=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],g=(100-r)/100*t;return c==="round"&&r!==100&&(g+=u/2,g>=t&&(g=t-.01)),{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+d,transform:"rotate(".concat(o+h+f,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},NX=function(e){var t=e.id,n=e.prefixCls,r=e.steps,o=e.strokeWidth,s=e.trailWidth,a=e.gapDegree,l=a===void 0?0:a,c=e.gapPosition,u=e.trailColor,d=e.strokeLinecap,h=e.style,f=e.className,g=e.strokeColor,p=e.percent,m=Mn(e,rXe),v=iXe(t),_="".concat(v,"-gradient"),y=Xx/2-o/2,S=Math.PI*2*y,L=l>0?90+l/2:-90,E=S*((360-l)/360),D=Un(r)==="object"?r:{count:r,space:2},k=D.count,T=D.space,M=G6(S,E,0,100,L,l,c,u,d,o),P=Doe(p),N=Doe(g),R=N.find(function(G){return G&&Un(G)==="object"}),O=eXe(),B=function(){var U=0;return P.map(function(j,ie){var Y=N[ie]||N[N.length-1],J=Y&&Un(Y)==="object"?"url(#".concat(_,")"):void 0,Q=G6(S,E,U,j,L,l,c,Y,d,o);return U+=j,C.createElement("circle",{key:ie,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:J,strokeLinecap:d,strokeWidth:o,opacity:j===0?0:1,style:Q,ref:function(ge){O[ie]=ge}})}).reverse()},$=function(){var U=Math.round(k*(P[0]/100)),j=100/k,ie=0;return new Array(k).fill(null).map(function(Y,J){var Q=J<=U-1?N[0]:u,he=Q&&Un(Q)==="object"?"url(#".concat(_,")"):void 0,ge=G6(S,E,ie,j,L,l,c,Q,"butt",o,T);return ie+=(E-ge.strokeDashoffset+T)*100/E,C.createElement("circle",{key:J,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:he,strokeWidth:o,opacity:1,style:ge,ref:function(be){O[J]=be}})})};return C.createElement("svg",It({className:De("".concat(n,"-circle"),f),viewBox:"".concat(-Xx/2," ").concat(-Xx/2," ").concat(Xx," ").concat(Xx),style:h,id:t,role:"presentation"},m),R&&C.createElement("defs",null,C.createElement("linearGradient",{id:_,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(R).sort(function(G,U){return Eoe(G)-Eoe(U)}).map(function(G,U){return C.createElement("stop",{key:U,offset:G,stopColor:R[G]})}))),!k&&C.createElement("circle",{className:"".concat(n,"-circle-trail"),r:y,cx:0,cy:0,stroke:u,strokeLinecap:d,strokeWidth:s||o,style:M}),k?$():B())};NX.defaultProps=Jqe;NX.displayName="Circle";function ub(i){return!i||i<0?0:i>100?100:i}function vA(i){let{success:e,successPercent:t}=i,n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const oXe=i=>{let{percent:e,success:t,successPercent:n}=i;const r=ub(vA({success:t,successPercent:n}));return[r,ub(ub(e)-r)]},sXe=i=>{let{success:e={},strokeColor:t}=i;const{strokeColor:n}=e;return[n||$y.green,t||null]},G4=(i,e,t)=>{var n,r,o,s;let a=-1,l=-1;if(e==="step"){const c=t.steps,u=t.strokeWidth;typeof i=="string"||typeof i>"u"?(a=i==="small"?2:14,l=u??8):typeof i=="number"?[a,l]=[i,i]:[a=14,l=8]=i,a*=c}else if(e==="line"){const c=t==null?void 0:t.strokeWidth;typeof i=="string"||typeof i>"u"?l=c||(i==="small"?6:8):typeof i=="number"?[a,l]=[i,i]:[a=-1,l=8]=i}else(e==="circle"||e==="dashboard")&&(typeof i=="string"||typeof i>"u"?[a,l]=i==="small"?[60,60]:[120,120]:typeof i=="number"?[a,l]=[i,i]:(a=(r=(n=i[0])!==null&&n!==void 0?n:i[1])!==null&&r!==void 0?r:120,l=(s=(o=i[0])!==null&&o!==void 0?o:i[1])!==null&&s!==void 0?s:120));return[a,l]},aXe=3,lXe=i=>aXe/i*100,cXe=i=>{const{prefixCls:e,trailColor:t=null,strokeLinecap:n="round",gapPosition:r,gapDegree:o,width:s=120,type:a,children:l,success:c,size:u}=i,d=u??[s,s],[h,f]=G4(d,"circle");let{strokeWidth:g}=i;g===void 0&&(g=Math.max(lXe(h),6));const p={width:h,height:f,fontSize:h*.15+6},m=C.useMemo(()=>{if(o||o===0)return o;if(a==="dashboard")return 75},[o,a]),v=r||a==="dashboard"&&"bottom"||void 0,_=Object.prototype.toString.call(i.strokeColor)==="[object Object]",y=sXe({success:c,strokeColor:i.strokeColor}),S=De(`${e}-inner`,{[`${e}-circle-gradient`]:_}),L=C.createElement(NX,{percent:oXe(i),strokeWidth:g,trailWidth:g,strokeColor:y,strokeLinecap:n,trailColor:t,prefixCls:e,gapDegree:m,gapPosition:v});return C.createElement("div",{className:S,style:p},h<=20?C.createElement(Qk,{title:l},C.createElement("span",null,L)):C.createElement(C.Fragment,null,L,l))},uXe=cXe;var dXe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let e=[];return Object.keys(i).forEach(t=>{const n=parseFloat(t.replace(/%/g,""));isNaN(n)||e.push({key:n,value:i[t]})}),e=e.sort((t,n)=>t.key-n.key),e.map(t=>{let{key:n,value:r}=t;return`${r} ${n}%`}).join(", ")},fXe=(i,e)=>{const{from:t=$y.blue,to:n=$y.blue,direction:r=e==="rtl"?"to left":"to right"}=i,o=dXe(i,["from","to","direction"]);if(Object.keys(o).length!==0){const s=hXe(o);return{backgroundImage:`linear-gradient(${r}, ${s})`}}return{backgroundImage:`linear-gradient(${r}, ${t}, ${n})`}},gXe=i=>{const{prefixCls:e,direction:t,percent:n,size:r,strokeWidth:o,strokeColor:s,strokeLinecap:a="round",children:l,trailColor:c=null,success:u}=i,d=s&&typeof s!="string"?fXe(s,t):{backgroundColor:s},h=a==="square"||a==="butt"?0:void 0,f={backgroundColor:c||void 0,borderRadius:h},g=r??[-1,o||(r==="small"?6:8)],[p,m]=G4(g,"line",{strokeWidth:o}),v=Object.assign({width:`${ub(n)}%`,height:m,borderRadius:h},d),_=vA(i),y={width:`${ub(_)}%`,height:m,borderRadius:h,backgroundColor:u==null?void 0:u.strokeColor},S={width:p<0?"100%":p,height:m};return C.createElement(C.Fragment,null,C.createElement("div",{className:`${e}-outer`,style:S},C.createElement("div",{className:`${e}-inner`,style:f},C.createElement("div",{className:`${e}-bg`,style:v}),_!==void 0?C.createElement("div",{className:`${e}-success-bg`,style:y}):null)),l)},pXe=gXe,mXe=i=>{const{size:e,steps:t,percent:n=0,strokeWidth:r=8,strokeColor:o,trailColor:s=null,prefixCls:a,children:l}=i,c=Math.round(t*(n/100)),d=e??[e==="small"?2:14,r],[h,f]=G4(d,"step",{steps:t,strokeWidth:r}),g=h/t,p=new Array(t);for(let m=0;m{const{componentCls:e,iconCls:t}=i;return{[e]:Object.assign(Object.assign({},Vr(i)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:i.fontSize,marginInlineEnd:i.marginXS,marginBottom:i.marginXS},[`${e}-outer`]:{display:"inline-block",width:"100%"},[`&${e}-show-info`]:{[`${e}-outer`]:{marginInlineEnd:`calc(-2em - ${i.marginXS}px)`,paddingInlineEnd:`calc(2em + ${i.paddingXS}px)`}},[`${e}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:i.progressRemainingColor,borderRadius:i.progressLineRadius},[`${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorInfo}},[`${e}-success-bg, ${e}-bg`]:{position:"relative",backgroundColor:i.colorInfo,borderRadius:i.progressLineRadius,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`},[`${e}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:i.colorSuccess},[`${e}-text`]:{display:"inline-block",width:"2em",marginInlineStart:i.marginXS,color:i.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:i.fontSize}},[`&${e}-status-active`]:{[`${e}-bg::before`]:{position:"absolute",inset:0,backgroundColor:i.colorBgContainer,borderRadius:i.progressLineRadius,opacity:0,animationName:_Xe,animationDuration:i.progressActiveMotionDuration,animationTimingFunction:i.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${e}-status-exception`]:{[`${e}-bg`]:{backgroundColor:i.colorError},[`${e}-text`]:{color:i.colorError}},[`&${e}-status-exception ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorError}},[`&${e}-status-success`]:{[`${e}-bg`]:{backgroundColor:i.colorSuccess},[`${e}-text`]:{color:i.colorSuccess}},[`&${e}-status-success ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorSuccess}}})}},CXe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-circle-trail`]:{stroke:i.progressRemainingColor},[`&${e}-circle ${e}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${e}-circle ${e}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:i.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:`${i.fontSize/i.fontSizeSM}em`}},[`${e}-circle&-status-exception`]:{[`${e}-text`]:{color:i.colorError}},[`${e}-circle&-status-success`]:{[`${e}-text`]:{color:i.colorSuccess}}},[`${e}-inline-circle`]:{lineHeight:1,[`${e}-inner`]:{verticalAlign:"bottom"}}}},yXe=i=>{const{componentCls:e}=i;return{[e]:{[`${e}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:i.progressStepMinWidth,marginInlineEnd:i.progressStepMarginInlineEnd,backgroundColor:i.progressRemainingColor,transition:`all ${i.motionDurationSlow}`,"&-active":{backgroundColor:i.colorInfo}}}}}},wXe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-small&-line, ${e}-small&-line ${e}-text ${t}`]:{fontSize:i.fontSizeSM}}}},SXe=yo("Progress",i=>{const e=i.marginXXS/2,t=Bi(i,{progressLineRadius:100,progressInfoTextColor:i.colorText,progressDefaultColor:i.colorInfo,progressRemainingColor:i.colorFillSecondary,progressStepMarginInlineEnd:e,progressStepMinWidth:e,progressActiveMotionDuration:"2.4s"});return[bXe(t),CXe(t),yXe(t),wXe(t)]});var xXe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,rootClassName:n,steps:r,strokeColor:o,percent:s=0,size:a="default",showInfo:l=!0,type:c="line",status:u,format:d}=i,h=xXe(i,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format"]),f=C.useMemo(()=>{var T,M;const P=vA(i);return parseInt(P!==void 0?(T=P??0)===null||T===void 0?void 0:T.toString():(M=s??0)===null||M===void 0?void 0:M.toString(),10)},[s,i.success,i.successPercent]),g=C.useMemo(()=>!LXe.includes(u)&&f>=100?"success":u||"normal",[u,f]),{getPrefixCls:p,direction:m}=C.useContext(Pn),v=p("progress",e),[_,y]=SXe(v),S=C.useMemo(()=>{if(!l)return null;const T=vA(i);let M;const P=d||(R=>`${R}%`),N=c==="line";return d||g!=="exception"&&g!=="success"?M=P(ub(s),ub(T)):g==="exception"?M=N?C.createElement(PS,null):C.createElement(Vk,null):g==="success"&&(M=N?C.createElement(Eq,null):C.createElement(vme,null)),C.createElement("span",{className:`${v}-text`,title:typeof M=="string"?M:void 0},M)},[l,s,f,g,c,v,d]),L=Array.isArray(o)?o[0]:o,E=typeof o=="string"||Array.isArray(o)?o:void 0;let D;c==="line"?D=r?C.createElement(vXe,Object.assign({},i,{strokeColor:E,prefixCls:v,steps:r}),S):C.createElement(pXe,Object.assign({},i,{strokeColor:L,prefixCls:v,direction:m}),S):(c==="circle"||c==="dashboard")&&(D=C.createElement(uXe,Object.assign({},i,{strokeColor:L,prefixCls:v,progressStatus:g}),S));const k=De(v,{[`${v}-inline-circle`]:c==="circle"&&G4(a,"circle")[0]<=20,[`${v}-${c==="dashboard"&&"circle"||r&&"steps"||c}`]:!0,[`${v}-status-${g}`]:!0,[`${v}-show-info`]:l,[`${v}-${a}`]:typeof a=="string",[`${v}-rtl`]:m==="rtl"},t,n,y);return _(C.createElement("div",Object.assign({className:k,role:"progressbar"},cl(h,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),D))},Ioe=EXe;var Mm={};function DXe(i){var e=C.createContext(void 0),t=function(r){var o=r.value,s=r.children,a=C.useRef(o);a.current=o;var l=C.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),c=$e(l,1),u=c[0];return Cr(function(){lh.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(o)})})},[o]),C.createElement(e.Provider,{value:u},s)};return{Context:e,Provider:t,defaultValue:i}}function Ih(i,e){var t=rc(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var h={};return e.forEach(function(f){h[f]=d[f]}),h}),n=C.useContext(i==null?void 0:i.Context),r=n||{},o=r.listeners,s=r.getValue,a=C.useRef();a.current=t(n?s():i==null?void 0:i.defaultValue);var l=C.useState({}),c=$e(l,2),u=c[1];return Cr(function(){if(!n)return;function d(h){var f=t(h);Tp(a.current,f,!0)||u({})}return o.add(d),function(){o.delete(d)}},[n]),a.current}var Lbe=C.createContext(0);function Ebe(){return C.useContext(Lbe)}function IXe(i,e){var t=E_(i),n=function(o,s){var a=t?{ref:s}:{},l=C.useRef(0),c=C.useRef(o);return(!e||e(c.current,o))&&(l.current+=1),c.current=o,C.createElement(Lbe.Provider,{value:l.current},C.createElement(i,It({},o,a)))};return t?C.forwardRef(n):n}function q4(i,e){var t=E_(i),n=function(o,s){var a=t?{ref:s}:{};return Ebe(),C.createElement(i,It({},o,a))};return t?C.memo(C.forwardRef(n),e):C.memo(n,e)}var fd=DXe();function kXe(i,e){var t=C.useRef(0);t.current+=1;var n=C.useRef(i),r=[];Object.keys(i||{}).map(function(s){var a;(i==null?void 0:i[s])!==((a=n.current)===null||a===void 0?void 0:a[s])&&r.push(s)}),n.current=i;var o=C.useRef([]);return r.length&&(o.current=r),C.useDebugValue(t.current),C.useDebugValue(o.current.join(", ")),e&&console.log("".concat(e,":"),t.current,o.current),t.current}var TXe=C.memo(function(){var i=kXe();return C.createElement("h1",null,"Render Times: ",i)});TXe.displayName="RenderBlock";var Dbe=C.createContext({renderWithProps:!1}),NXe="RC_TABLE_KEY";function RXe(i){return i==null?[]:Array.isArray(i)?i:[i]}function X4(i){var e=[],t={};return i.forEach(function(n){for(var r=n||{},o=r.key,s=r.dataIndex,a=o||RXe(s).join("-")||NXe;t[a];)a="".concat(a,"_next");t[a]=!0,e.push(a)}),e}function PH(i){return i!=null}function MXe(i){return i&&Un(i)==="object"&&!Array.isArray(i)&&!C.isValidElement(i)}function PXe(i,e,t,n,r,o){var s=C.useContext(Dbe),a=Ebe(),l=gC(function(){if(PH(n))return[n];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Yd(i,c),d=u,h=void 0;if(r){var f=r(u,i,t);MXe(f)?(d=f.children,h=f.props,s.renderWithProps=!0):d=f}return[d,h]},[a,i,n,e,r,t],function(c,u){if(o){var d=$e(c,2),h=d[1],f=$e(u,2),g=f[1];return o(g,h)}return s.renderWithProps?!0:!Tp(c,u,!0)});return l}function AXe(i,e,t,n){var r=i+e-1;return i<=n&&r>=t}function OXe(i,e){return Ih(fd,function(t){var n=AXe(i,e||1,t.hoverStartRow,t.hoverEndRow);return[n,t.onHover]})}var FXe=function(e){var t=e.ellipsis,n=e.rowType,r=e.children,o,s=t===!0?{showTitle:!0}:t;return s&&(s.showTitle||n==="header")&&(typeof r=="string"||typeof r=="number"?o=r.toString():C.isValidElement(r)&&typeof r.props.children=="string"&&(o=r.props.children)),o};function BXe(i){var e,t,n,r,o,s,a,l,c=i.component,u=i.children,d=i.ellipsis,h=i.scope,f=i.prefixCls,g=i.className,p=i.align,m=i.record,v=i.render,_=i.dataIndex,y=i.renderIndex,S=i.shouldCellUpdate,L=i.index,E=i.rowType,D=i.colSpan,k=i.rowSpan,T=i.fixLeft,M=i.fixRight,P=i.firstFixLeft,N=i.lastFixLeft,R=i.firstFixRight,O=i.lastFixRight,B=i.appendNode,$=i.additionalProps,G=$===void 0?{}:$,U=i.isSticky,j="".concat(f,"-cell"),ie=Ih(fd,["supportSticky","allColumnsFixedLeft"]),Y=ie.supportSticky,J=ie.allColumnsFixedLeft,Q=PXe(m,_,y,u,v,S),he=$e(Q,2),ge=he[0],ye=he[1],be={},Ge=typeof T=="number"&&Y,nt=typeof M=="number"&&Y;Ge&&(be.position="sticky",be.left=T),nt&&(be.position="sticky",be.right=M);var je=(e=(t=(n=ye==null?void 0:ye.colSpan)!==null&&n!==void 0?n:G.colSpan)!==null&&t!==void 0?t:D)!==null&&e!==void 0?e:1,_e=(r=(o=(s=ye==null?void 0:ye.rowSpan)!==null&&s!==void 0?s:G.rowSpan)!==null&&o!==void 0?o:k)!==null&&r!==void 0?r:1,Ve=OXe(L,_e),Le=$e(Ve,2),Pe=Le[0],Be=Le[1],Qe=function(q){var se;m&&Be(L,L+_e-1),G==null||(se=G.onMouseEnter)===null||se===void 0||se.call(G,q)},Ye=function(q){var se;m&&Be(-1,-1),G==null||(se=G.onMouseLeave)===null||se===void 0||se.call(G,q)};if(je===0||_e===0)return null;var We=(a=G.title)!==null&&a!==void 0?a:FXe({rowType:E,ellipsis:d,children:ge}),dt=De(j,g,(l={},we(l,"".concat(j,"-fix-left"),Ge&&Y),we(l,"".concat(j,"-fix-left-first"),P&&Y),we(l,"".concat(j,"-fix-left-last"),N&&Y),we(l,"".concat(j,"-fix-left-all"),N&&J&&Y),we(l,"".concat(j,"-fix-right"),nt&&Y),we(l,"".concat(j,"-fix-right-first"),R&&Y),we(l,"".concat(j,"-fix-right-last"),O&&Y),we(l,"".concat(j,"-ellipsis"),d),we(l,"".concat(j,"-with-append"),B),we(l,"".concat(j,"-fix-sticky"),(Ge||nt)&&U&&Y),we(l,"".concat(j,"-row-hover"),!ye&&Pe),l),G.className,ye==null?void 0:ye.className),re={};p&&(re.textAlign=p);var ue=te(te(te(te({},G.style),re),be),ye==null?void 0:ye.style),de=ge;return Un(de)==="object"&&!Array.isArray(de)&&!C.isValidElement(de)&&(de=null),d&&(N||R)&&(de=C.createElement("span",{className:"".concat(j,"-content")},de)),C.createElement(c,It({},ye,G,{className:dt,style:ue,title:We,scope:h,onMouseEnter:Qe,onMouseLeave:Ye,colSpan:je!==1?je:null,rowSpan:_e!==1?_e:null}),B,de)}const Y4=C.memo(BXe);function RX(i,e,t,n,r,o){var s=t[i]||{},a=t[e]||{},l,c;s.fixed==="left"?l=n.left[r==="rtl"?e:i]:a.fixed==="right"&&(c=n.right[r==="rtl"?i:e]);var u=!1,d=!1,h=!1,f=!1,g=t[e+1],p=t[i-1],m=!(o!=null&&o.children);if(r==="rtl"){if(l!==void 0){var v=p&&p.fixed==="left";f=!v&&m}else if(c!==void 0){var _=g&&g.fixed==="right";h=!_&&m}}else if(l!==void 0){var y=g&&g.fixed==="left";u=!y&&m}else if(c!==void 0){var S=p&&p.fixed==="right";d=!S&&m}return{fixLeft:l,fixRight:c,lastFixLeft:u,firstFixRight:d,lastFixRight:h,firstFixLeft:f,isSticky:n.isSticky}}var Ibe=C.createContext({});function WXe(i){var e=i.className,t=i.index,n=i.children,r=i.colSpan,o=r===void 0?1:r,s=i.rowSpan,a=i.align,l=Ih(fd,["prefixCls","direction"]),c=l.prefixCls,u=l.direction,d=C.useContext(Ibe),h=d.scrollColumnIndex,f=d.stickyOffsets,g=d.flattenColumns,p=d.columns,m=t+o-1,v=m+1===h?o+1:o,_=RX(t,t+v-1,g,f,u,p==null?void 0:p[t]);return C.createElement(Y4,It({className:e,index:t,component:"td",prefixCls:c,record:null,dataIndex:null,align:a,colSpan:v,rowSpan:s,render:function(){return n}},_))}var $Xe=["children"];function HXe(i){var e=i.children,t=Mn(i,$Xe);return C.createElement("tr",t,e)}function Z4(i){var e=i.children;return e}Z4.Row=HXe;Z4.Cell=WXe;function VXe(i){var e=i.children,t=i.stickyOffsets,n=i.flattenColumns,r=i.columns,o=Ih(fd,"prefixCls"),s=n.length-1,a=n[s],l=C.useMemo(function(){return{stickyOffsets:t,flattenColumns:n,scrollColumnIndex:a!=null&&a.scrollbar?s:null,columns:r}},[a,n,s,t,r]);return C.createElement(Ibe.Provider,{value:l},C.createElement("tfoot",{className:"".concat(o,"-summary")},e))}const ER=q4(VXe);var kbe=Z4;function zXe(i){return null}function UXe(i){return null}function Tbe(i,e,t,n,r,o){var s=[];s.push({record:i,indent:e,index:o});var a=r(i),l=n==null?void 0:n.has(a);if(i&&Array.isArray(i[t])&&l)for(var c=0;c1?Be-1:0),Ye=1;Ye=0;a-=1){var l=e[a],c=t&&t[a],u=c&&c[RE];if(l||u||s){var d=u||{};d.columnType;var h=Mn(d,QXe);r.unshift(C.createElement("col",It({key:a,style:{width:l}},h))),s=!0}}return C.createElement("colgroup",null,r)}var JXe=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function eYe(i,e){return C.useMemo(function(){for(var t=[],n=0;n=0})},[o]),M=o[o.length-1],P={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(y,"-cell-scrollbar")}}},N=C.useMemo(function(){return E?[].concat(gt(r),[P]):r},[E,r]),R=C.useMemo(function(){return E?[].concat(gt(o),[P]):o},[E,o]),O=C.useMemo(function(){var $=l.right,G=l.left;return te(te({},l),{},{left:c==="rtl"?[].concat(gt(G.map(function(U){return U+E})),[0]):G,right:c==="rtl"?$:[].concat(gt($.map(function(U){return U+E})),[0]),isSticky:L})},[E,l,L]),B=eYe(s,a);return C.createElement("div",{style:te({overflow:"hidden"},L?{top:d,bottom:h}:{}),ref:k,className:De(t,we({},f,!!f))},C.createElement("table",{style:{tableLayout:"fixed",visibility:n||B?null:"hidden"}},(!n||!p||T)&&C.createElement(Pbe,{colWidths:B?[].concat(gt(B),[E]):[],columCount:a+1,columns:R}),m(te(te({},v),{},{stickyOffsets:O,columns:N,flattenColumns:R}))))});Abe.displayName="FixedHolder";const koe=C.memo(Abe);function Obe(i){var e=i.cells,t=i.stickyOffsets,n=i.flattenColumns,r=i.rowComponent,o=i.cellComponent,s=i.tdCellComponent,a=i.onHeaderRow,l=i.index,c=Ih(fd,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,h;a&&(h=a(e.map(function(g){return g.column}),l));var f=X4(e.map(function(g){return g.column}));return C.createElement(r,h,e.map(function(g,p){var m=g.column,v=RX(g.colStart,g.colEnd,n,t,d,m),_;return m&&m.onHeaderCell&&(_=g.column.onHeaderCell(m)),C.createElement(Y4,It({},g,{scope:m.title?g.colSpan>1?"colgroup":"col":null,ellipsis:m.ellipsis,align:m.align,component:m.title?o:s,prefixCls:u,key:f[p]},v,{additionalProps:_,rowType:"header"}))}))}Obe.displayName="HeaderRow";function tYe(i){var e=[];function t(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[l]=e[l]||[];var c=a,u=s.filter(Boolean).map(function(d){var h={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},f=1,g=d.children;return g&&g.length>0&&(f=t(g,c,l+1).reduce(function(p,m){return p+m},0),h.hasSubColumns=!0),"colSpan"in d&&(f=d.colSpan),"rowSpan"in d&&(h.rowSpan=d.rowSpan),h.colSpan=f,h.colEnd=h.colStart+f-1,e[l].push(h),c+=f,f});return u}t(i,0);for(var n=e.length,r=function(a){e[a].forEach(function(l){!("rowSpan"in l)&&!l.hasSubColumns&&(l.rowSpan=n-a)})},o=0;o0?[].concat(gt(e),gt(AH(o).map(function(s){return te({fixed:r},s)}))):[].concat(gt(e),[te(te({},t),{},{fixed:r})])},[])}function oYe(i){return i.map(function(e){var t=e.fixed,n=Mn(e,rYe),r=t;return t==="left"?r="right":t==="right"&&(r="left"),te({fixed:r},n)})}function sYe(i,e){var t=i.prefixCls,n=i.columns,r=i.children,o=i.expandable,s=i.expandedKeys,a=i.columnTitle,l=i.getRowKey,c=i.onTriggerExpand,u=i.expandIcon,d=i.rowExpandable,h=i.expandIconColumnIndex,f=i.direction,g=i.expandRowByClick,p=i.columnWidth,m=i.fixed,v=C.useMemo(function(){return n||MX(r)},[n,r]),_=C.useMemo(function(){if(o){var L,E=v.slice();if(!E.includes(Mm)){var D=h||0;D>=0&&E.splice(D,0,Mm)}var k=E.indexOf(Mm);E=E.filter(function(N,R){return N!==Mm||R===k});var T=v[k],M;(m==="left"||m)&&!h?M="left":(m==="right"||m)&&h===v.length?M="right":M=T?T.fixed:null;var P=(L={},we(L,RE,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),we(L,"title",a),we(L,"fixed",M),we(L,"className","".concat(t,"-row-expand-icon-cell")),we(L,"width",p),we(L,"render",function(R,O,B){var $=l(O,B),G=s.has($),U=d?d(O):!0,j=u({prefixCls:t,expanded:G,expandable:U,record:O,onExpand:c});return g?C.createElement("span",{onClick:function(Y){return Y.stopPropagation()}},j):j}),L);return E.map(function(N){return N===Mm?P:N})}return v.filter(function(N){return N!==Mm})},[o,v,l,s,u,f]),y=C.useMemo(function(){var L=_;return e&&(L=e(L)),L.length||(L=[{render:function(){return null}}]),L},[e,_,f]),S=C.useMemo(function(){return f==="rtl"?oYe(AH(y)):AH(y)},[y,f]);return[y,S]}function aYe(i){var e,t=i.prefixCls,n=i.record,r=i.onExpand,o=i.expanded,s=i.expandable,a="".concat(t,"-row-expand-icon");if(!s)return C.createElement("span",{className:De(a,"".concat(t,"-row-spaced"))});var l=function(u){r(n,u),u.stopPropagation()};return C.createElement("span",{className:De(a,(e={},we(e,"".concat(t,"-row-expanded"),o),we(e,"".concat(t,"-row-collapsed"),!o),e)),onClick:l})}function lYe(i,e,t){var n=[];function r(o){(o||[]).forEach(function(s,a){n.push(e(s,a)),r(s[t])})}return r(i),n}function cYe(i,e,t){var n=ZXe(i),r=n.expandIcon,o=n.expandedRowKeys,s=n.defaultExpandedRowKeys,a=n.defaultExpandAllRows,l=n.expandedRowRender,c=n.onExpand,u=n.onExpandedRowsChange,d=n.childrenColumnName,h=r||aYe,f=d||"children",g=C.useMemo(function(){return l?"row":i.expandable&&i.internalHooks===_A&&i.expandable.__PARENT_RENDER_ICON__||e.some(function(L){return L&&Un(L)==="object"&&L[f]})?"nest":!1},[!!l,e]),p=C.useState(function(){return s||(a?lYe(e,t,f):[])}),m=$e(p,2),v=m[0],_=m[1],y=C.useMemo(function(){return new Set(o||v||[])},[o,v]),S=C.useCallback(function(L){var E=t(L,e.indexOf(L)),D,k=y.has(E);k?(y.delete(E),D=gt(y)):D=[].concat(gt(y),[E]),_(D),c&&c(!k,L),u&&u(D)},[t,y,e,c,u]);return[n,g,y,h,f,S]}function uYe(i,e,t,n){var r=i.map(function(o,s){return RX(s,s,i,e,t,n==null?void 0:n[s])});return gC(function(){return r},[r],function(o,s){return!Tp(o,s)})}function Fbe(i){var e=C.useRef(i),t=C.useState({}),n=$e(t,2),r=n[1],o=C.useRef(null),s=C.useRef([]);function a(l){s.current.push(l);var c=Promise.resolve();o.current=c,c.then(function(){if(o.current===c){var u=s.current,d=e.current;s.current=[],u.forEach(function(h){e.current=h(e.current)}),o.current=null,d!==e.current&&r({})}})}return C.useEffect(function(){return function(){o.current=null}},[]),[e.current,a]}function dYe(i){var e=C.useRef(i||null),t=C.useRef();function n(){window.clearTimeout(t.current)}function r(s){e.current=s,n(),t.current=window.setTimeout(function(){e.current=null,t.current=void 0},100)}function o(){return e.current}return C.useEffect(function(){return n},[]),[r,o]}function hYe(){var i=C.useState(-1),e=$e(i,2),t=e[0],n=e[1],r=C.useState(-1),o=$e(r,2),s=o[0],a=o[1],l=C.useCallback(function(c,u){n(c),a(u)},[]);return[t,s,l]}var Noe=ea()?window:null;function fYe(i,e){var t=Un(i)==="object"?i:{},n=t.offsetHeader,r=n===void 0?0:n,o=t.offsetSummary,s=o===void 0?0:o,a=t.offsetScroll,l=a===void 0?0:a,c=t.getContainer,u=c===void 0?function(){return Noe}:c,d=u()||Noe;return C.useMemo(function(){var h=!!i;return{isSticky:h,stickyClassName:h?"".concat(e,"-sticky-holder"):"",offsetHeader:r,offsetSummary:s,offsetScroll:l,container:d}},[l,r,s,e,d])}function gYe(i,e,t){var n=C.useMemo(function(){for(var r=[],o=[],s=0,a=0,l=0;l=d&&(G=d-h),s({scrollLeft:G/d*(u+2)}),_.current.x=R.pageX},M=function(){if(o.current){var R=boe(o.current).top,O=R+o.current.offsetHeight,B=l===window?document.documentElement.scrollTop+window.innerHeight:boe(l).top+l.clientHeight;O-nA()<=B||R>=B-a?v(function($){return te(te({},$),{},{isHiddenScrollBar:!0})}):v(function($){return te(te({},$),{},{isHiddenScrollBar:!1})})}},P=function(R){v(function(O){return te(te({},O),{},{scrollLeft:R/u*d||0})})};return C.useImperativeHandle(t,function(){return{setScrollLeft:P}}),C.useEffect(function(){var N=Zg(document.body,"mouseup",D,!1),R=Zg(document.body,"mousemove",T,!1);return M(),function(){N.remove(),R.remove()}},[h,L]),C.useEffect(function(){var N=Zg(l,"scroll",M,!1),R=Zg(window,"resize",M,!1);return function(){N.remove(),R.remove()}},[l]),C.useEffect(function(){m.isHiddenScrollBar||v(function(N){var R=o.current;return R?te(te({},N),{},{scrollLeft:R.scrollLeft/R.scrollWidth*R.clientWidth}):N})},[m.isHiddenScrollBar]),u<=d||!h||m.isHiddenScrollBar?null:C.createElement("div",{style:{height:nA(),width:d,bottom:a},className:"".concat(c,"-sticky-scroll")},C.createElement("div",{onMouseDown:k,ref:f,className:De("".concat(c,"-sticky-scroll-bar"),we({},"".concat(c,"-sticky-scroll-bar-active"),L)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(m.scrollLeft,"px, 0, 0)")}}))};const mYe=C.forwardRef(pYe);var vYe=[],_Ye={},_A="rc-table-internal-hook";function bYe(){return"No Data"}function CYe(i){var e,t=te({rowKey:"key",prefixCls:"rc-table",emptyText:bYe},i),n=t.prefixCls,r=t.className,o=t.rowClassName,s=t.style,a=t.data,l=t.rowKey,c=t.scroll,u=t.tableLayout,d=t.direction,h=t.title,f=t.footer,g=t.summary,p=t.caption,m=t.id,v=t.showHeader,_=t.components,y=t.emptyText,S=t.onRow,L=t.onHeaderRow,E=t.internalHooks,D=t.transformColumns,k=t.internalRefs,T=t.sticky,M=a||vYe,P=!!M.length,N=C.useCallback(function(Jt,Zt){return Yd(_,Jt)||Zt},[_]),R=C.useMemo(function(){return typeof l=="function"?l:function(Jt){var Zt=Jt&&Jt[l];return Zt}},[l]),O=hYe(),B=$e(O,3),$=B[0],G=B[1],U=B[2],j=cYe(t,M,R),ie=$e(j,6),Y=ie[0],J=ie[1],Q=ie[2],he=ie[3],ge=ie[4],ye=ie[5],be=C.useState(0),Ge=$e(be,2),nt=Ge[0],je=Ge[1],_e=sYe(te(te(te({},t),Y),{},{expandable:!!Y.expandedRowRender,columnTitle:Y.columnTitle,expandedKeys:Q,getRowKey:R,onTriggerExpand:ye,expandIcon:he,expandIconColumnIndex:Y.expandIconColumnIndex,direction:d}),E===_A?D:null),Ve=$e(_e,2),Le=Ve[0],Pe=Ve[1],Be=C.useMemo(function(){return{columns:Le,flattenColumns:Pe}},[Le,Pe]),Qe=C.useRef(),Ye=C.useRef(),We=C.useRef(),dt=C.useRef(),re=C.useRef(),ue=C.useState(!1),de=$e(ue,2),z=de[0],q=de[1],se=C.useState(!1),ne=$e(se,2),pe=ne[0],ke=ne[1],oe=Fbe(new Map),ce=$e(oe,2),fe=ce[0],Ie=ce[1],Te=X4(Pe),He=Te.map(function(Jt){return fe.get(Jt)}),Me=C.useMemo(function(){return He},[He.join("_")]),bt=gYe(Me,Pe.length,d),rt=c&&PH(c.y),Ht=c&&PH(c.x)||!!Y.fixed,Ue=Ht&&Pe.some(function(Jt){var Zt=Jt.fixed;return Zt}),Ct=C.useRef(),Dt=fYe(T,n),St=Dt.isSticky,Kt=Dt.offsetHeader,_n=Dt.offsetSummary,zt=Dt.offsetScroll,Yt=Dt.stickyClassName,at=Dt.container,ut=C.useMemo(function(){return g==null?void 0:g(M)},[g,M]),ht=(rt||St)&&C.isValidElement(ut)&&ut.type===Z4&&ut.props.fixed,Lt,At,ln;rt&&(At={overflowY:"scroll",maxHeight:c.y}),Ht&&(Lt={overflowX:"auto"},rt||(At={overflowY:"hidden"}),ln={width:(c==null?void 0:c.x)===!0?"auto":c==null?void 0:c.x,minWidth:"100%"});var Si=C.useCallback(function(Jt,Zt){qk(Qe.current)&&Ie(function(oi){if(oi.get(Jt)!==Zt){var Wi=new Map(oi);return Wi.set(Jt,Zt),Wi}return oi})},[]),Xi=dYe(null),Ir=$e(Xi,2),En=Ir[0],fi=Ir[1];function Ur(Jt,Zt){Zt&&(typeof Zt=="function"?Zt(Jt):Zt.scrollLeft!==Jt&&(Zt.scrollLeft=Jt,Zt.scrollLeft!==Jt&&setTimeout(function(){Zt.scrollLeft=Jt},0)))}var go=rc(function(Jt){var Zt=Jt.currentTarget,oi=Jt.scrollLeft,Wi=d==="rtl",So=typeof oi=="number"?oi:Zt.scrollLeft,Hs=Zt||_Ye;if(!fi()||fi()===Hs){var gl;En(Hs),Ur(So,Ye.current),Ur(So,We.current),Ur(So,re.current),Ur(So,(gl=Ct.current)===null||gl===void 0?void 0:gl.setScrollLeft)}if(Zt){var Vs=Zt.scrollWidth,kc=Zt.clientWidth;if(Vs===kc){q(!1),ke(!1);return}Wi?(q(-So0)):(q(So>0),ke(So{r(o,c),c.stopPropagation()},className:De(l,{[`${l}-spaced`]:!a,[`${l}-expanded`]:a&&s,[`${l}-collapsed`]:a&&!s}),"aria-label":s?i.collapse:i.expand,"aria-expanded":s})}}const xYe=Bbe((i,e)=>{const{_renderTimes:t}=i,{_renderTimes:n}=e;return t!==n});function Rb(i,e){return"key"in i&&i.key!==void 0&&i.key!==null?i.key:i.dataIndex?Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex:e}function sT(i,e){return e?`${e}-${i}`:`${i}`}function J4(i,e){return typeof i=="function"?i(e):i}function LYe(i,e){const t=J4(i,e);return Object.prototype.toString.call(t)==="[object Object]"?"":t}function Wbe(i){if(i==null)throw new TypeError("Cannot destructure "+i)}var EYe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],$be=function(e,t){var n=e.className,r=e.style,o=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Mn(e,EYe),f=C.useState(!0),g=$e(f,2),p=g[0],m=g[1],v=C.useContext(wX),_=v.prefixCls,y=C.useRef(!1),S=function(){y.current||c(),y.current=!0};return C.useEffect(function(){s&&a==="hide"&&p&&m(!1)},[s]),C.useEffect(function(){return s&&l(),function(){s&&S()}},[]),s?C.createElement(hd,It({ref:t,visible:p},o,{motionAppear:a==="show",onAppearEnd:S,onLeaveEnd:S}),function(L,E){var D=L.className,k=L.style;return C.createElement("div",{ref:E,className:De("".concat(_,"-treenode-motion"),D),style:k},s.map(function(T){var M=It({},(Wbe(T.data),T.data)),P=T.title,N=T.key,R=T.isStart,O=T.isEnd;delete M.children;var B=TE(N,d);return C.createElement(Ww,It({},M,B,{title:P,active:u,data:T.data,key:N,isStart:R,isEnd:O}))}))}):C.createElement(Ww,It({domRef:t,className:n,style:r},h,{active:u}))};$be.displayName="MotionTreeNode";var DYe=C.forwardRef($be);function IYe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function r(o,s){var a=new Map;o.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var Vbe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var r=i.expandedKeys,o=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,m=i.height,v=i.itemHeight,_=i.virtual,y=i.focusable,S=i.activeItem,L=i.focused,E=i.tabIndex,D=i.onKeyDown,k=i.onFocus,T=i.onBlur,M=i.onActiveChange,P=i.onListChangeStart,N=i.onListChangeEnd,R=Mn(i,kYe),O=C.useRef(null),B=C.useRef(null);C.useImperativeHandle(e,function(){return{scrollTo:function(ue){O.current.scrollTo(ue)},getIndentWidth:function(){return B.current.offsetWidth}}});var $=C.useState(r),G=$e($,2),U=G[0],j=G[1],ie=C.useState(n),Y=$e(ie,2),J=Y[0],Q=Y[1],he=C.useState(n),ge=$e(he,2),ye=ge[0],be=ge[1],Ge=C.useState([]),nt=$e(Ge,2),je=nt[0],_e=nt[1],Ve=C.useState(null),Le=$e(Ve,2),Pe=Le[0],Be=Le[1],Qe=C.useRef(n);Qe.current=n;function Ye(){var re=Qe.current;Q(re),be(re),_e([]),Be(null),N()}C.useEffect(function(){j(r);var re=IYe(U,r);if(re.key!==null)if(re.add){var ue=J.findIndex(function(pe){var ke=pe.key;return ke===re.key}),de=Ooe(Moe(J,n,re.key),_,m,v),z=J.slice();z.splice(ue+1,0,Aoe),be(z),_e(de),Be("show")}else{var q=n.findIndex(function(pe){var ke=pe.key;return ke===re.key}),se=Ooe(Moe(n,J,re.key),_,m,v),ne=n.slice();ne.splice(q+1,0,Aoe),be(ne),_e(se),Be("hide")}else J!==n&&(Q(n),be(n))},[r,n]),C.useEffect(function(){h||Ye()},[h]);var We=p?ye:n,dt={expandedKeys:r,selectedKeys:o,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return C.createElement(C.Fragment,null,L&&S&&C.createElement("span",{style:Poe,"aria-live":"assertive"},NYe(S)),C.createElement("div",null,C.createElement("input",{style:Poe,disabled:y===!1||d,tabIndex:y!==!1?E:null,onKeyDown:D,onFocus:k,onBlur:T,value:"",onChange:TYe,"aria-label":"for screen reader"})),C.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},C.createElement("div",{className:"".concat(t,"-indent")},C.createElement("div",{ref:B,className:"".concat(t,"-indent-unit")}))),C.createElement(Jq,It({},R,{data:We,itemKey:Foe,height:m,fullHeight:!1,virtual:_,itemHeight:v,prefixCls:"".concat(t,"-list"),ref:O,onVisibleChange:function(ue,de){var z=new Set(ue),q=de.filter(function(se){return!z.has(se)});q.some(function(se){return Foe(se)===Mb})&&Ye()}}),function(re){var ue=re.pos,de=It({},(Wbe(re.data),re.data)),z=re.title,q=re.key,se=re.isStart,ne=re.isEnd,pe=rT(q,ue);delete de.key,delete de.children;var ke=TE(pe,dt);return C.createElement(DYe,It({},de,ke,{title:z,active:!!S&&q===S.key,pos:ue,data:re.data,isStart:se,isEnd:ne,motion:p,motionNodes:q===Mb?je:null,motionType:Pe,onMotionStart:P,onMotionEnd:Ye,treeNodeRequiredProps:dt,onMouseMove:function(){M(null)}}))}))});Vbe.displayName="NodeList";function RYe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-t*n;break;case 1:r.bottom=0,r.left=-t*n;break;case 0:r.bottom=0,r.left=n;break}return C.createElement("div",{style:r})}var MYe=10,PX=function(i){Sh(t,i);var e=xh(t);function t(){var n;bs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,m=d.dropAllowed;if(m){var v=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=te(te({},TE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:n.state.keyEntities[g].node}),y=h.indexOf(g)!==-1;uo(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var S=SX(p),L={event:a,node:as(_),dragNode:n.dragNode?as(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(S[S.length-1])};u||v==null||v(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(v){return v.key===f})[0],m=as(te(te({},TE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?qh(u,f):Dg(u,f)),n.onNodeExpand(a,m)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,m=l.selected,v=l[h.key],_=!m;_?p?c=Dg(c,v):c=[v]:c=qh(c,v);var y=c.map(function(S){var L=d[S];return L?L.node:null}).filter(function(S){return S});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,m=g.onCheck,v=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var S=c?Dg(h,v):qh(h,v),L=qh(f,v);_={checked:S,halfChecked:L},y.checkedNodes=S.map(function(P){return d[P]}).filter(function(P){return P}).map(function(P){return P.node}),n.setUncontrolledState({checkedKeys:S})}else{var E=zy([].concat(gt(h),[v]),!0,d),D=E.checkedKeys,k=E.halfCheckedKeys;if(!c){var T=new Set(D);T.delete(v);var M=zy(Array.from(T),{checked:!1,halfCheckedKeys:k},d);D=M.checkedKeys,k=M.halfCheckedKeys}_=D,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=k,D.forEach(function(P){var N=d[P];if(N){var R=N.node,O=N.pos;y.checkedNodes.push(R),y.checkedNodesPositions.push({node:R,pos:O})}}),n.setUncontrolledState({checkedKeys:D},!1,{halfCheckedKeys:k})}m==null||m(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,m=p===void 0?[]:p,v=n.props,_=v.loadData,y=v.onLoad;if(!_||g.indexOf(l)!==-1||m.indexOf(l)!==-1)return null;var S=_(a);return S.then(function(){var L=n.state.loadedKeys,E=Dg(L,l);y==null||y(E,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:E}),n.setState(function(D){return{loadingKeys:qh(D.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(D){return{loadingKeys:qh(D.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=MYe){var E=n.state.loadedKeys;uo(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Dg(E,l)}),u()}d(L)}),{loadingKeys:Dg(m,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(te(te({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return Cs(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props.activeKey;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r,o=this.state,s=o.focused,a=o.flattenNodes,l=o.keyEntities,c=o.draggingNodeKey,u=o.activeKey,d=o.dropLevelOffset,h=o.dropContainerKey,f=o.dropTargetKey,g=o.dropPosition,p=o.dragOverNodeKey,m=o.indent,v=this.props,_=v.prefixCls,y=v.className,S=v.style,L=v.showLine,E=v.focusable,D=v.tabIndex,k=D===void 0?0:D,T=v.selectable,M=v.showIcon,P=v.icon,N=v.switcherIcon,R=v.draggable,O=v.checkable,B=v.checkStrictly,$=v.disabled,G=v.motion,U=v.loadData,j=v.filterTreeNode,ie=v.height,Y=v.itemHeight,J=v.virtual,Q=v.titleRender,he=v.dropIndicatorRender,ge=v.onContextMenu,ye=v.onScroll,be=v.direction,Ge=v.rootClassName,nt=v.rootStyle,je=Mp(this.props,{aria:!0,data:!0}),_e;return R&&(Un(R)==="object"?_e=R:typeof R=="function"?_e={nodeDraggable:R}:_e={}),C.createElement(wX.Provider,{value:{prefixCls:_,selectable:T,showIcon:M,icon:P,switcherIcon:N,draggable:_e,draggingNodeKey:c,checkable:O,checkStrictly:B,disabled:$,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:m,direction:be,dropIndicatorRender:he,loadData:U,filterTreeNode:j,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},C.createElement("div",{role:"tree",className:De(_,y,Ge,(r={},we(r,"".concat(_,"-show-line"),L),we(r,"".concat(_,"-focused"),s),we(r,"".concat(_,"-active-focused"),u!==null),r)),style:nt},C.createElement(Vbe,It({ref:this.listRef,prefixCls:_,style:S,data:a,disabled:$,selectable:T,checkable:!!O,motion:G,dragging:c!==null,height:ie,itemHeight:Y,virtual:J,focusable:E,focused:s,tabIndex:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ge,onScroll:ye},this.getTreeNodeRequiredProps(),je))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a={prevProps:r};function l(E){return!s&&E in r||s&&s[E]!==r[E]}var c,u=o.fieldNames;if(l("fieldNames")&&(u=fA(r.fieldNames),a.fieldNames=u),l("treeData")?c=r.treeData:l("children")&&(uo(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=tbe(r.children)),c){a.treeData=c;var d=xX(c,{fieldNames:u});a.keyEntities=te(we({},Mb,Hbe),d.keyEntities)}var h=a.keyEntities||o.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=r.autoExpandParent||!s&&r.defaultExpandParent?IH(r.expandedKeys,h):r.expandedKeys;else if(!s&&r.defaultExpandAll){var f=te({},h);delete f[Mb],a.expandedKeys=Object.keys(f).map(function(E){return f[E].key})}else!s&&r.defaultExpandedKeys&&(a.expandedKeys=r.autoExpandParent||r.defaultExpandParent?IH(r.defaultExpandedKeys,h):r.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=$6(c||o.treeData,a.expandedKeys||o.expandedKeys,u);a.flattenNodes=g}if(r.selectable&&(l("selectedKeys")?a.selectedKeys=voe(r.selectedKeys,r):!s&&r.defaultSelectedKeys&&(a.selectedKeys=voe(r.defaultSelectedKeys,r))),r.checkable){var p;if(l("checkedKeys")?p=W6(r.checkedKeys)||{}:!s&&r.defaultCheckedKeys?p=W6(r.defaultCheckedKeys)||{}:c&&(p=W6(r.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),p){var m=p,v=m.checkedKeys,_=v===void 0?[]:v,y=m.halfCheckedKeys,S=y===void 0?[]:y;if(!r.checkStrictly){var L=zy(_,!0,h);_=L.checkedKeys,S=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=S}}return l("loadedKeys")&&(a.loadedKeys=r.loadedKeys),a}}]),t}(C.Component);PX.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:RYe,allowDrop:function(){return!0},expandAction:!1};PX.TreeNode=Ww;const PYe=new vi("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),AYe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),OYe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),FYe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o}=e,s=(o-e.fontSizeLG)/2,a=e.paddingXS;return{[t]:Object.assign(Object.assign({},Vr(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},Np(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:PYe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${r}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:Object.assign({},Np(e)),[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${t}-draggable-icon`]:{width:o,lineHeight:`${o}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:o}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},AYe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:o,margin:0,lineHeight:`${o}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:o/2*.8,height:o/2,borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:a,marginBlockStart:s},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:o,margin:0,padding:`0 ${e.paddingXS/2}px`,color:"inherit",lineHeight:`${o}px`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:e.controlItemBgHover},[`&${t}-node-selected`]:{backgroundColor:e.controlItemBgActive},[`${t}-iconEle`]:{display:"inline-block",width:o,height:o,lineHeight:`${o}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${o}px`,userSelect:"none"},OYe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${o/2}px !important`}}}}})}},BYe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i.colorTextLightSolid,background:"transparent"}},"&-selected":{[` + `]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,color:i.colorText,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:i.borderRadius,cursor:"pointer",transition:`all ${i.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:i.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:i.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:"none",transition:`border ${i.motionDurationMid}`},[`&:focus-visible ${e}-item-link`]:Object.assign({},Np(i)),[`&:hover ${e}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:i.paginationSlashMarginInlineEnd,marginInlineStart:i.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:i.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:i.controlHeight,marginInlineStart:i.marginXS,lineHeight:`${i.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},iT(i)),{width:i.controlHeightLG*1.25,height:i.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:i.marginXS,marginInlineEnd:i.marginXS})}}}},Sqe=i=>{const{componentCls:e}=i;return{[`${e}-item`]:Object.assign(Object.assign({display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,marginInlineEnd:i.marginXS,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${i.paginationItemPaddingInline}px`,color:i.colorText,transition:"none","&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${i.motionDurationMid}`,backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}}},zD(i)),{"&-active":{fontWeight:i.paginationFontWeightActive,backgroundColor:i.paginationItemBgActive,borderColor:i.colorPrimary,a:{color:i.colorPrimary},"&:hover":{borderColor:i.colorPrimaryHover},"&:hover a":{color:i.colorPrimaryHover}}})}},xqe=i=>{const{componentCls:e}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vr(i)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:i.paginationItemSize,marginInlineEnd:i.marginXS,lineHeight:`${i.paginationItemSize-2}px`,verticalAlign:"middle"}}),Sqe(i)),wqe(i)),yqe(i)),Cqe(i)),bqe(i)),{[`@media only screen and (max-width: ${i.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${i.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${i.componentCls}-rtl`]:{direction:"rtl"}}},Lqe=i=>{const{componentCls:e}=i;return{[`${e}${e}-disabled`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:i.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:i.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,a:{color:i.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:i.paginationItemDisabledBgActive}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,color:i.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder}}},[e]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:i.colorPrimaryHover,backgroundColor:i.paginationItemBg},[`${e}-item-link`]:{backgroundColor:i.paginationItemLinkBg,borderColor:i.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,color:i.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:i.colorBorder,color:i.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:i.paginationItemBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,a:{color:i.colorPrimary}},"&-active":{borderColor:i.colorPrimary}}}}},Eqe=yo("Pagination",i=>{const e=Bi(i,{paginationItemSize:i.controlHeight,paginationFontFamily:i.fontFamily,paginationItemBg:i.colorBgContainer,paginationItemBgActive:i.colorBgContainer,paginationFontWeightActive:i.fontWeightStrong,paginationItemSizeSM:i.controlHeightSM,paginationItemInputBg:i.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:i.controlItemBgActiveDisabled,paginationItemDisabledColorActive:i.colorTextDisabled,paginationItemLinkBg:i.colorBgContainer,inputOutlineOffset:"0 0",paginationMiniOptionsMarginInlineStart:i.marginXXS/2,paginationMiniQuickJumperInputWidth:i.controlHeightLG*1.1,paginationItemPaddingInline:i.marginXXS*1.5,paginationEllipsisLetterSpacing:i.marginXXS/2,paginationSlashMarginInlineStart:i.marginXXS,paginationSlashMarginInlineEnd:i.marginSM,paginationEllipsisTextIndent:"0.13em"},CX(i));return[xqe(e),i.wireframe&&Lqe(e)]});var Dqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,selectPrefixCls:t,className:n,rootClassName:r,size:o,locale:s,selectComponentClass:a,responsive:l,showSizeChanger:c}=i,u=Dqe(i,["prefixCls","selectPrefixCls","className","rootClassName","size","locale","selectComponentClass","responsive","showSizeChanger"]);const{xs:d}=O4(l),{getPrefixCls:h,direction:f,pagination:g={}}=C.useContext(Pn),p=h("pagination",e),[m,v]=Eqe(p),_=c??g.showSizeChanger,y=C.useMemo(()=>{const T=C.createElement("span",{className:`${p}-item-ellipsis`},"•••"),M=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(R$,null):C.createElement(Die,null)),P=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(Die,null):C.createElement(R$,null)),N=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(Eie,{className:`${p}-item-link-icon`}):C.createElement(Lie,{className:`${p}-item-link-icon`}),T)),R=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(Lie,{className:`${p}-item-link-icon`}):C.createElement(Eie,{className:`${p}-item-link-icon`}),T));return{prevIcon:M,nextIcon:P,jumpPrevIcon:N,jumpNextIcon:R}},[f,p]),[S]=jk("Pagination",kve),L=Object.assign(Object.assign({},S),s),E=o==="small"||!!(d&&!o&&l),D=h("select",t),k=De({[`${p}-mini`]:E,[`${p}-rtl`]:f==="rtl"},n,r,v);return m(C.createElement(pbe,Object.assign({},y,u,{prefixCls:p,selectPrefixCls:D,className:k,selectComponentClass:a||(E?mbe:vbe),locale:L,showSizeChanger:_})))},kX=Iqe,kqe=new vi("antSpinMove",{to:{opacity:1}}),Tqe=new vi("antRotate",{to:{transform:"rotate(405deg)"}}),Nqe=i=>({[`${i.componentCls}`]:Object.assign(Object.assign({},Vr(i)),{position:"absolute",display:"none",color:i.colorPrimary,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${i.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:i.contentHeight,[`${i.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-i.spinDotSize/2},[`${i.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(i.spinDotSize-i.fontSize)/2+2,textShadow:`0 1px 2px ${i.colorBgContainer}`},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSize/2)-10},"&-sm":{[`${i.componentCls}-dot`]:{margin:-i.spinDotSizeSM/2},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeSM-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeSM/2)-10}},"&-lg":{[`${i.componentCls}-dot`]:{margin:-(i.spinDotSizeLG/2)},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeLG-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeLG/2)-10}}},[`${i.componentCls}-container`]:{position:"relative",transition:`opacity ${i.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:i.colorBgContainer,opacity:0,transition:`all ${i.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${i.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:i.spinDotDefault},[`${i.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:i.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(i.spinDotSize-i.marginXXS/2)/2,height:(i.spinDotSize-i.marginXXS/2)/2,backgroundColor:i.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:kqe,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Tqe,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeSM,i:{width:(i.spinDotSizeSM-i.marginXXS/2)/2,height:(i.spinDotSizeSM-i.marginXXS/2)/2}},[`&-lg ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeLG,i:{width:(i.spinDotSizeLG-i.marginXXS)/2,height:(i.spinDotSizeLG-i.marginXXS)/2}},[`&${i.componentCls}-show-text ${i.componentCls}-text`]:{display:"block"}})}),Rqe=yo("Spin",i=>{const e=Bi(i,{spinDotDefault:i.colorTextDescription,spinDotSize:i.controlHeightLG/2,spinDotSizeSM:i.controlHeightLG*.35,spinDotSizeLG:i.controlHeight});return[Nqe(e)]},{contentHeight:400});var Mqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{spinPrefixCls:e,spinning:t=!0,delay:n=0,className:r,rootClassName:o,size:s="default",tip:a,wrapperClassName:l,style:c,children:u,hashId:d}=i,h=Mqe(i,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[f,g]=C.useState(()=>t&&!Aqe(t,n));C.useEffect(()=>{if(t){const L=zKe(n,()=>{g(!0)});return L(),()=>{var E;(E=L==null?void 0:L.cancel)===null||E===void 0||E.call(L)}}g(!1)},[n,t]);const p=C.useMemo(()=>typeof u<"u",[u]),{direction:m}=C.useContext(Pn),v=De(e,{[`${e}-sm`]:s==="small",[`${e}-lg`]:s==="large",[`${e}-spinning`]:f,[`${e}-show-text`]:!!a,[`${e}-rtl`]:m==="rtl"},r,o,d),_=De(`${e}-container`,{[`${e}-blur`]:f}),y=cl(h,["indicator","prefixCls"]),S=C.createElement("div",Object.assign({},y,{style:c,className:v,"aria-live":"polite","aria-busy":f}),Pqe(e,i),a?C.createElement("div",{className:`${e}-text`},a):null);return p?C.createElement("div",Object.assign({},y,{className:De(`${e}-nested-loading`,l,d)}),f&&C.createElement("div",{key:"loading"},S),C.createElement("div",{className:_,key:"container"},u)):S},_be=i=>{const{prefixCls:e}=i,{getPrefixCls:t}=C.useContext(Pn),n=t("spin",e),[r,o]=Rqe(n),s=Object.assign(Object.assign({},i),{spinPrefixCls:n,hashId:o});return r(C.createElement(Oqe,Object.assign({},s)))};_be.setDefaultIndicator=i=>{EM=i};const bbe=_be;function Cbe(){const i=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=t[n];r!==void 0&&(i[n]=r)})}return i}var ybe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,className:t,avatar:n,title:r,description:o}=i,s=ybe(i,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:a}=C.useContext(Pn),l=a("list",e),c=De(`${l}-item-meta`,t),u=qe.createElement("div",{className:`${l}-item-meta-content`},r&&qe.createElement("h4",{className:`${l}-item-meta-title`},r),o&&qe.createElement("div",{className:`${l}-item-meta-description`},o));return qe.createElement("div",Object.assign({},s,{className:c}),n&&qe.createElement("div",{className:`${l}-item-meta-avatar`},n),(r||o)&&u)},Bqe=(i,e)=>{var{prefixCls:t,children:n,actions:r,extra:o,className:s,colStyle:a}=i,l=ybe(i,["prefixCls","children","actions","extra","className","colStyle"]);const{grid:c,itemLayout:u}=C.useContext(TX),{getPrefixCls:d}=C.useContext(Pn),h=()=>{let _;return C.Children.forEach(n,y=>{typeof y=="string"&&(_=!0)}),_&&C.Children.count(n)>1},f=()=>u==="vertical"?!!o:!h(),g=d("list",t),p=r&&r.length>0&&qe.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((_,y)=>qe.createElement("li",{key:`${g}-item-action-${y}`},_,y!==r.length-1&&qe.createElement("em",{className:`${g}-item-action-split`})))),m=c?"div":"li",v=qe.createElement(m,Object.assign({},l,c?{}:{ref:e},{className:De(`${g}-item`,{[`${g}-item-no-flex`]:!f()},s)}),u==="vertical"&&o?[qe.createElement("div",{className:`${g}-item-main`,key:"content"},n,p),qe.createElement("div",{className:`${g}-item-extra`,key:"extra"},o)]:[n,p,ta(o,{key:"extra"})]);return c?qe.createElement(xGe,{ref:e,flex:1,style:a},v):v},wbe=C.forwardRef(Bqe);wbe.Meta=Fqe;const Wqe=wbe,$qe=i=>{const{listBorderedCls:e,componentCls:t,paddingLG:n,margin:r,padding:o,listItemPaddingSM:s,marginLG:a,borderRadiusLG:l}=i;return{[`${e}`]:{border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:l,[`${t}-header,${t}-footer,${t}-item`]:{paddingInline:n},[`${t}-pagination`]:{margin:`${r}px ${a}px`}},[`${e}${t}-sm`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:s}},[`${e}${t}-lg`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:`${o}px ${n}px`}}}},Hqe=i=>{const{componentCls:e,screenSM:t,screenMD:n,marginLG:r,marginSM:o,margin:s}=i;return{[`@media screen and (max-width:${n})`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${t})`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:i.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${s}px`}}}}}},Vqe=i=>{const{componentCls:e,antCls:t,controlHeight:n,minHeight:r,paddingSM:o,marginLG:s,padding:a,listItemPadding:l,colorPrimary:c,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:h,margin:f,colorText:g,colorTextDescription:p,motionDurationSlow:m,lineWidth:v}=i,_={};return["start","center","end"].forEach(y=>{_[`&-align-${y}`]={textAlign:y}}),{[`${e}`]:Object.assign(Object.assign({},Vr(i)),{position:"relative","*":{outline:"none"},[`${e}-header, ${e}-footer`]:{background:"transparent",paddingBlock:o},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:s},_),{[`${t}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:a},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${i.marginXXS}px 0`,color:g,fontSize:i.fontSize,lineHeight:i.lineHeight,"> a":{color:g,transition:`all ${m}`,["&:hover"]:{color:c}}},[`${e}-item-meta-description`]:{color:p,fontSize:i.fontSize,lineHeight:i.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:i.marginXXL,padding:0,fontSize:0,listStyle:"none",["& > li"]:{position:"relative",display:"inline-block",padding:`0 ${h}px`,color:p,fontSize:i.fontSize,lineHeight:i.lineHeight,textAlign:"center",["&:first-child"]:{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:v,height:Math.ceil(i.fontSize*i.lineHeight)-i.marginXXS*2,transform:"translateY(-50%)",backgroundColor:i.colorSplit}}},[`${e}-empty`]:{padding:`${a}px 0`,color:p,fontSize:i.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:a,color:i.colorTextDisabled,fontSize:i.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${t}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:f,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:s},[`${e}-item-meta`]:{marginBlockEnd:a,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:o,color:g,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:a,marginInlineStart:"auto","> li":{padding:`0 ${a}px`,["&:first-child"]:{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`,["&:last-child"]:{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:n},[`${e}-split${e}-something-after-last-item ${t}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},zqe=yo("List",i=>{const e=Bi(i,{listBorderedCls:`${i.componentCls}-bordered`,minHeight:i.controlHeightLG,listItemPadding:`${i.paddingContentVertical}px 0`,listItemPaddingSM:`${i.paddingContentVerticalSM}px ${i.paddingContentHorizontal}px`,listItemPaddingLG:`${i.paddingContentVerticalLG}px ${i.paddingContentHorizontalLG}px`});return[Vqe(e),$qe(e),Hqe(e)]},{contentWidth:220});var Uqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r(We,dt)=>{D(We),T(dt),t&&t[Ye]&&t[Ye](We,dt)},B=O("onChange"),$=O("onShowSizeChange"),G=(Ye,We)=>{if(!_)return null;let dt;return typeof v=="function"?dt=v(Ye):v?dt=Ye[v]:dt=Ye.key,dt||(dt=`list-item-${We}`),C.createElement(C.Fragment,{key:dt},_(Ye,We))},U=()=>!!(u||t||p),j=M("list",n),[ie,Y]=zqe(j);let J=m;typeof J=="boolean"&&(J={spinning:J});const Q=J&&J.spinning;let he="";switch(f){case"large":he="lg";break;case"small":he="sm";break}const ge=De(j,{[`${j}-vertical`]:c==="vertical",[`${j}-${he}`]:he,[`${j}-split`]:o,[`${j}-bordered`]:r,[`${j}-loading`]:Q,[`${j}-grid`]:!!d,[`${j}-something-after-last-item`]:U(),[`${j}-rtl`]:N==="rtl"},s,a,Y),ye=Cbe(R,{total:h.length,current:E,pageSize:k},t||{}),be=Math.ceil(ye.total/ye.pageSize);ye.current>be&&(ye.current=be);const Ge=t?C.createElement("div",{className:De(`${j}-pagination`,`${j}-pagination-align-${(e=ye==null?void 0:ye.align)!==null&&e!==void 0?e:"end"}`)},C.createElement(kX,Object.assign({},ye,{onChange:B,onShowSizeChange:$}))):null;let nt=gt(h);t&&h.length>(ye.current-1)*ye.pageSize&&(nt=gt(h).splice((ye.current-1)*ye.pageSize,ye.pageSize));const je=Object.keys(d||{}).some(Ye=>["xs","sm","md","lg","xl","xxl"].includes(Ye)),_e=O4(je),Ve=C.useMemo(()=>{for(let Ye=0;Ye{if(!d)return;const Ye=Ve&&d[Ve]?d[Ve]:d.column;if(Ye)return{width:`${100/Ye}%`,maxWidth:`${100/Ye}%`}},[d==null?void 0:d.column,Ve]);let Pe=Q&&C.createElement("div",{style:{minHeight:53}});if(nt.length>0){const Ye=nt.map((We,dt)=>G(We,dt));Pe=d?C.createElement(DGe,{gutter:d.gutter},C.Children.map(Ye,We=>C.createElement("div",{key:We==null?void 0:We.key,style:Le},We))):C.createElement("ul",{className:`${j}-items`},Ye)}else!l&&!Q&&(Pe=C.createElement("div",{className:`${j}-empty-text`},y&&y.emptyText||(P==null?void 0:P("List"))||C.createElement(nX,{componentName:"List"})));const Be=ye.position||"bottom",Qe=C.useMemo(()=>({grid:d,itemLayout:c}),[JSON.stringify(d),c]);return ie(C.createElement(TX.Provider,{value:Qe},C.createElement("div",Object.assign({className:ge},S),(Be==="top"||Be==="both")&&Ge,g&&C.createElement("div",{className:`${j}-header`},g),C.createElement(bbe,Object.assign({},J),Pe,l),p&&C.createElement("div",{className:`${j}-footer`},p),u||(Be==="bottom"||Be==="both")&&Ge)))}DM.Item=Wqe;let Wu=null,K0=i=>i(),XD=[],pA={};function jqe(){const{prefixCls:i,getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=pA,s=i??Fq().getPrefixCls("message"),a=(e==null?void 0:e())||document.body;return{prefixCls:s,container:a,duration:t,rtl:n,maxCount:r,top:o}}const Kqe=C.forwardRef((i,e)=>{const t=()=>{const{prefixCls:d,container:h,maxCount:f,duration:g,rtl:p,top:m}=jqe();return{prefixCls:d,getContainer:()=>h,maxCount:f,duration:g,rtl:p,top:m}},[n,r]=C.useState(t),[o,s]=e_e(n),a=Fq(),l=a.getRootPrefixCls(),c=a.getIconPrefixCls(),u=()=>{r(t)};return C.useEffect(u,[]),C.useImperativeHandle(e,()=>{const d=Object.assign({},o);return Object.keys(d).forEach(h=>{d[h]=function(){return u(),o[h].apply(o,arguments)}}),{instance:d,sync:u}}),C.createElement(I4,{prefixCls:l,iconPrefixCls:c},s)});function K4(){if(!Wu){const i=document.createDocumentFragment(),e={fragment:i};Wu=e,K0(()=>{Hq(C.createElement(Kqe,{ref:t=>{const{instance:n,sync:r}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=r,K4())})}}),i)});return}Wu.instance&&(XD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{K0(()=>{const n=Wu.instance.open(Object.assign(Object.assign({},pA),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":K0(()=>{Wu==null||Wu.instance.destroy(i.key)});break;default:K0(()=>{var n;const r=(n=Wu.instance)[e].apply(n,gt(i.args));r==null||r.then(i.resolve),i.setCloseFn(r)})}}),XD=[])}function Gqe(i){pA=Object.assign(Object.assign({},pA),i),K0(()=>{var e;(e=Wu==null?void 0:Wu.sync)===null||e===void 0||e.call(Wu)})}function qqe(i){const e=$q(t=>{let n;const r={type:"open",config:i,resolve:t,setCloseFn:o=>{n=o}};return XD.push(r),()=>{n?K0(()=>{n()}):r.skipped=!0}});return K4(),e}function Xqe(i,e){const t=$q(n=>{let r;const o={type:i,args:e,resolve:n,setCloseFn:s=>{r=s}};return XD.push(o),()=>{r?K0(()=>{r()}):o.skipped=!0}});return K4(),t}function Yqe(i){XD.push({type:"destroy",key:i}),K4()}const Zqe=["success","info","warning","error","loading"],Qqe={open:qqe,destroy:Yqe,config:Gqe,useMessage:aWe,_InternalPanelDoNotUseOrYouWillBeFired:nWe},Sbe=Qqe;Zqe.forEach(i=>{Sbe[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n10&&arguments[10]!==void 0?arguments[10]:0,h=n/100*360*((360-s)/360),f=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],g=(100-r)/100*t;return c==="round"&&r!==100&&(g+=u/2,g>=t&&(g=t-.01)),{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+d,transform:"rotate(".concat(o+h+f,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},NX=function(e){var t=e.id,n=e.prefixCls,r=e.steps,o=e.strokeWidth,s=e.trailWidth,a=e.gapDegree,l=a===void 0?0:a,c=e.gapPosition,u=e.trailColor,d=e.strokeLinecap,h=e.style,f=e.className,g=e.strokeColor,p=e.percent,m=Mn(e,rXe),v=iXe(t),_="".concat(v,"-gradient"),y=Xx/2-o/2,S=Math.PI*2*y,L=l>0?90+l/2:-90,E=S*((360-l)/360),D=Un(r)==="object"?r:{count:r,space:2},k=D.count,T=D.space,M=G6(S,E,0,100,L,l,c,u,d,o),P=Doe(p),N=Doe(g),R=N.find(function(G){return G&&Un(G)==="object"}),O=eXe(),B=function(){var U=0;return P.map(function(j,ie){var Y=N[ie]||N[N.length-1],J=Y&&Un(Y)==="object"?"url(#".concat(_,")"):void 0,Q=G6(S,E,U,j,L,l,c,Y,d,o);return U+=j,C.createElement("circle",{key:ie,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:J,strokeLinecap:d,strokeWidth:o,opacity:j===0?0:1,style:Q,ref:function(ge){O[ie]=ge}})}).reverse()},$=function(){var U=Math.round(k*(P[0]/100)),j=100/k,ie=0;return new Array(k).fill(null).map(function(Y,J){var Q=J<=U-1?N[0]:u,he=Q&&Un(Q)==="object"?"url(#".concat(_,")"):void 0,ge=G6(S,E,ie,j,L,l,c,Q,"butt",o,T);return ie+=(E-ge.strokeDashoffset+T)*100/E,C.createElement("circle",{key:J,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:he,strokeWidth:o,opacity:1,style:ge,ref:function(be){O[J]=be}})})};return C.createElement("svg",It({className:De("".concat(n,"-circle"),f),viewBox:"".concat(-Xx/2," ").concat(-Xx/2," ").concat(Xx," ").concat(Xx),style:h,id:t,role:"presentation"},m),R&&C.createElement("defs",null,C.createElement("linearGradient",{id:_,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(R).sort(function(G,U){return Eoe(G)-Eoe(U)}).map(function(G,U){return C.createElement("stop",{key:U,offset:G,stopColor:R[G]})}))),!k&&C.createElement("circle",{className:"".concat(n,"-circle-trail"),r:y,cx:0,cy:0,stroke:u,strokeLinecap:d,strokeWidth:s||o,style:M}),k?$():B())};NX.defaultProps=Jqe;NX.displayName="Circle";function db(i){return!i||i<0?0:i>100?100:i}function vA(i){let{success:e,successPercent:t}=i,n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const oXe=i=>{let{percent:e,success:t,successPercent:n}=i;const r=db(vA({success:t,successPercent:n}));return[r,db(db(e)-r)]},sXe=i=>{let{success:e={},strokeColor:t}=i;const{strokeColor:n}=e;return[n||$y.green,t||null]},G4=(i,e,t)=>{var n,r,o,s;let a=-1,l=-1;if(e==="step"){const c=t.steps,u=t.strokeWidth;typeof i=="string"||typeof i>"u"?(a=i==="small"?2:14,l=u??8):typeof i=="number"?[a,l]=[i,i]:[a=14,l=8]=i,a*=c}else if(e==="line"){const c=t==null?void 0:t.strokeWidth;typeof i=="string"||typeof i>"u"?l=c||(i==="small"?6:8):typeof i=="number"?[a,l]=[i,i]:[a=-1,l=8]=i}else(e==="circle"||e==="dashboard")&&(typeof i=="string"||typeof i>"u"?[a,l]=i==="small"?[60,60]:[120,120]:typeof i=="number"?[a,l]=[i,i]:(a=(r=(n=i[0])!==null&&n!==void 0?n:i[1])!==null&&r!==void 0?r:120,l=(s=(o=i[0])!==null&&o!==void 0?o:i[1])!==null&&s!==void 0?s:120));return[a,l]},aXe=3,lXe=i=>aXe/i*100,cXe=i=>{const{prefixCls:e,trailColor:t=null,strokeLinecap:n="round",gapPosition:r,gapDegree:o,width:s=120,type:a,children:l,success:c,size:u}=i,d=u??[s,s],[h,f]=G4(d,"circle");let{strokeWidth:g}=i;g===void 0&&(g=Math.max(lXe(h),6));const p={width:h,height:f,fontSize:h*.15+6},m=C.useMemo(()=>{if(o||o===0)return o;if(a==="dashboard")return 75},[o,a]),v=r||a==="dashboard"&&"bottom"||void 0,_=Object.prototype.toString.call(i.strokeColor)==="[object Object]",y=sXe({success:c,strokeColor:i.strokeColor}),S=De(`${e}-inner`,{[`${e}-circle-gradient`]:_}),L=C.createElement(NX,{percent:oXe(i),strokeWidth:g,trailWidth:g,strokeColor:y,strokeLinecap:n,trailColor:t,prefixCls:e,gapDegree:m,gapPosition:v});return C.createElement("div",{className:S,style:p},h<=20?C.createElement(Qk,{title:l},C.createElement("span",null,L)):C.createElement(C.Fragment,null,L,l))},uXe=cXe;var dXe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let e=[];return Object.keys(i).forEach(t=>{const n=parseFloat(t.replace(/%/g,""));isNaN(n)||e.push({key:n,value:i[t]})}),e=e.sort((t,n)=>t.key-n.key),e.map(t=>{let{key:n,value:r}=t;return`${r} ${n}%`}).join(", ")},fXe=(i,e)=>{const{from:t=$y.blue,to:n=$y.blue,direction:r=e==="rtl"?"to left":"to right"}=i,o=dXe(i,["from","to","direction"]);if(Object.keys(o).length!==0){const s=hXe(o);return{backgroundImage:`linear-gradient(${r}, ${s})`}}return{backgroundImage:`linear-gradient(${r}, ${t}, ${n})`}},gXe=i=>{const{prefixCls:e,direction:t,percent:n,size:r,strokeWidth:o,strokeColor:s,strokeLinecap:a="round",children:l,trailColor:c=null,success:u}=i,d=s&&typeof s!="string"?fXe(s,t):{backgroundColor:s},h=a==="square"||a==="butt"?0:void 0,f={backgroundColor:c||void 0,borderRadius:h},g=r??[-1,o||(r==="small"?6:8)],[p,m]=G4(g,"line",{strokeWidth:o}),v=Object.assign({width:`${db(n)}%`,height:m,borderRadius:h},d),_=vA(i),y={width:`${db(_)}%`,height:m,borderRadius:h,backgroundColor:u==null?void 0:u.strokeColor},S={width:p<0?"100%":p,height:m};return C.createElement(C.Fragment,null,C.createElement("div",{className:`${e}-outer`,style:S},C.createElement("div",{className:`${e}-inner`,style:f},C.createElement("div",{className:`${e}-bg`,style:v}),_!==void 0?C.createElement("div",{className:`${e}-success-bg`,style:y}):null)),l)},pXe=gXe,mXe=i=>{const{size:e,steps:t,percent:n=0,strokeWidth:r=8,strokeColor:o,trailColor:s=null,prefixCls:a,children:l}=i,c=Math.round(t*(n/100)),d=e??[e==="small"?2:14,r],[h,f]=G4(d,"step",{steps:t,strokeWidth:r}),g=h/t,p=new Array(t);for(let m=0;m{const{componentCls:e,iconCls:t}=i;return{[e]:Object.assign(Object.assign({},Vr(i)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:i.fontSize,marginInlineEnd:i.marginXS,marginBottom:i.marginXS},[`${e}-outer`]:{display:"inline-block",width:"100%"},[`&${e}-show-info`]:{[`${e}-outer`]:{marginInlineEnd:`calc(-2em - ${i.marginXS}px)`,paddingInlineEnd:`calc(2em + ${i.paddingXS}px)`}},[`${e}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:i.progressRemainingColor,borderRadius:i.progressLineRadius},[`${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorInfo}},[`${e}-success-bg, ${e}-bg`]:{position:"relative",backgroundColor:i.colorInfo,borderRadius:i.progressLineRadius,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`},[`${e}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:i.colorSuccess},[`${e}-text`]:{display:"inline-block",width:"2em",marginInlineStart:i.marginXS,color:i.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:i.fontSize}},[`&${e}-status-active`]:{[`${e}-bg::before`]:{position:"absolute",inset:0,backgroundColor:i.colorBgContainer,borderRadius:i.progressLineRadius,opacity:0,animationName:_Xe,animationDuration:i.progressActiveMotionDuration,animationTimingFunction:i.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${e}-status-exception`]:{[`${e}-bg`]:{backgroundColor:i.colorError},[`${e}-text`]:{color:i.colorError}},[`&${e}-status-exception ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorError}},[`&${e}-status-success`]:{[`${e}-bg`]:{backgroundColor:i.colorSuccess},[`${e}-text`]:{color:i.colorSuccess}},[`&${e}-status-success ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorSuccess}}})}},CXe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-circle-trail`]:{stroke:i.progressRemainingColor},[`&${e}-circle ${e}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${e}-circle ${e}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:i.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:`${i.fontSize/i.fontSizeSM}em`}},[`${e}-circle&-status-exception`]:{[`${e}-text`]:{color:i.colorError}},[`${e}-circle&-status-success`]:{[`${e}-text`]:{color:i.colorSuccess}}},[`${e}-inline-circle`]:{lineHeight:1,[`${e}-inner`]:{verticalAlign:"bottom"}}}},yXe=i=>{const{componentCls:e}=i;return{[e]:{[`${e}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:i.progressStepMinWidth,marginInlineEnd:i.progressStepMarginInlineEnd,backgroundColor:i.progressRemainingColor,transition:`all ${i.motionDurationSlow}`,"&-active":{backgroundColor:i.colorInfo}}}}}},wXe=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-small&-line, ${e}-small&-line ${e}-text ${t}`]:{fontSize:i.fontSizeSM}}}},SXe=yo("Progress",i=>{const e=i.marginXXS/2,t=Bi(i,{progressLineRadius:100,progressInfoTextColor:i.colorText,progressDefaultColor:i.colorInfo,progressRemainingColor:i.colorFillSecondary,progressStepMarginInlineEnd:e,progressStepMinWidth:e,progressActiveMotionDuration:"2.4s"});return[bXe(t),CXe(t),yXe(t),wXe(t)]});var xXe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,rootClassName:n,steps:r,strokeColor:o,percent:s=0,size:a="default",showInfo:l=!0,type:c="line",status:u,format:d}=i,h=xXe(i,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format"]),f=C.useMemo(()=>{var T,M;const P=vA(i);return parseInt(P!==void 0?(T=P??0)===null||T===void 0?void 0:T.toString():(M=s??0)===null||M===void 0?void 0:M.toString(),10)},[s,i.success,i.successPercent]),g=C.useMemo(()=>!LXe.includes(u)&&f>=100?"success":u||"normal",[u,f]),{getPrefixCls:p,direction:m}=C.useContext(Pn),v=p("progress",e),[_,y]=SXe(v),S=C.useMemo(()=>{if(!l)return null;const T=vA(i);let M;const P=d||(R=>`${R}%`),N=c==="line";return d||g!=="exception"&&g!=="success"?M=P(db(s),db(T)):g==="exception"?M=N?C.createElement(PS,null):C.createElement(Vk,null):g==="success"&&(M=N?C.createElement(Eq,null):C.createElement(vme,null)),C.createElement("span",{className:`${v}-text`,title:typeof M=="string"?M:void 0},M)},[l,s,f,g,c,v,d]),L=Array.isArray(o)?o[0]:o,E=typeof o=="string"||Array.isArray(o)?o:void 0;let D;c==="line"?D=r?C.createElement(vXe,Object.assign({},i,{strokeColor:E,prefixCls:v,steps:r}),S):C.createElement(pXe,Object.assign({},i,{strokeColor:L,prefixCls:v,direction:m}),S):(c==="circle"||c==="dashboard")&&(D=C.createElement(uXe,Object.assign({},i,{strokeColor:L,prefixCls:v,progressStatus:g}),S));const k=De(v,{[`${v}-inline-circle`]:c==="circle"&&G4(a,"circle")[0]<=20,[`${v}-${c==="dashboard"&&"circle"||r&&"steps"||c}`]:!0,[`${v}-status-${g}`]:!0,[`${v}-show-info`]:l,[`${v}-${a}`]:typeof a=="string",[`${v}-rtl`]:m==="rtl"},t,n,y);return _(C.createElement("div",Object.assign({className:k,role:"progressbar"},cl(h,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),D))},Ioe=EXe;var Mm={};function DXe(i){var e=C.createContext(void 0),t=function(r){var o=r.value,s=r.children,a=C.useRef(o);a.current=o;var l=C.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),c=$e(l,1),u=c[0];return Cr(function(){lh.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(o)})})},[o]),C.createElement(e.Provider,{value:u},s)};return{Context:e,Provider:t,defaultValue:i}}function Ih(i,e){var t=rc(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var h={};return e.forEach(function(f){h[f]=d[f]}),h}),n=C.useContext(i==null?void 0:i.Context),r=n||{},o=r.listeners,s=r.getValue,a=C.useRef();a.current=t(n?s():i==null?void 0:i.defaultValue);var l=C.useState({}),c=$e(l,2),u=c[1];return Cr(function(){if(!n)return;function d(h){var f=t(h);Tp(a.current,f,!0)||u({})}return o.add(d),function(){o.delete(d)}},[n]),a.current}var Lbe=C.createContext(0);function Ebe(){return C.useContext(Lbe)}function IXe(i,e){var t=D_(i),n=function(o,s){var a=t?{ref:s}:{},l=C.useRef(0),c=C.useRef(o);return(!e||e(c.current,o))&&(l.current+=1),c.current=o,C.createElement(Lbe.Provider,{value:l.current},C.createElement(i,It({},o,a)))};return t?C.forwardRef(n):n}function q4(i,e){var t=D_(i),n=function(o,s){var a=t?{ref:s}:{};return Ebe(),C.createElement(i,It({},o,a))};return t?C.memo(C.forwardRef(n),e):C.memo(n,e)}var fd=DXe();function kXe(i,e){var t=C.useRef(0);t.current+=1;var n=C.useRef(i),r=[];Object.keys(i||{}).map(function(s){var a;(i==null?void 0:i[s])!==((a=n.current)===null||a===void 0?void 0:a[s])&&r.push(s)}),n.current=i;var o=C.useRef([]);return r.length&&(o.current=r),C.useDebugValue(t.current),C.useDebugValue(o.current.join(", ")),e&&console.log("".concat(e,":"),t.current,o.current),t.current}var TXe=C.memo(function(){var i=kXe();return C.createElement("h1",null,"Render Times: ",i)});TXe.displayName="RenderBlock";var Dbe=C.createContext({renderWithProps:!1}),NXe="RC_TABLE_KEY";function RXe(i){return i==null?[]:Array.isArray(i)?i:[i]}function X4(i){var e=[],t={};return i.forEach(function(n){for(var r=n||{},o=r.key,s=r.dataIndex,a=o||RXe(s).join("-")||NXe;t[a];)a="".concat(a,"_next");t[a]=!0,e.push(a)}),e}function PH(i){return i!=null}function MXe(i){return i&&Un(i)==="object"&&!Array.isArray(i)&&!C.isValidElement(i)}function PXe(i,e,t,n,r,o){var s=C.useContext(Dbe),a=Ebe(),l=pC(function(){if(PH(n))return[n];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Yd(i,c),d=u,h=void 0;if(r){var f=r(u,i,t);MXe(f)?(d=f.children,h=f.props,s.renderWithProps=!0):d=f}return[d,h]},[a,i,n,e,r,t],function(c,u){if(o){var d=$e(c,2),h=d[1],f=$e(u,2),g=f[1];return o(g,h)}return s.renderWithProps?!0:!Tp(c,u,!0)});return l}function AXe(i,e,t,n){var r=i+e-1;return i<=n&&r>=t}function OXe(i,e){return Ih(fd,function(t){var n=AXe(i,e||1,t.hoverStartRow,t.hoverEndRow);return[n,t.onHover]})}var FXe=function(e){var t=e.ellipsis,n=e.rowType,r=e.children,o,s=t===!0?{showTitle:!0}:t;return s&&(s.showTitle||n==="header")&&(typeof r=="string"||typeof r=="number"?o=r.toString():C.isValidElement(r)&&typeof r.props.children=="string"&&(o=r.props.children)),o};function BXe(i){var e,t,n,r,o,s,a,l,c=i.component,u=i.children,d=i.ellipsis,h=i.scope,f=i.prefixCls,g=i.className,p=i.align,m=i.record,v=i.render,_=i.dataIndex,y=i.renderIndex,S=i.shouldCellUpdate,L=i.index,E=i.rowType,D=i.colSpan,k=i.rowSpan,T=i.fixLeft,M=i.fixRight,P=i.firstFixLeft,N=i.lastFixLeft,R=i.firstFixRight,O=i.lastFixRight,B=i.appendNode,$=i.additionalProps,G=$===void 0?{}:$,U=i.isSticky,j="".concat(f,"-cell"),ie=Ih(fd,["supportSticky","allColumnsFixedLeft"]),Y=ie.supportSticky,J=ie.allColumnsFixedLeft,Q=PXe(m,_,y,u,v,S),he=$e(Q,2),ge=he[0],ye=he[1],be={},Ge=typeof T=="number"&&Y,nt=typeof M=="number"&&Y;Ge&&(be.position="sticky",be.left=T),nt&&(be.position="sticky",be.right=M);var je=(e=(t=(n=ye==null?void 0:ye.colSpan)!==null&&n!==void 0?n:G.colSpan)!==null&&t!==void 0?t:D)!==null&&e!==void 0?e:1,_e=(r=(o=(s=ye==null?void 0:ye.rowSpan)!==null&&s!==void 0?s:G.rowSpan)!==null&&o!==void 0?o:k)!==null&&r!==void 0?r:1,Ve=OXe(L,_e),Le=$e(Ve,2),Pe=Le[0],Be=Le[1],Qe=function(q){var se;m&&Be(L,L+_e-1),G==null||(se=G.onMouseEnter)===null||se===void 0||se.call(G,q)},Ye=function(q){var se;m&&Be(-1,-1),G==null||(se=G.onMouseLeave)===null||se===void 0||se.call(G,q)};if(je===0||_e===0)return null;var We=(a=G.title)!==null&&a!==void 0?a:FXe({rowType:E,ellipsis:d,children:ge}),dt=De(j,g,(l={},we(l,"".concat(j,"-fix-left"),Ge&&Y),we(l,"".concat(j,"-fix-left-first"),P&&Y),we(l,"".concat(j,"-fix-left-last"),N&&Y),we(l,"".concat(j,"-fix-left-all"),N&&J&&Y),we(l,"".concat(j,"-fix-right"),nt&&Y),we(l,"".concat(j,"-fix-right-first"),R&&Y),we(l,"".concat(j,"-fix-right-last"),O&&Y),we(l,"".concat(j,"-ellipsis"),d),we(l,"".concat(j,"-with-append"),B),we(l,"".concat(j,"-fix-sticky"),(Ge||nt)&&U&&Y),we(l,"".concat(j,"-row-hover"),!ye&&Pe),l),G.className,ye==null?void 0:ye.className),re={};p&&(re.textAlign=p);var ue=te(te(te(te({},G.style),re),be),ye==null?void 0:ye.style),de=ge;return Un(de)==="object"&&!Array.isArray(de)&&!C.isValidElement(de)&&(de=null),d&&(N||R)&&(de=C.createElement("span",{className:"".concat(j,"-content")},de)),C.createElement(c,It({},ye,G,{className:dt,style:ue,title:We,scope:h,onMouseEnter:Qe,onMouseLeave:Ye,colSpan:je!==1?je:null,rowSpan:_e!==1?_e:null}),B,de)}const Y4=C.memo(BXe);function RX(i,e,t,n,r,o){var s=t[i]||{},a=t[e]||{},l,c;s.fixed==="left"?l=n.left[r==="rtl"?e:i]:a.fixed==="right"&&(c=n.right[r==="rtl"?i:e]);var u=!1,d=!1,h=!1,f=!1,g=t[e+1],p=t[i-1],m=!(o!=null&&o.children);if(r==="rtl"){if(l!==void 0){var v=p&&p.fixed==="left";f=!v&&m}else if(c!==void 0){var _=g&&g.fixed==="right";h=!_&&m}}else if(l!==void 0){var y=g&&g.fixed==="left";u=!y&&m}else if(c!==void 0){var S=p&&p.fixed==="right";d=!S&&m}return{fixLeft:l,fixRight:c,lastFixLeft:u,firstFixRight:d,lastFixRight:h,firstFixLeft:f,isSticky:n.isSticky}}var Ibe=C.createContext({});function WXe(i){var e=i.className,t=i.index,n=i.children,r=i.colSpan,o=r===void 0?1:r,s=i.rowSpan,a=i.align,l=Ih(fd,["prefixCls","direction"]),c=l.prefixCls,u=l.direction,d=C.useContext(Ibe),h=d.scrollColumnIndex,f=d.stickyOffsets,g=d.flattenColumns,p=d.columns,m=t+o-1,v=m+1===h?o+1:o,_=RX(t,t+v-1,g,f,u,p==null?void 0:p[t]);return C.createElement(Y4,It({className:e,index:t,component:"td",prefixCls:c,record:null,dataIndex:null,align:a,colSpan:v,rowSpan:s,render:function(){return n}},_))}var $Xe=["children"];function HXe(i){var e=i.children,t=Mn(i,$Xe);return C.createElement("tr",t,e)}function Z4(i){var e=i.children;return e}Z4.Row=HXe;Z4.Cell=WXe;function VXe(i){var e=i.children,t=i.stickyOffsets,n=i.flattenColumns,r=i.columns,o=Ih(fd,"prefixCls"),s=n.length-1,a=n[s],l=C.useMemo(function(){return{stickyOffsets:t,flattenColumns:n,scrollColumnIndex:a!=null&&a.scrollbar?s:null,columns:r}},[a,n,s,t,r]);return C.createElement(Ibe.Provider,{value:l},C.createElement("tfoot",{className:"".concat(o,"-summary")},e))}const ER=q4(VXe);var kbe=Z4;function zXe(i){return null}function UXe(i){return null}function Tbe(i,e,t,n,r,o){var s=[];s.push({record:i,indent:e,index:o});var a=r(i),l=n==null?void 0:n.has(a);if(i&&Array.isArray(i[t])&&l)for(var c=0;c1?Be-1:0),Ye=1;Ye=0;a-=1){var l=e[a],c=t&&t[a],u=c&&c[RE];if(l||u||s){var d=u||{};d.columnType;var h=Mn(d,QXe);r.unshift(C.createElement("col",It({key:a,style:{width:l}},h))),s=!0}}return C.createElement("colgroup",null,r)}var JXe=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function eYe(i,e){return C.useMemo(function(){for(var t=[],n=0;n=0})},[o]),M=o[o.length-1],P={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(y,"-cell-scrollbar")}}},N=C.useMemo(function(){return E?[].concat(gt(r),[P]):r},[E,r]),R=C.useMemo(function(){return E?[].concat(gt(o),[P]):o},[E,o]),O=C.useMemo(function(){var $=l.right,G=l.left;return te(te({},l),{},{left:c==="rtl"?[].concat(gt(G.map(function(U){return U+E})),[0]):G,right:c==="rtl"?$:[].concat(gt($.map(function(U){return U+E})),[0]),isSticky:L})},[E,l,L]),B=eYe(s,a);return C.createElement("div",{style:te({overflow:"hidden"},L?{top:d,bottom:h}:{}),ref:k,className:De(t,we({},f,!!f))},C.createElement("table",{style:{tableLayout:"fixed",visibility:n||B?null:"hidden"}},(!n||!p||T)&&C.createElement(Pbe,{colWidths:B?[].concat(gt(B),[E]):[],columCount:a+1,columns:R}),m(te(te({},v),{},{stickyOffsets:O,columns:N,flattenColumns:R}))))});Abe.displayName="FixedHolder";const koe=C.memo(Abe);function Obe(i){var e=i.cells,t=i.stickyOffsets,n=i.flattenColumns,r=i.rowComponent,o=i.cellComponent,s=i.tdCellComponent,a=i.onHeaderRow,l=i.index,c=Ih(fd,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,h;a&&(h=a(e.map(function(g){return g.column}),l));var f=X4(e.map(function(g){return g.column}));return C.createElement(r,h,e.map(function(g,p){var m=g.column,v=RX(g.colStart,g.colEnd,n,t,d,m),_;return m&&m.onHeaderCell&&(_=g.column.onHeaderCell(m)),C.createElement(Y4,It({},g,{scope:m.title?g.colSpan>1?"colgroup":"col":null,ellipsis:m.ellipsis,align:m.align,component:m.title?o:s,prefixCls:u,key:f[p]},v,{additionalProps:_,rowType:"header"}))}))}Obe.displayName="HeaderRow";function tYe(i){var e=[];function t(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[l]=e[l]||[];var c=a,u=s.filter(Boolean).map(function(d){var h={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},f=1,g=d.children;return g&&g.length>0&&(f=t(g,c,l+1).reduce(function(p,m){return p+m},0),h.hasSubColumns=!0),"colSpan"in d&&(f=d.colSpan),"rowSpan"in d&&(h.rowSpan=d.rowSpan),h.colSpan=f,h.colEnd=h.colStart+f-1,e[l].push(h),c+=f,f});return u}t(i,0);for(var n=e.length,r=function(a){e[a].forEach(function(l){!("rowSpan"in l)&&!l.hasSubColumns&&(l.rowSpan=n-a)})},o=0;o0?[].concat(gt(e),gt(AH(o).map(function(s){return te({fixed:r},s)}))):[].concat(gt(e),[te(te({},t),{},{fixed:r})])},[])}function oYe(i){return i.map(function(e){var t=e.fixed,n=Mn(e,rYe),r=t;return t==="left"?r="right":t==="right"&&(r="left"),te({fixed:r},n)})}function sYe(i,e){var t=i.prefixCls,n=i.columns,r=i.children,o=i.expandable,s=i.expandedKeys,a=i.columnTitle,l=i.getRowKey,c=i.onTriggerExpand,u=i.expandIcon,d=i.rowExpandable,h=i.expandIconColumnIndex,f=i.direction,g=i.expandRowByClick,p=i.columnWidth,m=i.fixed,v=C.useMemo(function(){return n||MX(r)},[n,r]),_=C.useMemo(function(){if(o){var L,E=v.slice();if(!E.includes(Mm)){var D=h||0;D>=0&&E.splice(D,0,Mm)}var k=E.indexOf(Mm);E=E.filter(function(N,R){return N!==Mm||R===k});var T=v[k],M;(m==="left"||m)&&!h?M="left":(m==="right"||m)&&h===v.length?M="right":M=T?T.fixed:null;var P=(L={},we(L,RE,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),we(L,"title",a),we(L,"fixed",M),we(L,"className","".concat(t,"-row-expand-icon-cell")),we(L,"width",p),we(L,"render",function(R,O,B){var $=l(O,B),G=s.has($),U=d?d(O):!0,j=u({prefixCls:t,expanded:G,expandable:U,record:O,onExpand:c});return g?C.createElement("span",{onClick:function(Y){return Y.stopPropagation()}},j):j}),L);return E.map(function(N){return N===Mm?P:N})}return v.filter(function(N){return N!==Mm})},[o,v,l,s,u,f]),y=C.useMemo(function(){var L=_;return e&&(L=e(L)),L.length||(L=[{render:function(){return null}}]),L},[e,_,f]),S=C.useMemo(function(){return f==="rtl"?oYe(AH(y)):AH(y)},[y,f]);return[y,S]}function aYe(i){var e,t=i.prefixCls,n=i.record,r=i.onExpand,o=i.expanded,s=i.expandable,a="".concat(t,"-row-expand-icon");if(!s)return C.createElement("span",{className:De(a,"".concat(t,"-row-spaced"))});var l=function(u){r(n,u),u.stopPropagation()};return C.createElement("span",{className:De(a,(e={},we(e,"".concat(t,"-row-expanded"),o),we(e,"".concat(t,"-row-collapsed"),!o),e)),onClick:l})}function lYe(i,e,t){var n=[];function r(o){(o||[]).forEach(function(s,a){n.push(e(s,a)),r(s[t])})}return r(i),n}function cYe(i,e,t){var n=ZXe(i),r=n.expandIcon,o=n.expandedRowKeys,s=n.defaultExpandedRowKeys,a=n.defaultExpandAllRows,l=n.expandedRowRender,c=n.onExpand,u=n.onExpandedRowsChange,d=n.childrenColumnName,h=r||aYe,f=d||"children",g=C.useMemo(function(){return l?"row":i.expandable&&i.internalHooks===_A&&i.expandable.__PARENT_RENDER_ICON__||e.some(function(L){return L&&Un(L)==="object"&&L[f]})?"nest":!1},[!!l,e]),p=C.useState(function(){return s||(a?lYe(e,t,f):[])}),m=$e(p,2),v=m[0],_=m[1],y=C.useMemo(function(){return new Set(o||v||[])},[o,v]),S=C.useCallback(function(L){var E=t(L,e.indexOf(L)),D,k=y.has(E);k?(y.delete(E),D=gt(y)):D=[].concat(gt(y),[E]),_(D),c&&c(!k,L),u&&u(D)},[t,y,e,c,u]);return[n,g,y,h,f,S]}function uYe(i,e,t,n){var r=i.map(function(o,s){return RX(s,s,i,e,t,n==null?void 0:n[s])});return pC(function(){return r},[r],function(o,s){return!Tp(o,s)})}function Fbe(i){var e=C.useRef(i),t=C.useState({}),n=$e(t,2),r=n[1],o=C.useRef(null),s=C.useRef([]);function a(l){s.current.push(l);var c=Promise.resolve();o.current=c,c.then(function(){if(o.current===c){var u=s.current,d=e.current;s.current=[],u.forEach(function(h){e.current=h(e.current)}),o.current=null,d!==e.current&&r({})}})}return C.useEffect(function(){return function(){o.current=null}},[]),[e.current,a]}function dYe(i){var e=C.useRef(i||null),t=C.useRef();function n(){window.clearTimeout(t.current)}function r(s){e.current=s,n(),t.current=window.setTimeout(function(){e.current=null,t.current=void 0},100)}function o(){return e.current}return C.useEffect(function(){return n},[]),[r,o]}function hYe(){var i=C.useState(-1),e=$e(i,2),t=e[0],n=e[1],r=C.useState(-1),o=$e(r,2),s=o[0],a=o[1],l=C.useCallback(function(c,u){n(c),a(u)},[]);return[t,s,l]}var Noe=ea()?window:null;function fYe(i,e){var t=Un(i)==="object"?i:{},n=t.offsetHeader,r=n===void 0?0:n,o=t.offsetSummary,s=o===void 0?0:o,a=t.offsetScroll,l=a===void 0?0:a,c=t.getContainer,u=c===void 0?function(){return Noe}:c,d=u()||Noe;return C.useMemo(function(){var h=!!i;return{isSticky:h,stickyClassName:h?"".concat(e,"-sticky-holder"):"",offsetHeader:r,offsetSummary:s,offsetScroll:l,container:d}},[l,r,s,e,d])}function gYe(i,e,t){var n=C.useMemo(function(){for(var r=[],o=[],s=0,a=0,l=0;l=d&&(G=d-h),s({scrollLeft:G/d*(u+2)}),_.current.x=R.pageX},M=function(){if(o.current){var R=boe(o.current).top,O=R+o.current.offsetHeight,B=l===window?document.documentElement.scrollTop+window.innerHeight:boe(l).top+l.clientHeight;O-nA()<=B||R>=B-a?v(function($){return te(te({},$),{},{isHiddenScrollBar:!0})}):v(function($){return te(te({},$),{},{isHiddenScrollBar:!1})})}},P=function(R){v(function(O){return te(te({},O),{},{scrollLeft:R/u*d||0})})};return C.useImperativeHandle(t,function(){return{setScrollLeft:P}}),C.useEffect(function(){var N=Zg(document.body,"mouseup",D,!1),R=Zg(document.body,"mousemove",T,!1);return M(),function(){N.remove(),R.remove()}},[h,L]),C.useEffect(function(){var N=Zg(l,"scroll",M,!1),R=Zg(window,"resize",M,!1);return function(){N.remove(),R.remove()}},[l]),C.useEffect(function(){m.isHiddenScrollBar||v(function(N){var R=o.current;return R?te(te({},N),{},{scrollLeft:R.scrollLeft/R.scrollWidth*R.clientWidth}):N})},[m.isHiddenScrollBar]),u<=d||!h||m.isHiddenScrollBar?null:C.createElement("div",{style:{height:nA(),width:d,bottom:a},className:"".concat(c,"-sticky-scroll")},C.createElement("div",{onMouseDown:k,ref:f,className:De("".concat(c,"-sticky-scroll-bar"),we({},"".concat(c,"-sticky-scroll-bar-active"),L)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(m.scrollLeft,"px, 0, 0)")}}))};const mYe=C.forwardRef(pYe);var vYe=[],_Ye={},_A="rc-table-internal-hook";function bYe(){return"No Data"}function CYe(i){var e,t=te({rowKey:"key",prefixCls:"rc-table",emptyText:bYe},i),n=t.prefixCls,r=t.className,o=t.rowClassName,s=t.style,a=t.data,l=t.rowKey,c=t.scroll,u=t.tableLayout,d=t.direction,h=t.title,f=t.footer,g=t.summary,p=t.caption,m=t.id,v=t.showHeader,_=t.components,y=t.emptyText,S=t.onRow,L=t.onHeaderRow,E=t.internalHooks,D=t.transformColumns,k=t.internalRefs,T=t.sticky,M=a||vYe,P=!!M.length,N=C.useCallback(function(Jt,Zt){return Yd(_,Jt)||Zt},[_]),R=C.useMemo(function(){return typeof l=="function"?l:function(Jt){var Zt=Jt&&Jt[l];return Zt}},[l]),O=hYe(),B=$e(O,3),$=B[0],G=B[1],U=B[2],j=cYe(t,M,R),ie=$e(j,6),Y=ie[0],J=ie[1],Q=ie[2],he=ie[3],ge=ie[4],ye=ie[5],be=C.useState(0),Ge=$e(be,2),nt=Ge[0],je=Ge[1],_e=sYe(te(te(te({},t),Y),{},{expandable:!!Y.expandedRowRender,columnTitle:Y.columnTitle,expandedKeys:Q,getRowKey:R,onTriggerExpand:ye,expandIcon:he,expandIconColumnIndex:Y.expandIconColumnIndex,direction:d}),E===_A?D:null),Ve=$e(_e,2),Le=Ve[0],Pe=Ve[1],Be=C.useMemo(function(){return{columns:Le,flattenColumns:Pe}},[Le,Pe]),Qe=C.useRef(),Ye=C.useRef(),We=C.useRef(),dt=C.useRef(),re=C.useRef(),ue=C.useState(!1),de=$e(ue,2),z=de[0],q=de[1],se=C.useState(!1),ne=$e(se,2),pe=ne[0],ke=ne[1],oe=Fbe(new Map),ce=$e(oe,2),fe=ce[0],Ie=ce[1],Te=X4(Pe),He=Te.map(function(Jt){return fe.get(Jt)}),Me=C.useMemo(function(){return He},[He.join("_")]),bt=gYe(Me,Pe.length,d),rt=c&&PH(c.y),Ht=c&&PH(c.x)||!!Y.fixed,Ue=Ht&&Pe.some(function(Jt){var Zt=Jt.fixed;return Zt}),Ct=C.useRef(),Dt=fYe(T,n),St=Dt.isSticky,Kt=Dt.offsetHeader,_n=Dt.offsetSummary,zt=Dt.offsetScroll,Yt=Dt.stickyClassName,at=Dt.container,ut=C.useMemo(function(){return g==null?void 0:g(M)},[g,M]),ht=(rt||St)&&C.isValidElement(ut)&&ut.type===Z4&&ut.props.fixed,Lt,At,ln;rt&&(At={overflowY:"scroll",maxHeight:c.y}),Ht&&(Lt={overflowX:"auto"},rt||(At={overflowY:"hidden"}),ln={width:(c==null?void 0:c.x)===!0?"auto":c==null?void 0:c.x,minWidth:"100%"});var Si=C.useCallback(function(Jt,Zt){qk(Qe.current)&&Ie(function(oi){if(oi.get(Jt)!==Zt){var Wi=new Map(oi);return Wi.set(Jt,Zt),Wi}return oi})},[]),Xi=dYe(null),Ir=$e(Xi,2),En=Ir[0],fi=Ir[1];function Ur(Jt,Zt){Zt&&(typeof Zt=="function"?Zt(Jt):Zt.scrollLeft!==Jt&&(Zt.scrollLeft=Jt,Zt.scrollLeft!==Jt&&setTimeout(function(){Zt.scrollLeft=Jt},0)))}var go=rc(function(Jt){var Zt=Jt.currentTarget,oi=Jt.scrollLeft,Wi=d==="rtl",So=typeof oi=="number"?oi:Zt.scrollLeft,Hs=Zt||_Ye;if(!fi()||fi()===Hs){var gl;En(Hs),Ur(So,Ye.current),Ur(So,We.current),Ur(So,re.current),Ur(So,(gl=Ct.current)===null||gl===void 0?void 0:gl.setScrollLeft)}if(Zt){var Vs=Zt.scrollWidth,kc=Zt.clientWidth;if(Vs===kc){q(!1),ke(!1);return}Wi?(q(-So0)):(q(So>0),ke(So{r(o,c),c.stopPropagation()},className:De(l,{[`${l}-spaced`]:!a,[`${l}-expanded`]:a&&s,[`${l}-collapsed`]:a&&!s}),"aria-label":s?i.collapse:i.expand,"aria-expanded":s})}}const xYe=Bbe((i,e)=>{const{_renderTimes:t}=i,{_renderTimes:n}=e;return t!==n});function Mb(i,e){return"key"in i&&i.key!==void 0&&i.key!==null?i.key:i.dataIndex?Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex:e}function sT(i,e){return e?`${e}-${i}`:`${i}`}function J4(i,e){return typeof i=="function"?i(e):i}function LYe(i,e){const t=J4(i,e);return Object.prototype.toString.call(t)==="[object Object]"?"":t}function Wbe(i){if(i==null)throw new TypeError("Cannot destructure "+i)}var EYe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],$be=function(e,t){var n=e.className,r=e.style,o=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Mn(e,EYe),f=C.useState(!0),g=$e(f,2),p=g[0],m=g[1],v=C.useContext(wX),_=v.prefixCls,y=C.useRef(!1),S=function(){y.current||c(),y.current=!0};return C.useEffect(function(){s&&a==="hide"&&p&&m(!1)},[s]),C.useEffect(function(){return s&&l(),function(){s&&S()}},[]),s?C.createElement(hd,It({ref:t,visible:p},o,{motionAppear:a==="show",onAppearEnd:S,onLeaveEnd:S}),function(L,E){var D=L.className,k=L.style;return C.createElement("div",{ref:E,className:De("".concat(_,"-treenode-motion"),D),style:k},s.map(function(T){var M=It({},(Wbe(T.data),T.data)),P=T.title,N=T.key,R=T.isStart,O=T.isEnd;delete M.children;var B=TE(N,d);return C.createElement(Ww,It({},M,B,{title:P,active:u,data:T.data,key:N,isStart:R,isEnd:O}))}))}):C.createElement(Ww,It({domRef:t,className:n,style:r},h,{active:u}))};$be.displayName="MotionTreeNode";var DYe=C.forwardRef($be);function IYe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function r(o,s){var a=new Map;o.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var Vbe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var r=i.expandedKeys,o=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,m=i.height,v=i.itemHeight,_=i.virtual,y=i.focusable,S=i.activeItem,L=i.focused,E=i.tabIndex,D=i.onKeyDown,k=i.onFocus,T=i.onBlur,M=i.onActiveChange,P=i.onListChangeStart,N=i.onListChangeEnd,R=Mn(i,kYe),O=C.useRef(null),B=C.useRef(null);C.useImperativeHandle(e,function(){return{scrollTo:function(ue){O.current.scrollTo(ue)},getIndentWidth:function(){return B.current.offsetWidth}}});var $=C.useState(r),G=$e($,2),U=G[0],j=G[1],ie=C.useState(n),Y=$e(ie,2),J=Y[0],Q=Y[1],he=C.useState(n),ge=$e(he,2),ye=ge[0],be=ge[1],Ge=C.useState([]),nt=$e(Ge,2),je=nt[0],_e=nt[1],Ve=C.useState(null),Le=$e(Ve,2),Pe=Le[0],Be=Le[1],Qe=C.useRef(n);Qe.current=n;function Ye(){var re=Qe.current;Q(re),be(re),_e([]),Be(null),N()}C.useEffect(function(){j(r);var re=IYe(U,r);if(re.key!==null)if(re.add){var ue=J.findIndex(function(pe){var ke=pe.key;return ke===re.key}),de=Ooe(Moe(J,n,re.key),_,m,v),z=J.slice();z.splice(ue+1,0,Aoe),be(z),_e(de),Be("show")}else{var q=n.findIndex(function(pe){var ke=pe.key;return ke===re.key}),se=Ooe(Moe(n,J,re.key),_,m,v),ne=n.slice();ne.splice(q+1,0,Aoe),be(ne),_e(se),Be("hide")}else J!==n&&(Q(n),be(n))},[r,n]),C.useEffect(function(){h||Ye()},[h]);var We=p?ye:n,dt={expandedKeys:r,selectedKeys:o,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return C.createElement(C.Fragment,null,L&&S&&C.createElement("span",{style:Poe,"aria-live":"assertive"},NYe(S)),C.createElement("div",null,C.createElement("input",{style:Poe,disabled:y===!1||d,tabIndex:y!==!1?E:null,onKeyDown:D,onFocus:k,onBlur:T,value:"",onChange:TYe,"aria-label":"for screen reader"})),C.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},C.createElement("div",{className:"".concat(t,"-indent")},C.createElement("div",{ref:B,className:"".concat(t,"-indent-unit")}))),C.createElement(Jq,It({},R,{data:We,itemKey:Foe,height:m,fullHeight:!1,virtual:_,itemHeight:v,prefixCls:"".concat(t,"-list"),ref:O,onVisibleChange:function(ue,de){var z=new Set(ue),q=de.filter(function(se){return!z.has(se)});q.some(function(se){return Foe(se)===Pb})&&Ye()}}),function(re){var ue=re.pos,de=It({},(Wbe(re.data),re.data)),z=re.title,q=re.key,se=re.isStart,ne=re.isEnd,pe=rT(q,ue);delete de.key,delete de.children;var ke=TE(pe,dt);return C.createElement(DYe,It({},de,ke,{title:z,active:!!S&&q===S.key,pos:ue,data:re.data,isStart:se,isEnd:ne,motion:p,motionNodes:q===Pb?je:null,motionType:Pe,onMotionStart:P,onMotionEnd:Ye,treeNodeRequiredProps:dt,onMouseMove:function(){M(null)}}))}))});Vbe.displayName="NodeList";function RYe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-t*n;break;case 1:r.bottom=0,r.left=-t*n;break;case 0:r.bottom=0,r.left=n;break}return C.createElement("div",{style:r})}var MYe=10,PX=function(i){Sh(t,i);var e=xh(t);function t(){var n;bs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,m=d.dropAllowed;if(m){var v=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=te(te({},TE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:n.state.keyEntities[g].node}),y=h.indexOf(g)!==-1;uo(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var S=SX(p),L={event:a,node:as(_),dragNode:n.dragNode?as(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(S[S.length-1])};u||v==null||v(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(v){return v.key===f})[0],m=as(te(te({},TE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?qh(u,f):Dg(u,f)),n.onNodeExpand(a,m)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,m=l.selected,v=l[h.key],_=!m;_?p?c=Dg(c,v):c=[v]:c=qh(c,v);var y=c.map(function(S){var L=d[S];return L?L.node:null}).filter(function(S){return S});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,m=g.onCheck,v=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var S=c?Dg(h,v):qh(h,v),L=qh(f,v);_={checked:S,halfChecked:L},y.checkedNodes=S.map(function(P){return d[P]}).filter(function(P){return P}).map(function(P){return P.node}),n.setUncontrolledState({checkedKeys:S})}else{var E=zy([].concat(gt(h),[v]),!0,d),D=E.checkedKeys,k=E.halfCheckedKeys;if(!c){var T=new Set(D);T.delete(v);var M=zy(Array.from(T),{checked:!1,halfCheckedKeys:k},d);D=M.checkedKeys,k=M.halfCheckedKeys}_=D,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=k,D.forEach(function(P){var N=d[P];if(N){var R=N.node,O=N.pos;y.checkedNodes.push(R),y.checkedNodesPositions.push({node:R,pos:O})}}),n.setUncontrolledState({checkedKeys:D},!1,{halfCheckedKeys:k})}m==null||m(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,m=p===void 0?[]:p,v=n.props,_=v.loadData,y=v.onLoad;if(!_||g.indexOf(l)!==-1||m.indexOf(l)!==-1)return null;var S=_(a);return S.then(function(){var L=n.state.loadedKeys,E=Dg(L,l);y==null||y(E,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:E}),n.setState(function(D){return{loadingKeys:qh(D.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(D){return{loadingKeys:qh(D.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=MYe){var E=n.state.loadedKeys;uo(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Dg(E,l)}),u()}d(L)}),{loadingKeys:Dg(m,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(te(te({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return Cs(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props.activeKey;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r,o=this.state,s=o.focused,a=o.flattenNodes,l=o.keyEntities,c=o.draggingNodeKey,u=o.activeKey,d=o.dropLevelOffset,h=o.dropContainerKey,f=o.dropTargetKey,g=o.dropPosition,p=o.dragOverNodeKey,m=o.indent,v=this.props,_=v.prefixCls,y=v.className,S=v.style,L=v.showLine,E=v.focusable,D=v.tabIndex,k=D===void 0?0:D,T=v.selectable,M=v.showIcon,P=v.icon,N=v.switcherIcon,R=v.draggable,O=v.checkable,B=v.checkStrictly,$=v.disabled,G=v.motion,U=v.loadData,j=v.filterTreeNode,ie=v.height,Y=v.itemHeight,J=v.virtual,Q=v.titleRender,he=v.dropIndicatorRender,ge=v.onContextMenu,ye=v.onScroll,be=v.direction,Ge=v.rootClassName,nt=v.rootStyle,je=Mp(this.props,{aria:!0,data:!0}),_e;return R&&(Un(R)==="object"?_e=R:typeof R=="function"?_e={nodeDraggable:R}:_e={}),C.createElement(wX.Provider,{value:{prefixCls:_,selectable:T,showIcon:M,icon:P,switcherIcon:N,draggable:_e,draggingNodeKey:c,checkable:O,checkStrictly:B,disabled:$,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:m,direction:be,dropIndicatorRender:he,loadData:U,filterTreeNode:j,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},C.createElement("div",{role:"tree",className:De(_,y,Ge,(r={},we(r,"".concat(_,"-show-line"),L),we(r,"".concat(_,"-focused"),s),we(r,"".concat(_,"-active-focused"),u!==null),r)),style:nt},C.createElement(Vbe,It({ref:this.listRef,prefixCls:_,style:S,data:a,disabled:$,selectable:T,checkable:!!O,motion:G,dragging:c!==null,height:ie,itemHeight:Y,virtual:J,focusable:E,focused:s,tabIndex:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ge,onScroll:ye},this.getTreeNodeRequiredProps(),je))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a={prevProps:r};function l(E){return!s&&E in r||s&&s[E]!==r[E]}var c,u=o.fieldNames;if(l("fieldNames")&&(u=fA(r.fieldNames),a.fieldNames=u),l("treeData")?c=r.treeData:l("children")&&(uo(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=tbe(r.children)),c){a.treeData=c;var d=xX(c,{fieldNames:u});a.keyEntities=te(we({},Pb,Hbe),d.keyEntities)}var h=a.keyEntities||o.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=r.autoExpandParent||!s&&r.defaultExpandParent?IH(r.expandedKeys,h):r.expandedKeys;else if(!s&&r.defaultExpandAll){var f=te({},h);delete f[Pb],a.expandedKeys=Object.keys(f).map(function(E){return f[E].key})}else!s&&r.defaultExpandedKeys&&(a.expandedKeys=r.autoExpandParent||r.defaultExpandParent?IH(r.defaultExpandedKeys,h):r.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=$6(c||o.treeData,a.expandedKeys||o.expandedKeys,u);a.flattenNodes=g}if(r.selectable&&(l("selectedKeys")?a.selectedKeys=voe(r.selectedKeys,r):!s&&r.defaultSelectedKeys&&(a.selectedKeys=voe(r.defaultSelectedKeys,r))),r.checkable){var p;if(l("checkedKeys")?p=W6(r.checkedKeys)||{}:!s&&r.defaultCheckedKeys?p=W6(r.defaultCheckedKeys)||{}:c&&(p=W6(r.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),p){var m=p,v=m.checkedKeys,_=v===void 0?[]:v,y=m.halfCheckedKeys,S=y===void 0?[]:y;if(!r.checkStrictly){var L=zy(_,!0,h);_=L.checkedKeys,S=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=S}}return l("loadedKeys")&&(a.loadedKeys=r.loadedKeys),a}}]),t}(C.Component);PX.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:RYe,allowDrop:function(){return!0},expandAction:!1};PX.TreeNode=Ww;const PYe=new vi("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),AYe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),OYe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),FYe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o}=e,s=(o-e.fontSizeLG)/2,a=e.paddingXS;return{[t]:Object.assign(Object.assign({},Vr(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},Np(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:PYe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${r}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:Object.assign({},Np(e)),[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${t}-draggable-icon`]:{width:o,lineHeight:`${o}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:o}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},AYe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:o,margin:0,lineHeight:`${o}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:o/2*.8,height:o/2,borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:a,marginBlockStart:s},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:o,margin:0,padding:`0 ${e.paddingXS/2}px`,color:"inherit",lineHeight:`${o}px`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:e.controlItemBgHover},[`&${t}-node-selected`]:{backgroundColor:e.controlItemBgActive},[`${t}-iconEle`]:{display:"inline-block",width:o,height:o,lineHeight:`${o}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${o}px`,userSelect:"none"},OYe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${o/2}px !important`}}}}})}},BYe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i.colorTextLightSolid,background:"transparent"}},"&-selected":{[` &:hover::before, &::before - `]:{background:i.colorPrimary},[`${e}-switcher`]:{color:i.colorTextLightSolid},[`${e}-node-content-wrapper`]:{color:i.colorTextLightSolid,background:"transparent"}}}}}},WYe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,r=e.paddingXS/2,o=e.controlHeightSM,s=Bi(e,{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o});return[FYe(i,s),BYe(s)]},$Ye=yo("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:nbe(`${t}-checkbox`,i)},WYe(t,i),m_e(i)]}),Boe=4;function HYe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:r,direction:o="ltr"}=i,s=o==="ltr"?"left":"right",a=o==="ltr"?"right":"left",l={[s]:-t*r+Boe,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=r+Boe;break}return qe.createElement("div",{style:l,className:`${n}-drop-indicator`})}const VYe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:r}=i,{isLeaf:o,expanded:s,loading:a}=n;if(a)return C.createElement(AD,{className:`${e}-switcher-loading-icon`});let l;if(r&&typeof r=="object"&&(l=r.showLeafIcon),o){if(!r)return null;if(typeof l!="boolean"&&l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return uh(d)?ta(d,{className:De(d.props.className||"",h)}):d}return l?C.createElement(Rme,{className:`${e}-switcher-line-icon`}):C.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return uh(u)?ta(u,{className:De(u.props.className||"",c)}):u!==void 0?u:r?s?C.createElement(qBe,{className:`${e}-switcher-line-icon`}):C.createElement(ZBe,{className:`${e}-switcher-line-icon`}):C.createElement($5e,{className:c})},zYe=VYe,UYe=qe.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n,virtual:r}=qe.useContext(Pn),{prefixCls:o,className:s,showIcon:a=!1,showLine:l,switcherIcon:c,blockNode:u=!1,children:d,checkable:h=!1,selectable:f=!0,draggable:g,motion:p}=i,m=t("tree",o),v=t(),_=p??Object.assign(Object.assign({},l_e(v)),{motionAppear:!1}),y=Object.assign(Object.assign({},i),{checkable:h,selectable:f,showIcon:a,motion:_,blockNode:u,showLine:!!l,dropIndicatorRender:HYe}),[S,L]=$Ye(m),E=qe.useMemo(()=>{if(!g)return!1;let k={};switch(typeof g){case"function":k.nodeDraggable=g;break;case"object":k=Object.assign({},g);break}return k.icon!==!1&&(k.icon=k.icon||qe.createElement(FBe,null)),k},[g]),D=k=>qe.createElement(zYe,{prefixCls:m,switcherIcon:c,treeNodeProps:k,showLine:l});return S(qe.createElement(PX,Object.assign({itemHeight:20,ref:e,virtual:r},y,{prefixCls:m,className:De({[`${m}-icon-hide`]:!a,[`${m}-block-node`]:u,[`${m}-unselectable`]:!f,[`${m}-rtl`]:n==="rtl"},s,L),direction:n,checkable:h&&qe.createElement("span",{className:`${m}-checkbox-inner`}),selectable:f,switcherIcon:D,draggable:E}),d))}),zbe=UYe;var Ng;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(Ng||(Ng={}));function AX(i,e){function t(n){const{key:r,children:o}=n;e(r,n)!==!1&&AX(o||[],e)}i.forEach(t)}function jYe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:r}=i;const o=[];let s=Ng.None;if(n&&n===r)return[n];if(!n||!r)return[];function a(l){return l===n||l===r}return AX(e,l=>{if(s===Ng.End)return!1;if(a(l)){if(o.push(l),s===Ng.None)s=Ng.Start;else if(s===Ng.Start)return s=Ng.End,!1}else s===Ng.Start&&o.push(l);return t.includes(l)}),o}function q6(i,e){const t=gt(e),n=[];return AX(i,(r,o)=>{const s=t.indexOf(r);return s!==-1&&(n.push(o),t.splice(s,1)),!!t.length}),n}var Woe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:r}=i,o=Woe(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=C.useRef(),a=C.useRef(),l=()=>{const{keyEntities:k}=xX($oe(o));let T;return t?T=Object.keys(k):n?T=IH(o.expandedKeys||r||[],k):T=o.expandedKeys||r,T},[c,u]=C.useState(o.selectedKeys||o.defaultSelectedKeys||[]),[d,h]=C.useState(()=>l());C.useEffect(()=>{"selectedKeys"in o&&u(o.selectedKeys)},[o.selectedKeys]),C.useEffect(()=>{"expandedKeys"in o&&h(o.expandedKeys)},[o.expandedKeys]);const f=(k,T)=>{var M;return"expandedKeys"in o||h(k),(M=o.onExpand)===null||M===void 0?void 0:M.call(o,k,T)},g=(k,T)=>{var M;const{multiple:P}=o,{node:N,nativeEvent:R}=T,{key:O=""}=N,B=$oe(o),$=Object.assign(Object.assign({},T),{selected:!0}),G=(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey),U=R==null?void 0:R.shiftKey;let j;P&&G?(j=k,s.current=O,a.current=j,$.selectedNodes=q6(B,j)):P&&U?(j=Array.from(new Set([].concat(gt(a.current||[]),gt(jYe({treeData:B,expandedKeys:d,startKey:O,endKey:s.current}))))),$.selectedNodes=q6(B,j)):(j=[O],s.current=O,a.current=j,$.selectedNodes=q6(B,j)),(M=o.onSelect)===null||M===void 0||M.call(o,j,$),"selectedKeys"in o||u(j)},{getPrefixCls:p,direction:m}=C.useContext(Pn),{prefixCls:v,className:_,showIcon:y=!0,expandAction:S="click"}=o,L=Woe(o,["prefixCls","className","showIcon","expandAction"]),E=p("tree",v),D=De(`${E}-directory`,{[`${E}-directory-rtl`]:m==="rtl"},_);return C.createElement(zbe,Object.assign({icon:KYe,ref:e,blockNode:!0},L,{showIcon:y,expandAction:S,prefixCls:E,className:D,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},qYe=C.forwardRef(GYe),XYe=qYe,OX=zbe;OX.DirectoryTree=XYe;OX.TreeNode=Ww;const YYe=OX;function ZYe(i){const e=C.useRef(i),t=Y_e();return[()=>e.current,n=>{e.current=n,t()}]}function Hoe(i){let{value:e,onChange:t,filterSearch:n,tablePrefixCls:r,locale:o}=i;return n?C.createElement("div",{className:`${r}-filter-dropdown-search`},C.createElement(nqe,{prefix:C.createElement(Iq,null),placeholder:o.filterSearchPlaceholder,onChange:t,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const QYe=i=>{const{keyCode:e}=i;e===_t.ENTER&&i.stopPropagation()},JYe=i=>C.createElement("div",{className:i.className,onClick:e=>e.stopPropagation(),onKeyDown:QYe},i.children),eZe=JYe;function tZe(i){return i.some(e=>{let{children:t}=e;return t})}function Ube(i,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(i.trim().toLowerCase()):!1}function jbe(i){let{filters:e,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s}=i;return e.map((a,l)=>{const c=String(a.value);if(a.children)return{key:c||l,label:a.text,popupClassName:`${t}-dropdown-submenu`,children:jbe({filters:a.children,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s})};const u=r?gA:X0e,d={key:a.value!==void 0?c:l,label:C.createElement(C.Fragment,null,C.createElement(u,{checked:n.includes(c)}),C.createElement("span",null,a.text))};return o.trim()?typeof s=="function"?s(o,a)?d:null:Ube(o,a.text)?d:null:d})}function nZe(i){var e,t;const{tablePrefixCls:n,prefixCls:r,column:o,dropdownPrefixCls:s,columnKey:a,filterMultiple:l,filterMode:c="menu",filterSearch:u=!1,filterState:d,triggerFilter:h,locale:f,children:g,getPopupContainer:p}=i,{filterDropdownOpen:m,onFilterDropdownOpenChange:v,filterResetToDefaultFilteredValue:_,defaultFilteredValue:y,filterDropdownVisible:S,onFilterDropdownVisibleChange:L}=o,[E,D]=C.useState(!1),k=!!(d&&(!((e=d.filteredKeys)===null||e===void 0)&&e.length||d.forceFiltered)),T=Be=>{D(Be),v==null||v(Be),L==null||L(Be)},M=(t=m??S)!==null&&t!==void 0?t:E,P=d==null?void 0:d.filteredKeys,[N,R]=ZYe(P||[]),O=Be=>{let{selectedKeys:Qe}=Be;R(Qe)},B=(Be,Qe)=>{let{node:Ye,checked:We}=Qe;O(l?{selectedKeys:Be}:{selectedKeys:We&&Ye.key?[Ye.key]:[]})};C.useEffect(()=>{E&&O({selectedKeys:P||[]})},[P]);const[$,G]=C.useState([]),U=Be=>{G(Be)},[j,ie]=C.useState(""),Y=Be=>{const{value:Qe}=Be.target;ie(Qe)};C.useEffect(()=>{E||ie("")},[E]);const J=Be=>{const Qe=Be&&Be.length?Be:null;if(Qe===null&&(!d||!d.filteredKeys)||Tp(Qe,d==null?void 0:d.filteredKeys,!0))return null;h({column:o,key:a,filteredKeys:Qe})},Q=()=>{T(!1),J(N())},he=function(){let{confirm:Be,closeDropdown:Qe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};Be&&J([]),Qe&&T(!1),ie(""),R(_?(y||[]).map(Ye=>String(Ye)):[])},ge=function(){let{closeDropdown:Be}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};Be&&T(!1),J(N())},ye=Be=>{Be&&P!==void 0&&R(P||[]),T(Be),!Be&&!o.filterDropdown&&Q()},be=De({[`${s}-menu-without-submenu`]:!tZe(o.filters||[])}),Ge=Be=>{if(Be.target.checked){const Qe=Uy(o==null?void 0:o.filters).map(Ye=>String(Ye));R(Qe)}else R([])},nt=Be=>{let{filters:Qe}=Be;return(Qe||[]).map((Ye,We)=>{const dt=String(Ye.value),re={title:Ye.text,key:Ye.value!==void 0?dt:We};return Ye.children&&(re.children=nt({filters:Ye.children})),re})},je=Be=>{var Qe;return Object.assign(Object.assign({},Be),{text:Be.title,value:Be.key,children:((Qe=Be.children)===null||Qe===void 0?void 0:Qe.map(Ye=>je(Ye)))||[]})};let _e;if(typeof o.filterDropdown=="function")_e=o.filterDropdown({prefixCls:`${s}-custom`,setSelectedKeys:Be=>O({selectedKeys:Be}),selectedKeys:N(),confirm:ge,clearFilters:he,filters:o.filters,visible:M,close:()=>{T(!1)}});else if(o.filterDropdown)_e=o.filterDropdown;else{const Be=N()||[],Qe=()=>(o.filters||[]).length===0?C.createElement(L0,{image:L0.PRESENTED_IMAGE_SIMPLE,description:f.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):c==="tree"?C.createElement(C.Fragment,null,C.createElement(Hoe,{filterSearch:u,value:j,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement("div",{className:`${n}-filter-dropdown-tree`},l?C.createElement(gA,{checked:Be.length===Uy(o.filters).length,indeterminate:Be.length>0&&Be.lengthtypeof u=="function"?u(j,je(We)):Ube(j,We.title):void 0}))):C.createElement(C.Fragment,null,C.createElement(Hoe,{filterSearch:u,value:j,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement(vX,{selectable:!0,multiple:l,prefixCls:`${s}-menu`,className:be,onSelect:O,onDeselect:O,selectedKeys:Be,getPopupContainer:p,openKeys:$,onOpenChange:U,items:jbe({filters:o.filters||[],filterSearch:u,prefixCls:r,filteredKeys:N(),filterMultiple:l,searchValue:j})})),Ye=()=>_?Tp((y||[]).map(We=>String(We)),Be,!0):Be.length===0;_e=C.createElement(C.Fragment,null,Qe(),C.createElement("div",{className:`${r}-dropdown-btns`},C.createElement(ed,{type:"link",size:"small",disabled:Ye(),onClick:()=>he()},f.filterReset),C.createElement(ed,{type:"primary",size:"small",onClick:Q},f.filterConfirm)))}o.filterDropdown&&(_e=C.createElement(A0e,{selectable:void 0},_e));const Ve=()=>C.createElement(eZe,{className:`${r}-dropdown`},_e);let Le;typeof o.filterIcon=="function"?Le=o.filterIcon(k):o.filterIcon?Le=o.filterIcon:Le=C.createElement(EBe,null);const{direction:Pe}=C.useContext(Pn);return C.createElement("div",{className:`${r}-column`},C.createElement("span",{className:`${n}-column-title`},g),C.createElement(GD,{dropdownRender:Ve,trigger:["click"],open:M,onOpenChange:ye,getPopupContainer:p,placement:Pe==="rtl"?"bottomLeft":"bottomRight"},C.createElement("span",{role:"button",tabIndex:-1,className:De(`${r}-trigger`,{active:k}),onClick:Be=>{Be.stopPropagation()}},Le)))}function FH(i,e,t){let n=[];return(i||[]).forEach((r,o)=>{var s;const a=sT(o,t);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let l=r.filteredValue;"filterDropdown"in r||(l=(s=l==null?void 0:l.map(String))!==null&&s!==void 0?s:l),n.push({column:r,key:Rb(r,a),filteredKeys:l,forceFiltered:r.filtered})}else n.push({column:r,key:Rb(r,a),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(n=[].concat(gt(n),gt(FH(r.children,e,a))))}),n}function Kbe(i,e,t,n,r,o,s,a){return t.map((l,c)=>{const u=sT(c,a),{filterMultiple:d=!0,filterMode:h,filterSearch:f}=l;let g=l;if(g.filters||g.filterDropdown){const p=Rb(g,u),m=n.find(v=>{let{key:_}=v;return p===_});g=Object.assign(Object.assign({},g),{title:v=>C.createElement(nZe,{tablePrefixCls:i,prefixCls:`${i}-filter`,dropdownPrefixCls:e,column:g,columnKey:p,filterState:m,filterMultiple:d,filterMode:h,filterSearch:f,triggerFilter:o,locale:r,getPopupContainer:s},J4(l.title,v))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:Kbe(i,e,g.children,n,r,o,s,u)})),g})}function Uy(i){let e=[];return(i||[]).forEach(t=>{let{value:n,children:r}=t;e.push(n),r&&(e=[].concat(gt(e),gt(Uy(r))))}),e}function Voe(i){const e={};return i.forEach(t=>{let{key:n,filteredKeys:r,column:o}=t;const{filters:s,filterDropdown:a}=o;if(a)e[n]=r||null;else if(Array.isArray(r)){const l=Uy(s);e[n]=l.filter(c=>r.includes(String(c)))}else e[n]=null}),e}function zoe(i,e){return e.reduce((t,n)=>{const{column:{onFilter:r,filters:o},filteredKeys:s}=n;return r&&s&&s.length?t.filter(a=>s.some(l=>{const c=Uy(o),u=c.findIndex(h=>String(h)===String(l)),d=u!==-1?c[u]:l;return r(d,a)})):t},i)}const Gbe=i=>i.flatMap(e=>"children"in e?[e].concat(gt(Gbe(e.children||[]))):[e]);function iZe(i){let{prefixCls:e,dropdownPrefixCls:t,mergedColumns:n,onFilterChange:r,getPopupContainer:o,locale:s}=i;const a=C.useMemo(()=>Gbe(n||[]),[n]),[l,c]=C.useState(()=>FH(a,!0)),u=C.useMemo(()=>{const g=FH(a,!1);if(g.length===0)return g;let p=!0;if(g.forEach(m=>{let{filteredKeys:v}=m;v!==void 0&&(p=!1)}),p){const m=(a||[]).map((v,_)=>Rb(v,sT(_)));return l.filter(v=>{let{key:_}=v;return m.includes(_)}).map(v=>{const _=a[m.findIndex(y=>y===v.key)];return Object.assign(Object.assign({},v),{column:Object.assign(Object.assign({},v.column),_),forceFiltered:_.filtered})})}return g},[a,l]),d=C.useMemo(()=>Voe(u),[u]),h=g=>{const p=u.filter(m=>{let{key:v}=m;return v!==g.key});p.push(g),c(p),r(Voe(p),p)};return[g=>Kbe(e,t,g,u,s,h,o),u,d]}function rZe(i,e,t){const n=C.useRef({});function r(o){if(!n.current||n.current.data!==i||n.current.childrenColumnName!==e||n.current.getRowKey!==t){let a=function(l){l.forEach((c,u)=>{const d=t(c,u);s.set(d,c),c&&typeof c=="object"&&e in c&&a(c[e]||[])})};const s=new Map;a(i),n.current={data:i,childrenColumnName:e,kvMap:s,getRowKey:t}}return n.current.kvMap.get(o)}return[r]}var oZe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const o=i[r];typeof o!="function"&&(t[r]=o)}),t}function aZe(i,e,t){const n=t&&typeof t=="object"?t:{},{total:r=0}=n,o=oZe(n,["total"]),[s,a]=C.useState(()=>({current:"defaultCurrent"in o?o.defaultCurrent:1,pageSize:"defaultPageSize"in o?o.defaultPageSize:qbe})),l=Cbe(s,o,{total:r>0?r:i}),c=Math.ceil((r||i)/l.pageSize);l.current>c&&(l.current=c||1);const u=(h,f)=>{a({current:h??1,pageSize:f||l.pageSize})},d=(h,f)=>{var g;t&&((g=t.onChange)===null||g===void 0||g.call(t,h,f)),u(h,f),e(h,f||(l==null?void 0:l.pageSize))};return t===!1?[{},()=>{}]:[Object.assign(Object.assign({},l),{onChange:d}),u]}const Cm={},BH="SELECT_ALL",WH="SELECT_INVERT",$H="SELECT_NONE",Uoe=[],Xbe=(i,e)=>{let t=[];return(e||[]).forEach(n=>{t.push(n),n&&typeof n=="object"&&i in n&&(t=[].concat(gt(t),gt(Xbe(i,n[i]))))}),t},lZe=(i,e)=>{const{preserveSelectedRowKeys:t,selectedRowKeys:n,defaultSelectedRowKeys:r,getCheckboxProps:o,onChange:s,onSelect:a,onSelectAll:l,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:h,type:f,selections:g,fixed:p,renderCell:m,hideSelectAll:v,checkStrictly:_=!0}=e||{},{prefixCls:y,data:S,pageData:L,getRecordByKey:E,getRowKey:D,expandType:k,childrenColumnName:T,locale:M,getPopupContainer:P}=i,[N,R]=nl(n||r||Uoe,{value:n}),O=C.useRef(new Map),B=C.useCallback(je=>{if(t){const _e=new Map;je.forEach(Ve=>{let Le=E(Ve);!Le&&O.current.has(Ve)&&(Le=O.current.get(Ve)),_e.set(Ve,Le)}),O.current=_e}},[E,t]);C.useEffect(()=>{B(N)},[N]);const{keyEntities:$}=C.useMemo(()=>_?{keyEntities:null}:xX(S,{externalGetKey:D,childrenPropName:T}),[S,D,_,T]),G=C.useMemo(()=>Xbe(T,L),[T,L]),U=C.useMemo(()=>{const je=new Map;return G.forEach((_e,Ve)=>{const Le=D(_e,Ve),Pe=(o?o(_e):null)||{};je.set(Le,Pe)}),je},[G,D,o]),j=C.useCallback(je=>{var _e;return!!(!((_e=U.get(D(je)))===null||_e===void 0)&&_e.disabled)},[U,D]),[ie,Y]=C.useMemo(()=>{if(_)return[N||[],[]];const{checkedKeys:je,halfCheckedKeys:_e}=zy(N,!0,$,j);return[je||[],_e]},[N,_,$,j]),J=C.useMemo(()=>{const je=f==="radio"?ie.slice(0,1):ie;return new Set(je)},[ie,f]),Q=C.useMemo(()=>f==="radio"?new Set:new Set(Y),[Y,f]),[he,ge]=C.useState(null);C.useEffect(()=>{e||R(Uoe)},[!!e]);const ye=C.useCallback((je,_e)=>{let Ve,Le;B(je),t?(Ve=je,Le=je.map(Pe=>O.current.get(Pe))):(Ve=[],Le=[],je.forEach(Pe=>{const Be=E(Pe);Be!==void 0&&(Ve.push(Pe),Le.push(Be))})),R(Ve),s==null||s(Ve,Le,{type:_e})},[R,E,s,t]),be=C.useCallback((je,_e,Ve,Le)=>{if(a){const Pe=Ve.map(Be=>E(Be));a(E(je),_e,Pe,Le)}ye(Ve,"single")},[a,E,ye]),Ge=C.useMemo(()=>!g||v?null:(g===!0?[BH,WH,$H]:g).map(_e=>_e===BH?{key:"all",text:M.selectionAll,onSelect(){ye(S.map((Ve,Le)=>D(Ve,Le)).filter(Ve=>{const Le=U.get(Ve);return!(Le!=null&&Le.disabled)||J.has(Ve)}),"all")}}:_e===WH?{key:"invert",text:M.selectInvert,onSelect(){const Ve=new Set(J);L.forEach((Pe,Be)=>{const Qe=D(Pe,Be),Ye=U.get(Qe);Ye!=null&&Ye.disabled||(Ve.has(Qe)?Ve.delete(Qe):Ve.add(Qe))});const Le=Array.from(Ve);c&&c(Le),ye(Le,"invert")}}:_e===$H?{key:"none",text:M.selectNone,onSelect(){u==null||u(),ye(Array.from(J).filter(Ve=>{const Le=U.get(Ve);return Le==null?void 0:Le.disabled}),"none")}}:_e).map(_e=>Object.assign(Object.assign({},_e),{onSelect:function(){for(var Ve,Le,Pe=arguments.length,Be=new Array(Pe),Qe=0;Qe{var _e;if(!e)return je.filter(pe=>pe!==Cm);let Ve=gt(je);const Le=new Set(J),Pe=G.map(D).filter(pe=>!U.get(pe).disabled),Be=Pe.every(pe=>Le.has(pe)),Qe=Pe.some(pe=>Le.has(pe)),Ye=()=>{const pe=[];Be?Pe.forEach(oe=>{Le.delete(oe),pe.push(oe)}):Pe.forEach(oe=>{Le.has(oe)||(Le.add(oe),pe.push(oe))});const ke=Array.from(Le);l==null||l(!Be,ke.map(oe=>E(oe)),pe.map(oe=>E(oe))),ye(ke,"all"),ge(null)};let We;if(f!=="radio"){let pe;if(Ge){const Ie={getPopupContainer:P,items:Ge.map((Te,He)=>{const{key:Me,text:bt,onSelect:rt}=Te;return{key:Me??He,onClick:()=>{rt==null||rt(Pe)},label:bt}})};pe=C.createElement("div",{className:`${y}-selection-extra`},C.createElement(GD,{menu:Ie,getPopupContainer:P},C.createElement("span",null,C.createElement(Dq,null))))}const ke=G.map((Ie,Te)=>{const He=D(Ie,Te),Me=U.get(He)||{};return Object.assign({checked:Le.has(He)},Me)}).filter(Ie=>{let{disabled:Te}=Ie;return Te}),oe=!!ke.length&&ke.length===G.length,ce=oe&&ke.every(Ie=>{let{checked:Te}=Ie;return Te}),fe=oe&&ke.some(Ie=>{let{checked:Te}=Ie;return Te});We=!v&&C.createElement("div",{className:`${y}-selection`},C.createElement(gA,{checked:oe?ce:!!G.length&&Be,indeterminate:oe?!ce&&fe:!Be&&Qe,onChange:Ye,disabled:G.length===0||oe,"aria-label":pe?"Custom selection":"Select all",skipGroup:!0}),pe)}let dt;f==="radio"?dt=(pe,ke,oe)=>{const ce=D(ke,oe),fe=Le.has(ce);return{node:C.createElement(X0e,Object.assign({},U.get(ce),{checked:fe,onClick:Ie=>Ie.stopPropagation(),onChange:Ie=>{Le.has(ce)||be(ce,!0,[ce],Ie.nativeEvent)}})),checked:fe}}:dt=(pe,ke,oe)=>{var ce;const fe=D(ke,oe),Ie=Le.has(fe),Te=Q.has(fe),He=U.get(fe);let Me;return k==="nest"?Me=Te:Me=(ce=He==null?void 0:He.indeterminate)!==null&&ce!==void 0?ce:Te,{node:C.createElement(gA,Object.assign({},He,{indeterminate:Me,checked:Ie,skipGroup:!0,onClick:bt=>bt.stopPropagation(),onChange:bt=>{let{nativeEvent:rt}=bt;const{shiftKey:Ht}=rt;let Ue=-1,Ct=-1;if(Ht&&_){const Dt=new Set([he,fe]);Pe.some((St,Kt)=>{if(Dt.has(St))if(Ue===-1)Ue=Kt;else return Ct=Kt,!0;return!1})}if(Ct!==-1&&Ue!==Ct&&_){const Dt=Pe.slice(Ue,Ct+1),St=[];Ie?Dt.forEach(_n=>{Le.has(_n)&&(St.push(_n),Le.delete(_n))}):Dt.forEach(_n=>{Le.has(_n)||(St.push(_n),Le.add(_n))});const Kt=Array.from(Le);d==null||d(!Ie,Kt.map(_n=>E(_n)),St.map(_n=>E(_n))),ye(Kt,"multiple")}else{const Dt=ie;if(_){const St=Ie?qh(Dt,fe):Dg(Dt,fe);be(fe,!Ie,St,rt)}else{const St=zy([].concat(gt(Dt),[fe]),!0,$,j),{checkedKeys:Kt,halfCheckedKeys:_n}=St;let zt=Kt;if(Ie){const Yt=new Set(Kt);Yt.delete(fe),zt=zy(Array.from(Yt),{checked:!1,halfCheckedKeys:_n},$,j).checkedKeys}be(fe,!Ie,zt,rt)}}ge(Ie?null:fe)}})),checked:Ie}};const re=(pe,ke,oe)=>{const{node:ce,checked:fe}=dt(pe,ke,oe);return m?m(fe,ke,oe,ce):ce};if(!Ve.includes(Cm))if(Ve.findIndex(pe=>{var ke;return((ke=pe[RE])===null||ke===void 0?void 0:ke.columnType)==="EXPAND_COLUMN"})===0){const[pe,...ke]=Ve;Ve=[pe,Cm].concat(gt(ke))}else Ve=[Cm].concat(gt(Ve));const ue=Ve.indexOf(Cm);Ve=Ve.filter((pe,ke)=>pe!==Cm||ke===ue);const de=Ve[ue-1],z=Ve[ue+1];let q=p;q===void 0&&((z==null?void 0:z.fixed)!==void 0?q=z.fixed:(de==null?void 0:de.fixed)!==void 0&&(q=de.fixed)),q&&de&&((_e=de[RE])===null||_e===void 0?void 0:_e.columnType)==="EXPAND_COLUMN"&&de.fixed===void 0&&(de.fixed=q);const se=De(`${y}-selection-col`,{[`${y}-selection-col-with-dropdown`]:g&&f==="checkbox"}),ne={fixed:q,width:h,className:`${y}-selection-column`,title:e.columnTitle||We,render:re,[RE]:{className:se}};return Ve.map(pe=>pe===Cm?ne:pe)},[D,G,e,ie,J,Q,h,Ge,k,he,U,d,be,j]),J]},IM="ascend",X6="descend";function bA(i){return typeof i.sorter=="object"&&typeof i.sorter.multiple=="number"?i.sorter.multiple:!1}function joe(i){return typeof i=="function"?i:i&&typeof i=="object"&&i.compare?i.compare:!1}function cZe(i,e){return e?i[i.indexOf(e)+1]:i[0]}function HH(i,e,t){let n=[];function r(o,s){n.push({column:o,key:Rb(o,s),multiplePriority:bA(o),sortOrder:o.sortOrder})}return(i||[]).forEach((o,s)=>{const a=sT(s,t);o.children?("sortOrder"in o&&r(o,a),n=[].concat(gt(n),gt(HH(o.children,e,a)))):o.sorter&&("sortOrder"in o?r(o,a):e&&o.defaultSortOrder&&n.push({column:o,key:Rb(o,a),multiplePriority:bA(o),sortOrder:o.defaultSortOrder}))}),n}function Ybe(i,e,t,n,r,o,s,a){return(e||[]).map((l,c)=>{const u=sT(c,a);let d=l;if(d.sorter){const h=d.sortDirections||r,f=d.showSorterTooltip===void 0?s:d.showSorterTooltip,g=Rb(d,u),p=t.find(T=>{let{key:M}=T;return M===g}),m=p?p.sortOrder:null,v=cZe(h,m),_=h.includes(IM)&&C.createElement(X5e,{className:De(`${i}-column-sorter-up`,{active:m===IM})}),y=h.includes(X6)&&C.createElement(z5e,{className:De(`${i}-column-sorter-down`,{active:m===X6})}),{cancelSort:S,triggerAsc:L,triggerDesc:E}=o||{};let D=S;v===X6?D=E:v===IM&&(D=L);const k=typeof f=="object"?f:{title:D};d=Object.assign(Object.assign({},d),{className:De(d.className,{[`${i}-column-sort`]:m}),title:T=>{const M=C.createElement("div",{className:`${i}-column-sorters`},C.createElement("span",{className:`${i}-column-title`},J4(l.title,T)),C.createElement("span",{className:De(`${i}-column-sorter`,{[`${i}-column-sorter-full`]:!!(_&&y)})},C.createElement("span",{className:`${i}-column-sorter-inner`,"aria-hidden":"true"},_,y)));return f?C.createElement(Qk,Object.assign({},k),M):M},onHeaderCell:T=>{const M=l.onHeaderCell&&l.onHeaderCell(T)||{},P=M.onClick,N=M.onKeyDown;M.onClick=B=>{n({column:l,key:g,sortOrder:v,multiplePriority:bA(l)}),P==null||P(B)},M.onKeyDown=B=>{B.keyCode===_t.ENTER&&(n({column:l,key:g,sortOrder:v,multiplePriority:bA(l)}),N==null||N(B))};const R=LYe(l.title,{}),O=R==null?void 0:R.toString();return m?M["aria-sort"]=m==="ascend"?"ascending":"descending":M["aria-label"]=O||"",M.className=De(M.className,`${i}-column-has-sorters`),M.tabIndex=0,l.ellipsis&&(M.title=(R??"").toString()),M}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:Ybe(i,d.children,t,n,r,o,s,u)})),d})}function Koe(i){const{column:e,sortOrder:t}=i;return{column:e,order:t,field:e.dataIndex,columnKey:e.key}}function Goe(i){const e=i.filter(t=>{let{sortOrder:n}=t;return n}).map(Koe);return e.length===0&&i.length?Object.assign(Object.assign({},Koe(i[i.length-1])),{column:void 0}):e.length<=1?e[0]||{}:e}function VH(i,e,t){const n=e.slice().sort((s,a)=>a.multiplePriority-s.multiplePriority),r=i.slice(),o=n.filter(s=>{let{column:{sorter:a},sortOrder:l}=s;return joe(a)&&l});return o.length?r.sort((s,a)=>{for(let l=0;l{const a=s[t];return a?Object.assign(Object.assign({},s),{[t]:VH(a,e,t)}):s}):r}function uZe(i){let{prefixCls:e,mergedColumns:t,onSorterChange:n,sortDirections:r,tableLocale:o,showSorterTooltip:s}=i;const[a,l]=C.useState(HH(t,!0)),c=C.useMemo(()=>{let g=!0;const p=HH(t,!1);if(!p.length)return a;const m=[];function v(y){g?m.push(y):m.push(Object.assign(Object.assign({},y),{sortOrder:null}))}let _=null;return p.forEach(y=>{_===null?(v(y),y.sortOrder&&(y.multiplePriority===!1?g=!1:_=!0)):(_&&y.multiplePriority!==!1||(g=!1),v(y))}),m},[t,a]),u=C.useMemo(()=>{const g=c.map(p=>{let{column:m,sortOrder:v}=p;return{column:m,order:v}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]);function d(g){let p;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?p=[g]:p=[].concat(gt(c.filter(m=>{let{key:v}=m;return v!==g.key})),[g]),l(p),n(Goe(p),p)}return[g=>Ybe(e,g,c,d,r,o,s),c,u,()=>Goe(c)]}function Zbe(i,e){return i.map(t=>{const n=Object.assign({},t);return n.title=J4(t.title,e),"children"in n&&(n.children=Zbe(n.children,e)),n})}function dZe(i){return[C.useCallback(t=>Zbe(t,i),[i])]}const hZe=i=>{const{componentCls:e}=i,t=`${i.lineWidth}px ${i.lineType} ${i.tableBorderColor}`,n=(r,o,s)=>({[`&${e}-${r}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{[` + `]:{background:i.colorPrimary},[`${e}-switcher`]:{color:i.colorTextLightSolid},[`${e}-node-content-wrapper`]:{color:i.colorTextLightSolid,background:"transparent"}}}}}},WYe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,r=e.paddingXS/2,o=e.controlHeightSM,s=Bi(e,{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o});return[FYe(i,s),BYe(s)]},$Ye=yo("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:nbe(`${t}-checkbox`,i)},WYe(t,i),m_e(i)]}),Boe=4;function HYe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:r,direction:o="ltr"}=i,s=o==="ltr"?"left":"right",a=o==="ltr"?"right":"left",l={[s]:-t*r+Boe,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=r+Boe;break}return qe.createElement("div",{style:l,className:`${n}-drop-indicator`})}const VYe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:r}=i,{isLeaf:o,expanded:s,loading:a}=n;if(a)return C.createElement(AD,{className:`${e}-switcher-loading-icon`});let l;if(r&&typeof r=="object"&&(l=r.showLeafIcon),o){if(!r)return null;if(typeof l!="boolean"&&l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return uh(d)?ta(d,{className:De(d.props.className||"",h)}):d}return l?C.createElement(Rme,{className:`${e}-switcher-line-icon`}):C.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return uh(u)?ta(u,{className:De(u.props.className||"",c)}):u!==void 0?u:r?s?C.createElement(qBe,{className:`${e}-switcher-line-icon`}):C.createElement(ZBe,{className:`${e}-switcher-line-icon`}):C.createElement($5e,{className:c})},zYe=VYe,UYe=qe.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n,virtual:r}=qe.useContext(Pn),{prefixCls:o,className:s,showIcon:a=!1,showLine:l,switcherIcon:c,blockNode:u=!1,children:d,checkable:h=!1,selectable:f=!0,draggable:g,motion:p}=i,m=t("tree",o),v=t(),_=p??Object.assign(Object.assign({},l_e(v)),{motionAppear:!1}),y=Object.assign(Object.assign({},i),{checkable:h,selectable:f,showIcon:a,motion:_,blockNode:u,showLine:!!l,dropIndicatorRender:HYe}),[S,L]=$Ye(m),E=qe.useMemo(()=>{if(!g)return!1;let k={};switch(typeof g){case"function":k.nodeDraggable=g;break;case"object":k=Object.assign({},g);break}return k.icon!==!1&&(k.icon=k.icon||qe.createElement(FBe,null)),k},[g]),D=k=>qe.createElement(zYe,{prefixCls:m,switcherIcon:c,treeNodeProps:k,showLine:l});return S(qe.createElement(PX,Object.assign({itemHeight:20,ref:e,virtual:r},y,{prefixCls:m,className:De({[`${m}-icon-hide`]:!a,[`${m}-block-node`]:u,[`${m}-unselectable`]:!f,[`${m}-rtl`]:n==="rtl"},s,L),direction:n,checkable:h&&qe.createElement("span",{className:`${m}-checkbox-inner`}),selectable:f,switcherIcon:D,draggable:E}),d))}),zbe=UYe;var Ng;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(Ng||(Ng={}));function AX(i,e){function t(n){const{key:r,children:o}=n;e(r,n)!==!1&&AX(o||[],e)}i.forEach(t)}function jYe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:r}=i;const o=[];let s=Ng.None;if(n&&n===r)return[n];if(!n||!r)return[];function a(l){return l===n||l===r}return AX(e,l=>{if(s===Ng.End)return!1;if(a(l)){if(o.push(l),s===Ng.None)s=Ng.Start;else if(s===Ng.Start)return s=Ng.End,!1}else s===Ng.Start&&o.push(l);return t.includes(l)}),o}function q6(i,e){const t=gt(e),n=[];return AX(i,(r,o)=>{const s=t.indexOf(r);return s!==-1&&(n.push(o),t.splice(s,1)),!!t.length}),n}var Woe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:r}=i,o=Woe(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=C.useRef(),a=C.useRef(),l=()=>{const{keyEntities:k}=xX($oe(o));let T;return t?T=Object.keys(k):n?T=IH(o.expandedKeys||r||[],k):T=o.expandedKeys||r,T},[c,u]=C.useState(o.selectedKeys||o.defaultSelectedKeys||[]),[d,h]=C.useState(()=>l());C.useEffect(()=>{"selectedKeys"in o&&u(o.selectedKeys)},[o.selectedKeys]),C.useEffect(()=>{"expandedKeys"in o&&h(o.expandedKeys)},[o.expandedKeys]);const f=(k,T)=>{var M;return"expandedKeys"in o||h(k),(M=o.onExpand)===null||M===void 0?void 0:M.call(o,k,T)},g=(k,T)=>{var M;const{multiple:P}=o,{node:N,nativeEvent:R}=T,{key:O=""}=N,B=$oe(o),$=Object.assign(Object.assign({},T),{selected:!0}),G=(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey),U=R==null?void 0:R.shiftKey;let j;P&&G?(j=k,s.current=O,a.current=j,$.selectedNodes=q6(B,j)):P&&U?(j=Array.from(new Set([].concat(gt(a.current||[]),gt(jYe({treeData:B,expandedKeys:d,startKey:O,endKey:s.current}))))),$.selectedNodes=q6(B,j)):(j=[O],s.current=O,a.current=j,$.selectedNodes=q6(B,j)),(M=o.onSelect)===null||M===void 0||M.call(o,j,$),"selectedKeys"in o||u(j)},{getPrefixCls:p,direction:m}=C.useContext(Pn),{prefixCls:v,className:_,showIcon:y=!0,expandAction:S="click"}=o,L=Woe(o,["prefixCls","className","showIcon","expandAction"]),E=p("tree",v),D=De(`${E}-directory`,{[`${E}-directory-rtl`]:m==="rtl"},_);return C.createElement(zbe,Object.assign({icon:KYe,ref:e,blockNode:!0},L,{showIcon:y,expandAction:S,prefixCls:E,className:D,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},qYe=C.forwardRef(GYe),XYe=qYe,OX=zbe;OX.DirectoryTree=XYe;OX.TreeNode=Ww;const YYe=OX;function ZYe(i){const e=C.useRef(i),t=Y_e();return[()=>e.current,n=>{e.current=n,t()}]}function Hoe(i){let{value:e,onChange:t,filterSearch:n,tablePrefixCls:r,locale:o}=i;return n?C.createElement("div",{className:`${r}-filter-dropdown-search`},C.createElement(nqe,{prefix:C.createElement(Iq,null),placeholder:o.filterSearchPlaceholder,onChange:t,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const QYe=i=>{const{keyCode:e}=i;e===_t.ENTER&&i.stopPropagation()},JYe=i=>C.createElement("div",{className:i.className,onClick:e=>e.stopPropagation(),onKeyDown:QYe},i.children),eZe=JYe;function tZe(i){return i.some(e=>{let{children:t}=e;return t})}function Ube(i,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(i.trim().toLowerCase()):!1}function jbe(i){let{filters:e,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s}=i;return e.map((a,l)=>{const c=String(a.value);if(a.children)return{key:c||l,label:a.text,popupClassName:`${t}-dropdown-submenu`,children:jbe({filters:a.children,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s})};const u=r?gA:X0e,d={key:a.value!==void 0?c:l,label:C.createElement(C.Fragment,null,C.createElement(u,{checked:n.includes(c)}),C.createElement("span",null,a.text))};return o.trim()?typeof s=="function"?s(o,a)?d:null:Ube(o,a.text)?d:null:d})}function nZe(i){var e,t;const{tablePrefixCls:n,prefixCls:r,column:o,dropdownPrefixCls:s,columnKey:a,filterMultiple:l,filterMode:c="menu",filterSearch:u=!1,filterState:d,triggerFilter:h,locale:f,children:g,getPopupContainer:p}=i,{filterDropdownOpen:m,onFilterDropdownOpenChange:v,filterResetToDefaultFilteredValue:_,defaultFilteredValue:y,filterDropdownVisible:S,onFilterDropdownVisibleChange:L}=o,[E,D]=C.useState(!1),k=!!(d&&(!((e=d.filteredKeys)===null||e===void 0)&&e.length||d.forceFiltered)),T=Be=>{D(Be),v==null||v(Be),L==null||L(Be)},M=(t=m??S)!==null&&t!==void 0?t:E,P=d==null?void 0:d.filteredKeys,[N,R]=ZYe(P||[]),O=Be=>{let{selectedKeys:Qe}=Be;R(Qe)},B=(Be,Qe)=>{let{node:Ye,checked:We}=Qe;O(l?{selectedKeys:Be}:{selectedKeys:We&&Ye.key?[Ye.key]:[]})};C.useEffect(()=>{E&&O({selectedKeys:P||[]})},[P]);const[$,G]=C.useState([]),U=Be=>{G(Be)},[j,ie]=C.useState(""),Y=Be=>{const{value:Qe}=Be.target;ie(Qe)};C.useEffect(()=>{E||ie("")},[E]);const J=Be=>{const Qe=Be&&Be.length?Be:null;if(Qe===null&&(!d||!d.filteredKeys)||Tp(Qe,d==null?void 0:d.filteredKeys,!0))return null;h({column:o,key:a,filteredKeys:Qe})},Q=()=>{T(!1),J(N())},he=function(){let{confirm:Be,closeDropdown:Qe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};Be&&J([]),Qe&&T(!1),ie(""),R(_?(y||[]).map(Ye=>String(Ye)):[])},ge=function(){let{closeDropdown:Be}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};Be&&T(!1),J(N())},ye=Be=>{Be&&P!==void 0&&R(P||[]),T(Be),!Be&&!o.filterDropdown&&Q()},be=De({[`${s}-menu-without-submenu`]:!tZe(o.filters||[])}),Ge=Be=>{if(Be.target.checked){const Qe=Uy(o==null?void 0:o.filters).map(Ye=>String(Ye));R(Qe)}else R([])},nt=Be=>{let{filters:Qe}=Be;return(Qe||[]).map((Ye,We)=>{const dt=String(Ye.value),re={title:Ye.text,key:Ye.value!==void 0?dt:We};return Ye.children&&(re.children=nt({filters:Ye.children})),re})},je=Be=>{var Qe;return Object.assign(Object.assign({},Be),{text:Be.title,value:Be.key,children:((Qe=Be.children)===null||Qe===void 0?void 0:Qe.map(Ye=>je(Ye)))||[]})};let _e;if(typeof o.filterDropdown=="function")_e=o.filterDropdown({prefixCls:`${s}-custom`,setSelectedKeys:Be=>O({selectedKeys:Be}),selectedKeys:N(),confirm:ge,clearFilters:he,filters:o.filters,visible:M,close:()=>{T(!1)}});else if(o.filterDropdown)_e=o.filterDropdown;else{const Be=N()||[],Qe=()=>(o.filters||[]).length===0?C.createElement(E0,{image:E0.PRESENTED_IMAGE_SIMPLE,description:f.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):c==="tree"?C.createElement(C.Fragment,null,C.createElement(Hoe,{filterSearch:u,value:j,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement("div",{className:`${n}-filter-dropdown-tree`},l?C.createElement(gA,{checked:Be.length===Uy(o.filters).length,indeterminate:Be.length>0&&Be.lengthtypeof u=="function"?u(j,je(We)):Ube(j,We.title):void 0}))):C.createElement(C.Fragment,null,C.createElement(Hoe,{filterSearch:u,value:j,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement(vX,{selectable:!0,multiple:l,prefixCls:`${s}-menu`,className:be,onSelect:O,onDeselect:O,selectedKeys:Be,getPopupContainer:p,openKeys:$,onOpenChange:U,items:jbe({filters:o.filters||[],filterSearch:u,prefixCls:r,filteredKeys:N(),filterMultiple:l,searchValue:j})})),Ye=()=>_?Tp((y||[]).map(We=>String(We)),Be,!0):Be.length===0;_e=C.createElement(C.Fragment,null,Qe(),C.createElement("div",{className:`${r}-dropdown-btns`},C.createElement(ed,{type:"link",size:"small",disabled:Ye(),onClick:()=>he()},f.filterReset),C.createElement(ed,{type:"primary",size:"small",onClick:Q},f.filterConfirm)))}o.filterDropdown&&(_e=C.createElement(A0e,{selectable:void 0},_e));const Ve=()=>C.createElement(eZe,{className:`${r}-dropdown`},_e);let Le;typeof o.filterIcon=="function"?Le=o.filterIcon(k):o.filterIcon?Le=o.filterIcon:Le=C.createElement(EBe,null);const{direction:Pe}=C.useContext(Pn);return C.createElement("div",{className:`${r}-column`},C.createElement("span",{className:`${n}-column-title`},g),C.createElement(GD,{dropdownRender:Ve,trigger:["click"],open:M,onOpenChange:ye,getPopupContainer:p,placement:Pe==="rtl"?"bottomLeft":"bottomRight"},C.createElement("span",{role:"button",tabIndex:-1,className:De(`${r}-trigger`,{active:k}),onClick:Be=>{Be.stopPropagation()}},Le)))}function FH(i,e,t){let n=[];return(i||[]).forEach((r,o)=>{var s;const a=sT(o,t);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let l=r.filteredValue;"filterDropdown"in r||(l=(s=l==null?void 0:l.map(String))!==null&&s!==void 0?s:l),n.push({column:r,key:Mb(r,a),filteredKeys:l,forceFiltered:r.filtered})}else n.push({column:r,key:Mb(r,a),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(n=[].concat(gt(n),gt(FH(r.children,e,a))))}),n}function Kbe(i,e,t,n,r,o,s,a){return t.map((l,c)=>{const u=sT(c,a),{filterMultiple:d=!0,filterMode:h,filterSearch:f}=l;let g=l;if(g.filters||g.filterDropdown){const p=Mb(g,u),m=n.find(v=>{let{key:_}=v;return p===_});g=Object.assign(Object.assign({},g),{title:v=>C.createElement(nZe,{tablePrefixCls:i,prefixCls:`${i}-filter`,dropdownPrefixCls:e,column:g,columnKey:p,filterState:m,filterMultiple:d,filterMode:h,filterSearch:f,triggerFilter:o,locale:r,getPopupContainer:s},J4(l.title,v))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:Kbe(i,e,g.children,n,r,o,s,u)})),g})}function Uy(i){let e=[];return(i||[]).forEach(t=>{let{value:n,children:r}=t;e.push(n),r&&(e=[].concat(gt(e),gt(Uy(r))))}),e}function Voe(i){const e={};return i.forEach(t=>{let{key:n,filteredKeys:r,column:o}=t;const{filters:s,filterDropdown:a}=o;if(a)e[n]=r||null;else if(Array.isArray(r)){const l=Uy(s);e[n]=l.filter(c=>r.includes(String(c)))}else e[n]=null}),e}function zoe(i,e){return e.reduce((t,n)=>{const{column:{onFilter:r,filters:o},filteredKeys:s}=n;return r&&s&&s.length?t.filter(a=>s.some(l=>{const c=Uy(o),u=c.findIndex(h=>String(h)===String(l)),d=u!==-1?c[u]:l;return r(d,a)})):t},i)}const Gbe=i=>i.flatMap(e=>"children"in e?[e].concat(gt(Gbe(e.children||[]))):[e]);function iZe(i){let{prefixCls:e,dropdownPrefixCls:t,mergedColumns:n,onFilterChange:r,getPopupContainer:o,locale:s}=i;const a=C.useMemo(()=>Gbe(n||[]),[n]),[l,c]=C.useState(()=>FH(a,!0)),u=C.useMemo(()=>{const g=FH(a,!1);if(g.length===0)return g;let p=!0;if(g.forEach(m=>{let{filteredKeys:v}=m;v!==void 0&&(p=!1)}),p){const m=(a||[]).map((v,_)=>Mb(v,sT(_)));return l.filter(v=>{let{key:_}=v;return m.includes(_)}).map(v=>{const _=a[m.findIndex(y=>y===v.key)];return Object.assign(Object.assign({},v),{column:Object.assign(Object.assign({},v.column),_),forceFiltered:_.filtered})})}return g},[a,l]),d=C.useMemo(()=>Voe(u),[u]),h=g=>{const p=u.filter(m=>{let{key:v}=m;return v!==g.key});p.push(g),c(p),r(Voe(p),p)};return[g=>Kbe(e,t,g,u,s,h,o),u,d]}function rZe(i,e,t){const n=C.useRef({});function r(o){if(!n.current||n.current.data!==i||n.current.childrenColumnName!==e||n.current.getRowKey!==t){let a=function(l){l.forEach((c,u)=>{const d=t(c,u);s.set(d,c),c&&typeof c=="object"&&e in c&&a(c[e]||[])})};const s=new Map;a(i),n.current={data:i,childrenColumnName:e,kvMap:s,getRowKey:t}}return n.current.kvMap.get(o)}return[r]}var oZe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const o=i[r];typeof o!="function"&&(t[r]=o)}),t}function aZe(i,e,t){const n=t&&typeof t=="object"?t:{},{total:r=0}=n,o=oZe(n,["total"]),[s,a]=C.useState(()=>({current:"defaultCurrent"in o?o.defaultCurrent:1,pageSize:"defaultPageSize"in o?o.defaultPageSize:qbe})),l=Cbe(s,o,{total:r>0?r:i}),c=Math.ceil((r||i)/l.pageSize);l.current>c&&(l.current=c||1);const u=(h,f)=>{a({current:h??1,pageSize:f||l.pageSize})},d=(h,f)=>{var g;t&&((g=t.onChange)===null||g===void 0||g.call(t,h,f)),u(h,f),e(h,f||(l==null?void 0:l.pageSize))};return t===!1?[{},()=>{}]:[Object.assign(Object.assign({},l),{onChange:d}),u]}const Cm={},BH="SELECT_ALL",WH="SELECT_INVERT",$H="SELECT_NONE",Uoe=[],Xbe=(i,e)=>{let t=[];return(e||[]).forEach(n=>{t.push(n),n&&typeof n=="object"&&i in n&&(t=[].concat(gt(t),gt(Xbe(i,n[i]))))}),t},lZe=(i,e)=>{const{preserveSelectedRowKeys:t,selectedRowKeys:n,defaultSelectedRowKeys:r,getCheckboxProps:o,onChange:s,onSelect:a,onSelectAll:l,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:h,type:f,selections:g,fixed:p,renderCell:m,hideSelectAll:v,checkStrictly:_=!0}=e||{},{prefixCls:y,data:S,pageData:L,getRecordByKey:E,getRowKey:D,expandType:k,childrenColumnName:T,locale:M,getPopupContainer:P}=i,[N,R]=nl(n||r||Uoe,{value:n}),O=C.useRef(new Map),B=C.useCallback(je=>{if(t){const _e=new Map;je.forEach(Ve=>{let Le=E(Ve);!Le&&O.current.has(Ve)&&(Le=O.current.get(Ve)),_e.set(Ve,Le)}),O.current=_e}},[E,t]);C.useEffect(()=>{B(N)},[N]);const{keyEntities:$}=C.useMemo(()=>_?{keyEntities:null}:xX(S,{externalGetKey:D,childrenPropName:T}),[S,D,_,T]),G=C.useMemo(()=>Xbe(T,L),[T,L]),U=C.useMemo(()=>{const je=new Map;return G.forEach((_e,Ve)=>{const Le=D(_e,Ve),Pe=(o?o(_e):null)||{};je.set(Le,Pe)}),je},[G,D,o]),j=C.useCallback(je=>{var _e;return!!(!((_e=U.get(D(je)))===null||_e===void 0)&&_e.disabled)},[U,D]),[ie,Y]=C.useMemo(()=>{if(_)return[N||[],[]];const{checkedKeys:je,halfCheckedKeys:_e}=zy(N,!0,$,j);return[je||[],_e]},[N,_,$,j]),J=C.useMemo(()=>{const je=f==="radio"?ie.slice(0,1):ie;return new Set(je)},[ie,f]),Q=C.useMemo(()=>f==="radio"?new Set:new Set(Y),[Y,f]),[he,ge]=C.useState(null);C.useEffect(()=>{e||R(Uoe)},[!!e]);const ye=C.useCallback((je,_e)=>{let Ve,Le;B(je),t?(Ve=je,Le=je.map(Pe=>O.current.get(Pe))):(Ve=[],Le=[],je.forEach(Pe=>{const Be=E(Pe);Be!==void 0&&(Ve.push(Pe),Le.push(Be))})),R(Ve),s==null||s(Ve,Le,{type:_e})},[R,E,s,t]),be=C.useCallback((je,_e,Ve,Le)=>{if(a){const Pe=Ve.map(Be=>E(Be));a(E(je),_e,Pe,Le)}ye(Ve,"single")},[a,E,ye]),Ge=C.useMemo(()=>!g||v?null:(g===!0?[BH,WH,$H]:g).map(_e=>_e===BH?{key:"all",text:M.selectionAll,onSelect(){ye(S.map((Ve,Le)=>D(Ve,Le)).filter(Ve=>{const Le=U.get(Ve);return!(Le!=null&&Le.disabled)||J.has(Ve)}),"all")}}:_e===WH?{key:"invert",text:M.selectInvert,onSelect(){const Ve=new Set(J);L.forEach((Pe,Be)=>{const Qe=D(Pe,Be),Ye=U.get(Qe);Ye!=null&&Ye.disabled||(Ve.has(Qe)?Ve.delete(Qe):Ve.add(Qe))});const Le=Array.from(Ve);c&&c(Le),ye(Le,"invert")}}:_e===$H?{key:"none",text:M.selectNone,onSelect(){u==null||u(),ye(Array.from(J).filter(Ve=>{const Le=U.get(Ve);return Le==null?void 0:Le.disabled}),"none")}}:_e).map(_e=>Object.assign(Object.assign({},_e),{onSelect:function(){for(var Ve,Le,Pe=arguments.length,Be=new Array(Pe),Qe=0;Qe{var _e;if(!e)return je.filter(pe=>pe!==Cm);let Ve=gt(je);const Le=new Set(J),Pe=G.map(D).filter(pe=>!U.get(pe).disabled),Be=Pe.every(pe=>Le.has(pe)),Qe=Pe.some(pe=>Le.has(pe)),Ye=()=>{const pe=[];Be?Pe.forEach(oe=>{Le.delete(oe),pe.push(oe)}):Pe.forEach(oe=>{Le.has(oe)||(Le.add(oe),pe.push(oe))});const ke=Array.from(Le);l==null||l(!Be,ke.map(oe=>E(oe)),pe.map(oe=>E(oe))),ye(ke,"all"),ge(null)};let We;if(f!=="radio"){let pe;if(Ge){const Ie={getPopupContainer:P,items:Ge.map((Te,He)=>{const{key:Me,text:bt,onSelect:rt}=Te;return{key:Me??He,onClick:()=>{rt==null||rt(Pe)},label:bt}})};pe=C.createElement("div",{className:`${y}-selection-extra`},C.createElement(GD,{menu:Ie,getPopupContainer:P},C.createElement("span",null,C.createElement(Dq,null))))}const ke=G.map((Ie,Te)=>{const He=D(Ie,Te),Me=U.get(He)||{};return Object.assign({checked:Le.has(He)},Me)}).filter(Ie=>{let{disabled:Te}=Ie;return Te}),oe=!!ke.length&&ke.length===G.length,ce=oe&&ke.every(Ie=>{let{checked:Te}=Ie;return Te}),fe=oe&&ke.some(Ie=>{let{checked:Te}=Ie;return Te});We=!v&&C.createElement("div",{className:`${y}-selection`},C.createElement(gA,{checked:oe?ce:!!G.length&&Be,indeterminate:oe?!ce&&fe:!Be&&Qe,onChange:Ye,disabled:G.length===0||oe,"aria-label":pe?"Custom selection":"Select all",skipGroup:!0}),pe)}let dt;f==="radio"?dt=(pe,ke,oe)=>{const ce=D(ke,oe),fe=Le.has(ce);return{node:C.createElement(X0e,Object.assign({},U.get(ce),{checked:fe,onClick:Ie=>Ie.stopPropagation(),onChange:Ie=>{Le.has(ce)||be(ce,!0,[ce],Ie.nativeEvent)}})),checked:fe}}:dt=(pe,ke,oe)=>{var ce;const fe=D(ke,oe),Ie=Le.has(fe),Te=Q.has(fe),He=U.get(fe);let Me;return k==="nest"?Me=Te:Me=(ce=He==null?void 0:He.indeterminate)!==null&&ce!==void 0?ce:Te,{node:C.createElement(gA,Object.assign({},He,{indeterminate:Me,checked:Ie,skipGroup:!0,onClick:bt=>bt.stopPropagation(),onChange:bt=>{let{nativeEvent:rt}=bt;const{shiftKey:Ht}=rt;let Ue=-1,Ct=-1;if(Ht&&_){const Dt=new Set([he,fe]);Pe.some((St,Kt)=>{if(Dt.has(St))if(Ue===-1)Ue=Kt;else return Ct=Kt,!0;return!1})}if(Ct!==-1&&Ue!==Ct&&_){const Dt=Pe.slice(Ue,Ct+1),St=[];Ie?Dt.forEach(_n=>{Le.has(_n)&&(St.push(_n),Le.delete(_n))}):Dt.forEach(_n=>{Le.has(_n)||(St.push(_n),Le.add(_n))});const Kt=Array.from(Le);d==null||d(!Ie,Kt.map(_n=>E(_n)),St.map(_n=>E(_n))),ye(Kt,"multiple")}else{const Dt=ie;if(_){const St=Ie?qh(Dt,fe):Dg(Dt,fe);be(fe,!Ie,St,rt)}else{const St=zy([].concat(gt(Dt),[fe]),!0,$,j),{checkedKeys:Kt,halfCheckedKeys:_n}=St;let zt=Kt;if(Ie){const Yt=new Set(Kt);Yt.delete(fe),zt=zy(Array.from(Yt),{checked:!1,halfCheckedKeys:_n},$,j).checkedKeys}be(fe,!Ie,zt,rt)}}ge(Ie?null:fe)}})),checked:Ie}};const re=(pe,ke,oe)=>{const{node:ce,checked:fe}=dt(pe,ke,oe);return m?m(fe,ke,oe,ce):ce};if(!Ve.includes(Cm))if(Ve.findIndex(pe=>{var ke;return((ke=pe[RE])===null||ke===void 0?void 0:ke.columnType)==="EXPAND_COLUMN"})===0){const[pe,...ke]=Ve;Ve=[pe,Cm].concat(gt(ke))}else Ve=[Cm].concat(gt(Ve));const ue=Ve.indexOf(Cm);Ve=Ve.filter((pe,ke)=>pe!==Cm||ke===ue);const de=Ve[ue-1],z=Ve[ue+1];let q=p;q===void 0&&((z==null?void 0:z.fixed)!==void 0?q=z.fixed:(de==null?void 0:de.fixed)!==void 0&&(q=de.fixed)),q&&de&&((_e=de[RE])===null||_e===void 0?void 0:_e.columnType)==="EXPAND_COLUMN"&&de.fixed===void 0&&(de.fixed=q);const se=De(`${y}-selection-col`,{[`${y}-selection-col-with-dropdown`]:g&&f==="checkbox"}),ne={fixed:q,width:h,className:`${y}-selection-column`,title:e.columnTitle||We,render:re,[RE]:{className:se}};return Ve.map(pe=>pe===Cm?ne:pe)},[D,G,e,ie,J,Q,h,Ge,k,he,U,d,be,j]),J]},IM="ascend",X6="descend";function bA(i){return typeof i.sorter=="object"&&typeof i.sorter.multiple=="number"?i.sorter.multiple:!1}function joe(i){return typeof i=="function"?i:i&&typeof i=="object"&&i.compare?i.compare:!1}function cZe(i,e){return e?i[i.indexOf(e)+1]:i[0]}function HH(i,e,t){let n=[];function r(o,s){n.push({column:o,key:Mb(o,s),multiplePriority:bA(o),sortOrder:o.sortOrder})}return(i||[]).forEach((o,s)=>{const a=sT(s,t);o.children?("sortOrder"in o&&r(o,a),n=[].concat(gt(n),gt(HH(o.children,e,a)))):o.sorter&&("sortOrder"in o?r(o,a):e&&o.defaultSortOrder&&n.push({column:o,key:Mb(o,a),multiplePriority:bA(o),sortOrder:o.defaultSortOrder}))}),n}function Ybe(i,e,t,n,r,o,s,a){return(e||[]).map((l,c)=>{const u=sT(c,a);let d=l;if(d.sorter){const h=d.sortDirections||r,f=d.showSorterTooltip===void 0?s:d.showSorterTooltip,g=Mb(d,u),p=t.find(T=>{let{key:M}=T;return M===g}),m=p?p.sortOrder:null,v=cZe(h,m),_=h.includes(IM)&&C.createElement(X5e,{className:De(`${i}-column-sorter-up`,{active:m===IM})}),y=h.includes(X6)&&C.createElement(z5e,{className:De(`${i}-column-sorter-down`,{active:m===X6})}),{cancelSort:S,triggerAsc:L,triggerDesc:E}=o||{};let D=S;v===X6?D=E:v===IM&&(D=L);const k=typeof f=="object"?f:{title:D};d=Object.assign(Object.assign({},d),{className:De(d.className,{[`${i}-column-sort`]:m}),title:T=>{const M=C.createElement("div",{className:`${i}-column-sorters`},C.createElement("span",{className:`${i}-column-title`},J4(l.title,T)),C.createElement("span",{className:De(`${i}-column-sorter`,{[`${i}-column-sorter-full`]:!!(_&&y)})},C.createElement("span",{className:`${i}-column-sorter-inner`,"aria-hidden":"true"},_,y)));return f?C.createElement(Qk,Object.assign({},k),M):M},onHeaderCell:T=>{const M=l.onHeaderCell&&l.onHeaderCell(T)||{},P=M.onClick,N=M.onKeyDown;M.onClick=B=>{n({column:l,key:g,sortOrder:v,multiplePriority:bA(l)}),P==null||P(B)},M.onKeyDown=B=>{B.keyCode===_t.ENTER&&(n({column:l,key:g,sortOrder:v,multiplePriority:bA(l)}),N==null||N(B))};const R=LYe(l.title,{}),O=R==null?void 0:R.toString();return m?M["aria-sort"]=m==="ascend"?"ascending":"descending":M["aria-label"]=O||"",M.className=De(M.className,`${i}-column-has-sorters`),M.tabIndex=0,l.ellipsis&&(M.title=(R??"").toString()),M}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:Ybe(i,d.children,t,n,r,o,s,u)})),d})}function Koe(i){const{column:e,sortOrder:t}=i;return{column:e,order:t,field:e.dataIndex,columnKey:e.key}}function Goe(i){const e=i.filter(t=>{let{sortOrder:n}=t;return n}).map(Koe);return e.length===0&&i.length?Object.assign(Object.assign({},Koe(i[i.length-1])),{column:void 0}):e.length<=1?e[0]||{}:e}function VH(i,e,t){const n=e.slice().sort((s,a)=>a.multiplePriority-s.multiplePriority),r=i.slice(),o=n.filter(s=>{let{column:{sorter:a},sortOrder:l}=s;return joe(a)&&l});return o.length?r.sort((s,a)=>{for(let l=0;l{const a=s[t];return a?Object.assign(Object.assign({},s),{[t]:VH(a,e,t)}):s}):r}function uZe(i){let{prefixCls:e,mergedColumns:t,onSorterChange:n,sortDirections:r,tableLocale:o,showSorterTooltip:s}=i;const[a,l]=C.useState(HH(t,!0)),c=C.useMemo(()=>{let g=!0;const p=HH(t,!1);if(!p.length)return a;const m=[];function v(y){g?m.push(y):m.push(Object.assign(Object.assign({},y),{sortOrder:null}))}let _=null;return p.forEach(y=>{_===null?(v(y),y.sortOrder&&(y.multiplePriority===!1?g=!1:_=!0)):(_&&y.multiplePriority!==!1||(g=!1),v(y))}),m},[t,a]),u=C.useMemo(()=>{const g=c.map(p=>{let{column:m,sortOrder:v}=p;return{column:m,order:v}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]);function d(g){let p;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?p=[g]:p=[].concat(gt(c.filter(m=>{let{key:v}=m;return v!==g.key})),[g]),l(p),n(Goe(p),p)}return[g=>Ybe(e,g,c,d,r,o,s),c,u,()=>Goe(c)]}function Zbe(i,e){return i.map(t=>{const n=Object.assign({},t);return n.title=J4(t.title,e),"children"in n&&(n.children=Zbe(n.children,e)),n})}function dZe(i){return[C.useCallback(t=>Zbe(t,i),[i])]}const hZe=i=>{const{componentCls:e}=i,t=`${i.lineWidth}px ${i.lineType} ${i.tableBorderColor}`,n=(r,o,s)=>({[`&${e}-${r}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{[` > table > tbody > tr > th, > table > tbody > tr > td `]:{[`> ${e}-expanded-row-fixed`]:{margin:`-${o}px -${s+i.lineWidth}px`}}}}}});return{[`${e}-wrapper`]:{[`${e}${e}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${e}-title`]:{border:t,borderBottom:0},[`> ${e}-container`]:{borderInlineStart:t,[` @@ -426,7 +426,7 @@ html body { `]:{"> table":{borderTop:t}}},[`&${e}-scroll-horizontal`]:{[`> ${e}-container > ${e}-body`]:{"> table > tbody":{[` > tr${e}-expanded-row, > tr${e}-placeholder - `]:{["> th, > td"]:{borderInlineEnd:0}}}}}},n("middle",i.tablePaddingVerticalMiddle,i.tablePaddingHorizontalMiddle)),n("small",i.tablePaddingVerticalSmall,i.tablePaddingHorizontalSmall)),{[`> ${e}-footer`]:{border:t,borderTop:0}}),[`${e}-cell`]:{[`${e}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${i.lineWidth}px 0 ${i.lineWidth}px ${i.tableHeaderBg}`}}}}},fZe=hZe,gZe=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-cell-ellipsis`]:Object.assign(Object.assign({},lb),{wordBreak:"keep-all",[` + `]:{["> th, > td"]:{borderInlineEnd:0}}}}}},n("middle",i.tablePaddingVerticalMiddle,i.tablePaddingHorizontalMiddle)),n("small",i.tablePaddingVerticalSmall,i.tablePaddingHorizontalSmall)),{[`> ${e}-footer`]:{border:t,borderTop:0}}),[`${e}-cell`]:{[`${e}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${i.lineWidth}px 0 ${i.lineWidth}px ${i.tableHeaderBg}`}}}}},fZe=hZe,gZe=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-cell-ellipsis`]:Object.assign(Object.assign({},cb),{wordBreak:"keep-all",[` &${e}-cell-fix-left-last, &${e}-cell-fix-right-first `]:{overflow:"visible",[`${e}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${e}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},pZe=gZe,mZe=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-tbody > tr${e}-placeholder`]:{textAlign:"center",color:i.colorTextDisabled,[` @@ -478,16 +478,16 @@ html body { &${e}-row:hover > td, > th${e}-cell-row-hover > td${e}-cell-row-hover - `]:{background:p},[`&${e}-row-selected`]:{["> th, > td"]:{background:m},["&:hover > th, &:hover > td"]:{background:v}}}},[`${e}-footer`]:{padding:`${n}px ${r}px`,color:_,background:y}})}},$Ze=yo("Table",i=>{const{controlItemBgActive:e,controlItemBgActiveHover:t,colorTextPlaceholder:n,colorTextHeading:r,colorSplit:o,colorBorderSecondary:s,fontSize:a,padding:l,paddingXS:c,paddingSM:u,controlHeight:d,colorFillAlter:h,colorIcon:f,colorIconHover:g,opacityLoading:p,colorBgContainer:m,borderRadiusLG:v,colorFillContent:_,colorFillSecondary:y,controlInteractiveSize:S}=i,L=new Jr(f),E=new Jr(g),D=e,k=2,T=new Jr(y).onBackground(m).toHexShortString(),M=new Jr(_).onBackground(m).toHexShortString(),P=new Jr(h).onBackground(m).toHexShortString(),N=Bi(i,{tableFontSize:a,tableBg:m,tableRadius:v,tablePaddingVertical:l,tablePaddingHorizontal:l,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:c,tablePaddingVerticalSmall:c,tablePaddingHorizontalSmall:c,tableBorderColor:s,tableHeaderTextColor:r,tableHeaderBg:P,tableFooterTextColor:r,tableFooterBg:P,tableHeaderCellSplitColor:s,tableHeaderSortBg:T,tableHeaderSortHoverBg:M,tableHeaderIconColor:L.clone().setAlpha(L.getAlpha()*p).toRgbString(),tableHeaderIconColorHover:E.clone().setAlpha(E.getAlpha()*p).toRgbString(),tableBodySortBg:P,tableFixedHeaderSortActiveBg:T,tableHeaderFilterActiveBg:_,tableFilterDropdownBg:m,tableRowHoverBg:P,tableSelectedRowBg:D,tableSelectedRowHoverBg:t,zIndexTableFixed:k,zIndexTableSticky:k+1,tableFontSizeMiddle:a,tableFontSizeSmall:a,tableSelectionColumnWidth:d,tableExpandIconBg:m,tableExpandColumnWidth:S+2*i.padding,tableExpandedRowBg:h,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:n,tableScrollThumbBgHover:r,tableScrollBg:o});return[WZe(N),LZe(N),qoe(N),AZe(N),yZe(N),fZe(N),DZe(N),bZe(N),qoe(N),vZe(N),NZe(N),SZe(N),FZe(N),pZe(N),MZe(N),kZe(N)]}),HZe=[],VZe=(i,e)=>{const{prefixCls:t,className:n,rootClassName:r,style:o,size:s,bordered:a,dropdownPrefixCls:l,dataSource:c,pagination:u,rowSelection:d,rowKey:h="key",rowClassName:f,columns:g,children:p,childrenColumnName:m,onChange:v,getPopupContainer:_,loading:y,expandIcon:S,expandable:L,expandedRowRender:E,expandIconColumnIndex:D,indentSize:k,scroll:T,sortDirections:M,locale:P,showSorterTooltip:N=!0}=i,R=C.useMemo(()=>g||MX(p),[g,p]),O=C.useMemo(()=>R.some(zt=>zt.responsive),[R]),B=O4(O),$=C.useMemo(()=>{const zt=new Set(Object.keys(B).filter(Yt=>B[Yt]));return R.filter(Yt=>!Yt.responsive||Yt.responsive.some(at=>zt.has(at)))},[R,B]),G=cl(i,["className","style","columns"]),U=C.useContext(Eh),{locale:j=Tb,direction:ie,renderEmpty:Y,getPrefixCls:J,getPopupContainer:Q}=C.useContext(Pn),he=s||U,ge=Object.assign(Object.assign({},j.Table),P),ye=c||HZe,be=J("table",t),Ge=J("dropdown",l),nt=Object.assign({childrenColumnName:m,expandIconColumnIndex:D},L),{childrenColumnName:je="children"}=nt,_e=C.useMemo(()=>ye.some(zt=>zt==null?void 0:zt[je])?"nest":E||L&&L.expandedRowRender?"row":null,[ye]),Ve={body:C.useRef()},Le=C.useMemo(()=>typeof h=="function"?h:zt=>zt==null?void 0:zt[h],[h]),[Pe]=rZe(ye,je,Le),Be={},Qe=function(zt,Yt){let at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var ut,ht,Lt;const At=Object.assign(Object.assign({},Be),zt);at&&((ut=Be.resetPagination)===null||ut===void 0||ut.call(Be),!((ht=At.pagination)===null||ht===void 0)&&ht.current&&(At.pagination.current=1),u&&u.onChange&&u.onChange(1,(Lt=At.pagination)===null||Lt===void 0?void 0:Lt.pageSize)),T&&T.scrollToFirstRowOnChange!==!1&&Ve.body.current&&j7e(0,{getContainer:()=>Ve.body.current}),v==null||v(At.pagination,At.filters,At.sorter,{currentDataSource:zoe(VH(ye,At.sorterStates,je),At.filterStates),action:Yt})},Ye=(zt,Yt)=>{Qe({sorter:zt,sorterStates:Yt},"sort",!1)},[We,dt,re,ue]=uZe({prefixCls:be,mergedColumns:$,onSorterChange:Ye,sortDirections:M||["ascend","descend"],tableLocale:ge,showSorterTooltip:N}),de=C.useMemo(()=>VH(ye,dt,je),[ye,dt]);Be.sorter=ue(),Be.sorterStates=dt;const z=(zt,Yt)=>{Qe({filters:zt,filterStates:Yt},"filter",!0)},[q,se,ne]=iZe({prefixCls:be,locale:ge,dropdownPrefixCls:Ge,mergedColumns:$,onFilterChange:z,getPopupContainer:_||Q}),pe=zoe(de,se);Be.filters=ne,Be.filterStates=se;const ke=C.useMemo(()=>{const zt={};return Object.keys(ne).forEach(Yt=>{ne[Yt]!==null&&(zt[Yt]=ne[Yt])}),Object.assign(Object.assign({},re),{filters:zt})},[re,ne]),[oe]=dZe(ke),ce=(zt,Yt)=>{Qe({pagination:Object.assign(Object.assign({},Be.pagination),{current:zt,pageSize:Yt})},"paginate")},[fe,Ie]=aZe(pe.length,ce,u);Be.pagination=u===!1?{}:sZe(fe,u),Be.resetPagination=Ie;const Te=C.useMemo(()=>{if(u===!1||!fe.pageSize)return pe;const{current:zt=1,total:Yt,pageSize:at=qbe}=fe;return pe.lengthat?pe.slice((zt-1)*at,zt*at):pe:pe.slice((zt-1)*at,zt*at)},[!!u,pe,fe&&fe.current,fe&&fe.pageSize,fe&&fe.total]),[He,Me]=lZe({prefixCls:be,data:pe,pageData:Te,getRowKey:Le,getRecordByKey:Pe,expandType:_e,childrenColumnName:je,locale:ge,getPopupContainer:_||Q},d),bt=(zt,Yt,at)=>{let ut;return typeof f=="function"?ut=De(f(zt,Yt,at)):ut=De(f),De({[`${be}-row-selected`]:Me.has(Le(zt,Yt))},ut)};nt.__PARENT_RENDER_ICON__=nt.expandIcon,nt.expandIcon=nt.expandIcon||S||SYe(ge),_e==="nest"&&nt.expandIconColumnIndex===void 0?nt.expandIconColumnIndex=d?1:0:nt.expandIconColumnIndex>0&&d&&(nt.expandIconColumnIndex-=1),typeof nt.indentSize!="number"&&(nt.indentSize=typeof k=="number"?k:15);const rt=C.useCallback(zt=>oe(He(q(We(zt)))),[We,q,He]);let Ht,Ue;if(u!==!1&&(fe!=null&&fe.total)){let zt;fe.size?zt=fe.size:zt=he==="small"||he==="middle"?"small":void 0;const Yt=ht=>C.createElement(kX,Object.assign({},fe,{className:De(`${be}-pagination ${be}-pagination-${ht}`,fe.className),size:zt})),at=ie==="rtl"?"left":"right",{position:ut}=fe;if(ut!==null&&Array.isArray(ut)){const ht=ut.find(ln=>ln.includes("top")),Lt=ut.find(ln=>ln.includes("bottom")),At=ut.every(ln=>`${ln}`=="none");!ht&&!Lt&&!At&&(Ue=Yt(at)),ht&&(Ht=Yt(ht.toLowerCase().replace("top",""))),Lt&&(Ue=Yt(Lt.toLowerCase().replace("bottom","")))}else Ue=Yt(at)}let Ct;typeof y=="boolean"?Ct={spinning:y}:typeof y=="object"&&(Ct=Object.assign({spinning:!0},y));const[Dt,St]=$Ze(be),Kt=De(`${be}-wrapper`,{[`${be}-wrapper-rtl`]:ie==="rtl"},n,r,St),_n=P&&P.emptyText||(Y==null?void 0:Y("Table"))||C.createElement(nX,{componentName:"Table"});return Dt(C.createElement("div",{ref:e,className:Kt,style:o},C.createElement(bbe,Object.assign({spinning:!1},Ct),Ht,C.createElement(xYe,Object.assign({},G,{columns:$,direction:ie,expandable:nt,prefixCls:be,className:De({[`${be}-middle`]:he==="middle",[`${be}-small`]:he==="small",[`${be}-bordered`]:a,[`${be}-empty`]:ye.length===0}),data:Te,rowKey:Le,rowClassName:bt,emptyText:_n,internalHooks:_A,internalRefs:Ve,transformColumns:rt})),Ue)))},zZe=C.forwardRef(VZe),UZe=(i,e)=>{const t=C.useRef(0);return t.current+=1,C.createElement(zZe,Object.assign({},i,{ref:e,_renderTimes:t.current}))},Kp=C.forwardRef(UZe);Kp.SELECTION_COLUMN=Cm;Kp.EXPAND_COLUMN=Mm;Kp.SELECTION_ALL=BH;Kp.SELECTION_INVERT=WH;Kp.SELECTION_NONE=$H;Kp.Column=yYe;Kp.ColumnGroup=wYe;Kp.Summary=kbe;const jZe=Kp,KZe="_divIconWrapper_1eud3_1",GZe={divIconWrapper:KZe},t0=i=>Nn("div",{className:GZe.divIconWrapper,onClick:e=>{e.stopPropagation(),i.onClick!==void 0&&i.onClick()},children:[i.icon,i.label!==void 0&&ze("label",{children:i.label})]});class qZe{constructor(){Ls(this,"vms",[])}get length(){return this.vms.length}add(e){this.vms.push(e)}delete(e){this.vms.splice(e,1)}at(e){return this.vms[e]}}const vC=new qZe;function Kd(i){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n3?e.i-4:e.i:Array.isArray(i)?1:FX(i)?2:BX(i)?3:0}function jy(i,e){return $S(i)===2?i.has(e):Object.prototype.hasOwnProperty.call(i,e)}function XZe(i,e){return $S(i)===2?i.get(e):i[e]}function Qbe(i,e,t){var n=$S(i);n===2?i.set(e,t):n===3?i.add(t):i[e]=t}function Jbe(i,e){return i===e?i!==0||1/i==1/e:i!=i&&e!=e}function FX(i){return tQe&&i instanceof Map}function BX(i){return nQe&&i instanceof Set}function p0(i){return i.o||i.t}function WX(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var e=tCe(i);delete e[vo];for(var t=Ky(e),n=0;n1&&(i.set=i.add=i.clear=i.delete=YZe),Object.freeze(i),e&&Pb(i,function(t,n){return $X(n,!0)},!0)),i}function YZe(){Kd(2)}function HX(i){return i==null||typeof i!="object"||Object.isFrozen(i)}function Rf(i){var e=KH[i];return e||Kd(18,i),e}function ZZe(i,e){KH[i]||(KH[i]=e)}function zH(){return YD}function Y6(i,e){e&&(Rf("Patches"),i.u=[],i.s=[],i.v=e)}function CA(i){UH(i),i.p.forEach(QZe),i.p=null}function UH(i){i===YD&&(YD=i.l)}function Xoe(i){return YD={p:[],l:YD,h:i,m:!0,_:0}}function QZe(i){var e=i[vo];e.i===0||e.i===1?e.j():e.g=!0}function Z6(i,e){e._=e.p.length;var t=e.p[0],n=i!==void 0&&i!==t;return e.h.O||Rf("ES5").S(e,i,n),n?(t[vo].P&&(CA(e),Kd(4)),Pp(i)&&(i=yA(e,i),e.l||wA(e,i)),e.u&&Rf("Patches").M(t[vo].t,i,e.u,e.s)):i=yA(e,t,[]),CA(e),e.u&&e.v(e.u,e.s),i!==eCe?i:void 0}function yA(i,e,t){if(HX(e))return e;var n=e[vo];if(!n)return Pb(e,function(a,l){return Yoe(i,n,e,a,l,t)},!0),e;if(n.A!==i)return e;if(!n.P)return wA(i,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=n.i===4||n.i===5?n.o=WX(n.k):n.o,o=r,s=!1;n.i===3&&(o=new Set(r),r.clear(),s=!0),Pb(o,function(a,l){return Yoe(i,n,r,a,l,t,s)}),wA(i,r,!1),t&&i.u&&Rf("Patches").N(n,t,i.u,i.s)}return n.o}function Yoe(i,e,t,n,r,o,s){if(jv(r)){var a=yA(i,r,o&&e&&e.i!==3&&!jy(e.R,n)?o.concat(n):void 0);if(Qbe(t,n,a),!jv(a))return;i.m=!1}else s&&t.add(r);if(Pp(r)&&!HX(r)){if(!i.h.D&&i._<1)return;yA(i,r),e&&e.A.l||wA(i,r)}}function wA(i,e,t){t===void 0&&(t=!1),!i.l&&i.h.D&&i.m&&$X(e,t)}function Q6(i,e){var t=i[vo];return(t?p0(t):i)[e]}function Zoe(i,e){if(e in i)for(var t=Object.getPrototypeOf(i);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function Bm(i){i.P||(i.P=!0,i.l&&Bm(i.l))}function J6(i){i.o||(i.o=WX(i.t))}function jH(i,e,t){var n=FX(e)?Rf("MapSet").F(e,t):BX(e)?Rf("MapSet").T(e,t):i.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:zH(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=ZD;s&&(l=[a],c=OL);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):Rf("ES5").J(e,t);return(t?t.A:zH()).p.push(n),n}function JZe(i){return jv(i)||Kd(22,i),function e(t){if(!Pp(t))return t;var n,r=t[vo],o=$S(t);if(r){if(!r.P&&(r.i<4||!Rf("ES5").K(r)))return r.t;r.I=!0,n=Qoe(t,o),r.I=!1}else n=Qoe(t,o);return Pb(n,function(s,a){r&&XZe(r.t,s)===a||Qbe(n,s,e(a))}),o===3?new Set(n):n}(i)}function Qoe(i,e){switch(e){case 2:return new Map(i);case 3:return Array.from(i)}return WX(i)}function eQe(){function i(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[vo];return ZD.get(l,o)},set:function(l){var c=this[vo];ZD.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][vo];if(!a.P)switch(a.i){case 5:n(a)&&Bm(a);break;case 4:t(a)&&Bm(a)}}}function t(o){for(var s=o.t,a=o.k,l=Ky(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==vo){var d=s[u];if(d===void 0&&!jy(s,u))return!0;var h=a[u],f=h&&h[vo];if(f?f.t!==d:!Jbe(h,d))return!0}}var g=!!s[vo];return l.length!==Ky(s).length+(g?0:1)}function n(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l1?v-1:0),y=1;y1?u-1:0),h=1;h=0;r--){var o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));var s=Rf("Patches").$;return jv(t)?s(t,n):this.produce(t,function(a){return s(a,n)})},i}(),au=new rQe,nCe=au.produce;au.produceWithPatches.bind(au);au.setAutoFreeze.bind(au);au.setUseProxies.bind(au);au.applyPatches.bind(au);au.createDraft.bind(au);au.finishDraft.bind(au);function Xa(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var nse=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),e9=function(){return Math.random().toString(36).substring(7).split("").join(".")},SA={INIT:"@@redux/INIT"+e9(),REPLACE:"@@redux/REPLACE"+e9(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+e9()}};function oQe(i){if(typeof i!="object"||i===null)return!1;for(var e=i;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function iCe(i,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Xa(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Xa(1));return t(iCe)(i,e)}if(typeof i!="function")throw new Error(Xa(2));var r=i,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Xa(3));return o}function d(p){if(typeof p!="function")throw new Error(Xa(4));if(l)throw new Error(Xa(5));var m=!0;return c(),a.push(p),function(){if(m){if(l)throw new Error(Xa(6));m=!1,c();var _=a.indexOf(p);a.splice(_,1),s=null}}}function h(p){if(!oQe(p))throw new Error(Xa(7));if(typeof p.type>"u")throw new Error(Xa(8));if(l)throw new Error(Xa(9));try{l=!0,o=r(o,p)}finally{l=!1}for(var m=s=a,v=0;v"u")throw new Error(Xa(12));if(typeof t(void 0,{type:SA.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xa(13))})}function aQe(i){for(var e=Object.keys(i),t={},n=0;n"u")throw c&&c.type,new Error(Xa(14));d[f]=m,u=u||m!==p}return u=u||o.length!==Object.keys(l).length,u?d:l}}function xA(){for(var i=arguments.length,e=new Array(i),t=0;t0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]{const t=i.vmPageStates[i.activeVmIndex].consoleOutputs.length,n=e.length;n>=IR?i.vmPageStates[i.activeVmIndex].consoleOutputs=e.slice(n-IR):(t+n>IR&&(i.vmPageStates[i.activeVmIndex].consoleOutputs=i.vmPageStates[i.activeVmIndex].consoleOutputs.slice(t+n-IR)),i.vmPageStates[i.activeVmIndex].consoleOutputs.push(...e))},lCe=zX({name:"vm",initialState:WQe,reducers:{setActiveVmIndex:(i,e)=>{i.activeVmIndex=e.payload},setName:(i,e)=>{i.vmPageStates[e.payload.index].name=e.payload.newName},addVmPageState:(i,e)=>{const t=BQe();i.vmPageStates.push({...e.payload,id:t}),i.activeVmIndex=i.vmPageStates.length-1},deleteVmPageState:(i,e)=>{(i.activeVmIndex>e.payload||i.activeVmIndex===e.payload&&i.activeVmIndex===i.vmPageStates.length-1)&&i.activeVmIndex--,i.vmPageStates.splice(e.payload,1)},setIsIrChanged:(i,e)=>{i.vmPageStates[i.activeVmIndex].isIrChanged=e.payload},setIrString:(i,e)=>{i.vmPageStates[i.activeVmIndex].irString=e.payload},setState:(i,e)=>{i.vmPageStates[i.activeVmIndex].state=e.payload},setGlobalVariableDetails:(i,e)=>{i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.payload},setLocalVariableDetailsStack:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.payload},setOptions:(i,e)=>{i.vmPageStates[i.activeVmIndex].options=e.payload},setStepCount:(i,e)=>{i.vmPageStates[i.activeVmIndex].stepCount=e.payload},setMemoryUsage:(i,e)=>{i.vmPageStates[i.activeVmIndex].memoryUsage=e.payload},setPeakMemoryUsage:(i,e)=>{i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.payload},addConsoleOutputs:(i,e)=>{cse(i,e.payload)},clearConsoleOutputs:i=>{i.vmPageStates[i.activeVmIndex].consoleOutputs=[]},setConsoleInputPrompt:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=e.payload},setConsoleInput:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInput=e.payload},setStaticErrors:(i,e)=>{i.vmPageStates[i.activeVmIndex].staticErrors=e.payload},setRuntimeErrors:(i,e)=>{i.vmPageStates[i.activeVmIndex].runtimeErrors=e.payload},setCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].currentLineNumber=e.payload},setShouldIndicateCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=e.payload},setLocalVariableTablePageIndex:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableTablePageIndex=e.payload},syncVmState:i=>{const e=vC.at(i.activeVmIndex);i.vmPageStates[i.activeVmIndex].state=e.state,i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.globalVariableDetails,i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.localVariableDetailsStack,i.vmPageStates[i.activeVmIndex].options=e.currentOptions,i.vmPageStates[i.activeVmIndex].stepCount=e.stepCount,i.vmPageStates[i.activeVmIndex].memoryUsage=e.memoryUsage,i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.currentPeakMemoryUsage,i.vmPageStates[i.activeVmIndex].staticErrors=e.staticErrors,i.vmPageStates[i.activeVmIndex].runtimeErrors=e.runtimeErrors,i.vmPageStates[i.activeVmIndex].currentLineNumber=e.currentLineNumber,e.flushWriteBuffer(t=>cse(i,t))}}}),{setActiveVmIndex:$Qe,setName:HQe,addVmPageState:cCe,deleteVmPageState:VQe,setIsIrChanged:uCe,setIrString:zQe,setState:B2t,setGlobalVariableDetails:W2t,setLocalVariableDetailsStack:$2t,setOptions:H2t,setStepCount:V2t,setMemoryUsage:z2t,setPeakMemoryUsage:U2t,addConsoleOutputs:use,clearConsoleOutputs:UQe,setConsoleInputPrompt:kM,setConsoleInput:FL,setStaticErrors:j2t,setRuntimeErrors:K2t,setCurrentLineNumber:G2t,setShouldIndicateCurrentLineNumber:O1,setLocalVariableTablePageIndex:jX,syncVmState:Qg}=lCe.actions,jQe=lCe.reducer,dse=new Int32Array(1);function tc(i){return dse[0]=i,dse[0]}function Bc(i,e){return tc(i+e)}function kR(i,e){return tc(i-e)}function KQe(i,e){const t=(i&4294901760)>>>16,n=i&65535,r=(e&4294901760)>>>16,o=e&65535;return tc((t*o+n*r<<16)+n*o)}function GQe(i,e){return tc(i/e)}var qH=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(qH||{}),dCe=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(dCe||{});function hse(i,e){return i<0||i+4>e.length?{value:null,status:1}:{value:tc(e[i]|e[i+1]<<8|e[i+2]<<16|e[i+3]<<24),status:0}}function qQe(i,e,t){return e<0||e+4>t.length?1:(t[e]=i&255,t[e+1]=(i&65280)>>>8,t[e+2]=(i&16711680)>>>16,t[e+3]=(i&4278190080)>>>24,0)}var TM=(i=>(i[i.IMM=0]="IMM",i[i.ID=1]="ID",i[i.ADDRESS_ID=2]="ADDRESS_ID",i[i.DEREF_ID=3]="DEREF_ID",i))(TM||{}),BL=(i=>(i[i.ADD=0]="ADD",i[i.SUB=1]="SUB",i[i.MUL=2]="MUL",i[i.DIV=3]="DIV",i))(BL||{}),m0=(i=>(i[i.EQ=0]="EQ",i[i.NE=1]="NE",i[i.LT=2]="LT",i[i.LE=3]="LE",i[i.GT=4]="GT",i[i.GE=5]="GE",i))(m0||{}),WL=(i=>(i[i.ID=0]="ID",i[i.DEREF_ID=1]="DEREF_ID",i))(WL||{}),XH=(i=>(i[i.SINGULAR=0]="SINGULAR",i[i.BINARY_MATH_OP=1]="BINARY_MATH_OP",i))(XH||{}),F1=(i=>(i[i.FUNCTION=0]="FUNCTION",i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.LABEL=4]="LABEL",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i[i.EMPTY=14]="EMPTY",i[i.COMMENT=15]="COMMENT",i[i.ERROR=16]="ERROR",i))(F1||{}),ja=(i=>(i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i))(ja||{});const NM=["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"],XQe=new Set(NM);class YQe{constructor(){Ls(this,"patternId",new RegExp(/^(?[a-zA-Z_]\w*)$/));Ls(this,"patternSize",new RegExp(/^(?\d+)$/));Ls(this,"patternSingular",new RegExp(/^(#(?-?\d+))$|^(?[a-zA-Z_]\w*)$|^(\*(?[a-zA-Z_]\w*))$|^(&(?[a-zA-Z_]\w*))$/));Ls(this,"patternLValue",new RegExp(/^((?[a-zA-Z_]\w*))$|^(\*(?[a-zA-Z_]\w*))$/));Ls(this,"illegalInstructionFormatError",{type:16,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"})}purify(e){return e.trim().replaceAll(/[ \t]+/g," ")}splitWhiteSpace(e){return e.replaceAll(" "," ").split(" ")}decodeComponentId(e){const t=e.match(this.patternId);return t===null||XQe.has(e)?null:t.groups.id}decodeComponentSize(e){const t=e.match(this.patternSize);if(t===null)return null;const n=parseInt(t.groups.size);return Number.isSafeInteger(n)?tc(n):1/0}decodeComponentSingular(e){const t=e.match(this.patternSingular);if(t===null)return null;if(t.groups.imm!==void 0){const n=parseInt(t.groups.imm);return Number.isSafeInteger(n)?{type:0,imm:tc(n)}:{type:0,imm:1/0}}else return t.groups.id!==void 0?{type:1,id:t.groups.id}:t.groups.derefId!==void 0?{type:3,id:t.groups.derefId}:{type:2,id:t.groups.addressId}}decodeComponentLValue(e){const t=e.match(this.patternLValue);return t===null?null:t.groups.id!==void 0?{type:0,id:t.groups.id}:{type:1,id:t.groups.derefId}}decodeFunction(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:0,value:{id:t}}}decodeAssign(e){if(e.length!==3&&e.length!==5||e[1]!==":=")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentSingular(e[2]);if(n===null)return{type:16,messageKey:e.length===3?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(n.type===0&&!Number.isFinite(n.imm))return{type:16,messageKey:e.length===3?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(e.length===3)return{type:1,value:{lValue:t,rValue:{type:0,singular:n}}};{let r=0;switch(e[3]){case"+":r=0;break;case"-":r=1;break;case"*":r=2;break;case"/":r=3;break;default:return{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const o=this.decodeComponentSingular(e[4]);return o===null?{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:o.type===0&&!Number.isFinite(o.imm)?{type:16,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}:{type:1,value:{lValue:t,rValue:{type:1,singularL:n,singularR:o,binaryMathOp:r}}}}}decodeDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:2,value:{id:t,size:n}}:{type:16,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:3,value:{id:t,size:n}}:{type:16,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"LABEL_ILLEGAL_ID"}:{type:4,value:{id:t}}}decodeGoto(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"GOTO_ILLEGAL_ID"}:{type:5,value:{id:t}}}decodeIf(e){if(e.length!==6||e[4]!=="GOTO")return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);if(t===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(t.type===0&&!Number.isFinite(t.imm))return{type:16,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let n=0;switch(e[2]){case"==":n=0;break;case"!=":n=1;break;case"<":n=2;break;case"<=":n=3;break;case">":n=4;break;case">=":n=5;break;default:return{type:16,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const r=this.decodeComponentSingular(e[3]);if(r===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(r.type===0&&!Number.isFinite(r.imm))return{type:16,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const o=this.decodeComponentId(e[5]);return o===null?{type:16,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:6,value:{condition:{singularL:t,singularR:r,binaryRelOp:n},gotoId:o}}}decodeArg(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"ARG_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"ARG_IMM_TOO_LARGE"}:{type:7,value:{value:t}}}decodeCall(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:8,value:{id:t}}}decodeAssignCall(e){if(e.length!==4||e[1]!==":="||e[2]!=="CALL")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentId(e[3]);return n===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:9,value:{lValue:t,functionId:n}}}decodeParam(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"PARAM_ILLEGAL_ID"}:{type:10,value:{id:t}}}decodeReturn(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"RETURN_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"RETURN_IMM_TOO_LARGE"}:{type:11,value:{value:t}}}decodeRead(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[1]);return t===null?{type:16,messageKey:"READ_ILLEGAL"}:{type:12,value:{lValue:t}}}decodeWrite(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"WRITE_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"WRITE_IMM_TOO_LARGE"}:{type:13,value:{value:t}}}decode(e){if(e.match(/^[ \t]*$/))return{type:14};const t={type:16,messageKey:"UNRECOGNIZED_INSTRUCTION"},n=this.purify(e);if(n.startsWith(";"))return{type:15};const r=this.splitWhiteSpace(n);if(r.length<1)return t;switch(r[0]){case"FUNCTION":return this.decodeFunction(r);case"DEC":return this.decodeDec(r);case"GLOBAL_DEC":return this.decodeGlobalDec(r);case"LABEL":return this.decodeLabel(r);case"GOTO":return this.decodeGoto(r);case"IF":return this.decodeIf(r);case"ARG":return this.decodeArg(r);case"CALL":return this.decodeCall(r);case"PARAM":return this.decodeParam(r);case"RETURN":return this.decodeReturn(r);case"READ":return this.decodeRead(r);case"WRITE":return this.decodeWrite(r);default:{const o=this.decodeAssign(r);if(o.type===1)return o;const s=this.decodeAssignCall(r);return s.type===9?s:o}}}}var Ka={},ZQe={get exports(){return Ka},set exports(i){Ka=i}};/** + `]:{background:p},[`&${e}-row-selected`]:{["> th, > td"]:{background:m},["&:hover > th, &:hover > td"]:{background:v}}}},[`${e}-footer`]:{padding:`${n}px ${r}px`,color:_,background:y}})}},$Ze=yo("Table",i=>{const{controlItemBgActive:e,controlItemBgActiveHover:t,colorTextPlaceholder:n,colorTextHeading:r,colorSplit:o,colorBorderSecondary:s,fontSize:a,padding:l,paddingXS:c,paddingSM:u,controlHeight:d,colorFillAlter:h,colorIcon:f,colorIconHover:g,opacityLoading:p,colorBgContainer:m,borderRadiusLG:v,colorFillContent:_,colorFillSecondary:y,controlInteractiveSize:S}=i,L=new Jr(f),E=new Jr(g),D=e,k=2,T=new Jr(y).onBackground(m).toHexShortString(),M=new Jr(_).onBackground(m).toHexShortString(),P=new Jr(h).onBackground(m).toHexShortString(),N=Bi(i,{tableFontSize:a,tableBg:m,tableRadius:v,tablePaddingVertical:l,tablePaddingHorizontal:l,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:c,tablePaddingVerticalSmall:c,tablePaddingHorizontalSmall:c,tableBorderColor:s,tableHeaderTextColor:r,tableHeaderBg:P,tableFooterTextColor:r,tableFooterBg:P,tableHeaderCellSplitColor:s,tableHeaderSortBg:T,tableHeaderSortHoverBg:M,tableHeaderIconColor:L.clone().setAlpha(L.getAlpha()*p).toRgbString(),tableHeaderIconColorHover:E.clone().setAlpha(E.getAlpha()*p).toRgbString(),tableBodySortBg:P,tableFixedHeaderSortActiveBg:T,tableHeaderFilterActiveBg:_,tableFilterDropdownBg:m,tableRowHoverBg:P,tableSelectedRowBg:D,tableSelectedRowHoverBg:t,zIndexTableFixed:k,zIndexTableSticky:k+1,tableFontSizeMiddle:a,tableFontSizeSmall:a,tableSelectionColumnWidth:d,tableExpandIconBg:m,tableExpandColumnWidth:S+2*i.padding,tableExpandedRowBg:h,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:n,tableScrollThumbBgHover:r,tableScrollBg:o});return[WZe(N),LZe(N),qoe(N),AZe(N),yZe(N),fZe(N),DZe(N),bZe(N),qoe(N),vZe(N),NZe(N),SZe(N),FZe(N),pZe(N),MZe(N),kZe(N)]}),HZe=[],VZe=(i,e)=>{const{prefixCls:t,className:n,rootClassName:r,style:o,size:s,bordered:a,dropdownPrefixCls:l,dataSource:c,pagination:u,rowSelection:d,rowKey:h="key",rowClassName:f,columns:g,children:p,childrenColumnName:m,onChange:v,getPopupContainer:_,loading:y,expandIcon:S,expandable:L,expandedRowRender:E,expandIconColumnIndex:D,indentSize:k,scroll:T,sortDirections:M,locale:P,showSorterTooltip:N=!0}=i,R=C.useMemo(()=>g||MX(p),[g,p]),O=C.useMemo(()=>R.some(zt=>zt.responsive),[R]),B=O4(O),$=C.useMemo(()=>{const zt=new Set(Object.keys(B).filter(Yt=>B[Yt]));return R.filter(Yt=>!Yt.responsive||Yt.responsive.some(at=>zt.has(at)))},[R,B]),G=cl(i,["className","style","columns"]),U=C.useContext(Eh),{locale:j=Nb,direction:ie,renderEmpty:Y,getPrefixCls:J,getPopupContainer:Q}=C.useContext(Pn),he=s||U,ge=Object.assign(Object.assign({},j.Table),P),ye=c||HZe,be=J("table",t),Ge=J("dropdown",l),nt=Object.assign({childrenColumnName:m,expandIconColumnIndex:D},L),{childrenColumnName:je="children"}=nt,_e=C.useMemo(()=>ye.some(zt=>zt==null?void 0:zt[je])?"nest":E||L&&L.expandedRowRender?"row":null,[ye]),Ve={body:C.useRef()},Le=C.useMemo(()=>typeof h=="function"?h:zt=>zt==null?void 0:zt[h],[h]),[Pe]=rZe(ye,je,Le),Be={},Qe=function(zt,Yt){let at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var ut,ht,Lt;const At=Object.assign(Object.assign({},Be),zt);at&&((ut=Be.resetPagination)===null||ut===void 0||ut.call(Be),!((ht=At.pagination)===null||ht===void 0)&&ht.current&&(At.pagination.current=1),u&&u.onChange&&u.onChange(1,(Lt=At.pagination)===null||Lt===void 0?void 0:Lt.pageSize)),T&&T.scrollToFirstRowOnChange!==!1&&Ve.body.current&&j7e(0,{getContainer:()=>Ve.body.current}),v==null||v(At.pagination,At.filters,At.sorter,{currentDataSource:zoe(VH(ye,At.sorterStates,je),At.filterStates),action:Yt})},Ye=(zt,Yt)=>{Qe({sorter:zt,sorterStates:Yt},"sort",!1)},[We,dt,re,ue]=uZe({prefixCls:be,mergedColumns:$,onSorterChange:Ye,sortDirections:M||["ascend","descend"],tableLocale:ge,showSorterTooltip:N}),de=C.useMemo(()=>VH(ye,dt,je),[ye,dt]);Be.sorter=ue(),Be.sorterStates=dt;const z=(zt,Yt)=>{Qe({filters:zt,filterStates:Yt},"filter",!0)},[q,se,ne]=iZe({prefixCls:be,locale:ge,dropdownPrefixCls:Ge,mergedColumns:$,onFilterChange:z,getPopupContainer:_||Q}),pe=zoe(de,se);Be.filters=ne,Be.filterStates=se;const ke=C.useMemo(()=>{const zt={};return Object.keys(ne).forEach(Yt=>{ne[Yt]!==null&&(zt[Yt]=ne[Yt])}),Object.assign(Object.assign({},re),{filters:zt})},[re,ne]),[oe]=dZe(ke),ce=(zt,Yt)=>{Qe({pagination:Object.assign(Object.assign({},Be.pagination),{current:zt,pageSize:Yt})},"paginate")},[fe,Ie]=aZe(pe.length,ce,u);Be.pagination=u===!1?{}:sZe(fe,u),Be.resetPagination=Ie;const Te=C.useMemo(()=>{if(u===!1||!fe.pageSize)return pe;const{current:zt=1,total:Yt,pageSize:at=qbe}=fe;return pe.lengthat?pe.slice((zt-1)*at,zt*at):pe:pe.slice((zt-1)*at,zt*at)},[!!u,pe,fe&&fe.current,fe&&fe.pageSize,fe&&fe.total]),[He,Me]=lZe({prefixCls:be,data:pe,pageData:Te,getRowKey:Le,getRecordByKey:Pe,expandType:_e,childrenColumnName:je,locale:ge,getPopupContainer:_||Q},d),bt=(zt,Yt,at)=>{let ut;return typeof f=="function"?ut=De(f(zt,Yt,at)):ut=De(f),De({[`${be}-row-selected`]:Me.has(Le(zt,Yt))},ut)};nt.__PARENT_RENDER_ICON__=nt.expandIcon,nt.expandIcon=nt.expandIcon||S||SYe(ge),_e==="nest"&&nt.expandIconColumnIndex===void 0?nt.expandIconColumnIndex=d?1:0:nt.expandIconColumnIndex>0&&d&&(nt.expandIconColumnIndex-=1),typeof nt.indentSize!="number"&&(nt.indentSize=typeof k=="number"?k:15);const rt=C.useCallback(zt=>oe(He(q(We(zt)))),[We,q,He]);let Ht,Ue;if(u!==!1&&(fe!=null&&fe.total)){let zt;fe.size?zt=fe.size:zt=he==="small"||he==="middle"?"small":void 0;const Yt=ht=>C.createElement(kX,Object.assign({},fe,{className:De(`${be}-pagination ${be}-pagination-${ht}`,fe.className),size:zt})),at=ie==="rtl"?"left":"right",{position:ut}=fe;if(ut!==null&&Array.isArray(ut)){const ht=ut.find(ln=>ln.includes("top")),Lt=ut.find(ln=>ln.includes("bottom")),At=ut.every(ln=>`${ln}`=="none");!ht&&!Lt&&!At&&(Ue=Yt(at)),ht&&(Ht=Yt(ht.toLowerCase().replace("top",""))),Lt&&(Ue=Yt(Lt.toLowerCase().replace("bottom","")))}else Ue=Yt(at)}let Ct;typeof y=="boolean"?Ct={spinning:y}:typeof y=="object"&&(Ct=Object.assign({spinning:!0},y));const[Dt,St]=$Ze(be),Kt=De(`${be}-wrapper`,{[`${be}-wrapper-rtl`]:ie==="rtl"},n,r,St),_n=P&&P.emptyText||(Y==null?void 0:Y("Table"))||C.createElement(nX,{componentName:"Table"});return Dt(C.createElement("div",{ref:e,className:Kt,style:o},C.createElement(bbe,Object.assign({spinning:!1},Ct),Ht,C.createElement(xYe,Object.assign({},G,{columns:$,direction:ie,expandable:nt,prefixCls:be,className:De({[`${be}-middle`]:he==="middle",[`${be}-small`]:he==="small",[`${be}-bordered`]:a,[`${be}-empty`]:ye.length===0}),data:Te,rowKey:Le,rowClassName:bt,emptyText:_n,internalHooks:_A,internalRefs:Ve,transformColumns:rt})),Ue)))},zZe=C.forwardRef(VZe),UZe=(i,e)=>{const t=C.useRef(0);return t.current+=1,C.createElement(zZe,Object.assign({},i,{ref:e,_renderTimes:t.current}))},Kp=C.forwardRef(UZe);Kp.SELECTION_COLUMN=Cm;Kp.EXPAND_COLUMN=Mm;Kp.SELECTION_ALL=BH;Kp.SELECTION_INVERT=WH;Kp.SELECTION_NONE=$H;Kp.Column=yYe;Kp.ColumnGroup=wYe;Kp.Summary=kbe;const jZe=Kp,KZe="_divIconWrapper_1eud3_1",GZe={divIconWrapper:KZe},n0=i=>Nn("div",{className:GZe.divIconWrapper,onClick:e=>{e.stopPropagation(),i.onClick!==void 0&&i.onClick()},children:[i.icon,i.label!==void 0&&ze("label",{children:i.label})]});class qZe{constructor(){Ls(this,"vms",[])}get length(){return this.vms.length}add(e){this.vms.push(e)}delete(e){this.vms.splice(e,1)}at(e){return this.vms[e]}}const jv=new qZe;function Kd(i){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n3?e.i-4:e.i:Array.isArray(i)?1:FX(i)?2:BX(i)?3:0}function jy(i,e){return $S(i)===2?i.has(e):Object.prototype.hasOwnProperty.call(i,e)}function XZe(i,e){return $S(i)===2?i.get(e):i[e]}function Qbe(i,e,t){var n=$S(i);n===2?i.set(e,t):n===3?i.add(t):i[e]=t}function Jbe(i,e){return i===e?i!==0||1/i==1/e:i!=i&&e!=e}function FX(i){return tQe&&i instanceof Map}function BX(i){return nQe&&i instanceof Set}function m0(i){return i.o||i.t}function WX(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var e=tCe(i);delete e[vo];for(var t=Ky(e),n=0;n1&&(i.set=i.add=i.clear=i.delete=YZe),Object.freeze(i),e&&Ab(i,function(t,n){return $X(n,!0)},!0)),i}function YZe(){Kd(2)}function HX(i){return i==null||typeof i!="object"||Object.isFrozen(i)}function Rf(i){var e=KH[i];return e||Kd(18,i),e}function ZZe(i,e){KH[i]||(KH[i]=e)}function zH(){return YD}function Y6(i,e){e&&(Rf("Patches"),i.u=[],i.s=[],i.v=e)}function CA(i){UH(i),i.p.forEach(QZe),i.p=null}function UH(i){i===YD&&(YD=i.l)}function Xoe(i){return YD={p:[],l:YD,h:i,m:!0,_:0}}function QZe(i){var e=i[vo];e.i===0||e.i===1?e.j():e.g=!0}function Z6(i,e){e._=e.p.length;var t=e.p[0],n=i!==void 0&&i!==t;return e.h.O||Rf("ES5").S(e,i,n),n?(t[vo].P&&(CA(e),Kd(4)),Pp(i)&&(i=yA(e,i),e.l||wA(e,i)),e.u&&Rf("Patches").M(t[vo].t,i,e.u,e.s)):i=yA(e,t,[]),CA(e),e.u&&e.v(e.u,e.s),i!==eCe?i:void 0}function yA(i,e,t){if(HX(e))return e;var n=e[vo];if(!n)return Ab(e,function(a,l){return Yoe(i,n,e,a,l,t)},!0),e;if(n.A!==i)return e;if(!n.P)return wA(i,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=n.i===4||n.i===5?n.o=WX(n.k):n.o,o=r,s=!1;n.i===3&&(o=new Set(r),r.clear(),s=!0),Ab(o,function(a,l){return Yoe(i,n,r,a,l,t,s)}),wA(i,r,!1),t&&i.u&&Rf("Patches").N(n,t,i.u,i.s)}return n.o}function Yoe(i,e,t,n,r,o,s){if(Kv(r)){var a=yA(i,r,o&&e&&e.i!==3&&!jy(e.R,n)?o.concat(n):void 0);if(Qbe(t,n,a),!Kv(a))return;i.m=!1}else s&&t.add(r);if(Pp(r)&&!HX(r)){if(!i.h.D&&i._<1)return;yA(i,r),e&&e.A.l||wA(i,r)}}function wA(i,e,t){t===void 0&&(t=!1),!i.l&&i.h.D&&i.m&&$X(e,t)}function Q6(i,e){var t=i[vo];return(t?m0(t):i)[e]}function Zoe(i,e){if(e in i)for(var t=Object.getPrototypeOf(i);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function Bm(i){i.P||(i.P=!0,i.l&&Bm(i.l))}function J6(i){i.o||(i.o=WX(i.t))}function jH(i,e,t){var n=FX(e)?Rf("MapSet").F(e,t):BX(e)?Rf("MapSet").T(e,t):i.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:zH(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=ZD;s&&(l=[a],c=OL);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):Rf("ES5").J(e,t);return(t?t.A:zH()).p.push(n),n}function JZe(i){return Kv(i)||Kd(22,i),function e(t){if(!Pp(t))return t;var n,r=t[vo],o=$S(t);if(r){if(!r.P&&(r.i<4||!Rf("ES5").K(r)))return r.t;r.I=!0,n=Qoe(t,o),r.I=!1}else n=Qoe(t,o);return Ab(n,function(s,a){r&&XZe(r.t,s)===a||Qbe(n,s,e(a))}),o===3?new Set(n):n}(i)}function Qoe(i,e){switch(e){case 2:return new Map(i);case 3:return Array.from(i)}return WX(i)}function eQe(){function i(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[vo];return ZD.get(l,o)},set:function(l){var c=this[vo];ZD.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][vo];if(!a.P)switch(a.i){case 5:n(a)&&Bm(a);break;case 4:t(a)&&Bm(a)}}}function t(o){for(var s=o.t,a=o.k,l=Ky(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==vo){var d=s[u];if(d===void 0&&!jy(s,u))return!0;var h=a[u],f=h&&h[vo];if(f?f.t!==d:!Jbe(h,d))return!0}}var g=!!s[vo];return l.length!==Ky(s).length+(g?0:1)}function n(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l1?v-1:0),y=1;y1?u-1:0),h=1;h=0;r--){var o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));var s=Rf("Patches").$;return Kv(t)?s(t,n):this.produce(t,function(a){return s(a,n)})},i}(),au=new rQe,nCe=au.produce;au.produceWithPatches.bind(au);au.setAutoFreeze.bind(au);au.setUseProxies.bind(au);au.applyPatches.bind(au);au.createDraft.bind(au);au.finishDraft.bind(au);function Xa(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var nse=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),e9=function(){return Math.random().toString(36).substring(7).split("").join(".")},SA={INIT:"@@redux/INIT"+e9(),REPLACE:"@@redux/REPLACE"+e9(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+e9()}};function oQe(i){if(typeof i!="object"||i===null)return!1;for(var e=i;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function iCe(i,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Xa(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Xa(1));return t(iCe)(i,e)}if(typeof i!="function")throw new Error(Xa(2));var r=i,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Xa(3));return o}function d(p){if(typeof p!="function")throw new Error(Xa(4));if(l)throw new Error(Xa(5));var m=!0;return c(),a.push(p),function(){if(m){if(l)throw new Error(Xa(6));m=!1,c();var _=a.indexOf(p);a.splice(_,1),s=null}}}function h(p){if(!oQe(p))throw new Error(Xa(7));if(typeof p.type>"u")throw new Error(Xa(8));if(l)throw new Error(Xa(9));try{l=!0,o=r(o,p)}finally{l=!1}for(var m=s=a,v=0;v"u")throw new Error(Xa(12));if(typeof t(void 0,{type:SA.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xa(13))})}function aQe(i){for(var e=Object.keys(i),t={},n=0;n"u")throw c&&c.type,new Error(Xa(14));d[f]=m,u=u||m!==p}return u=u||o.length!==Object.keys(l).length,u?d:l}}function xA(){for(var i=arguments.length,e=new Array(i),t=0;t0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]{const t=i.vmPageStates[i.activeVmIndex].consoleOutputs.length,n=e.length;n>=IR?i.vmPageStates[i.activeVmIndex].consoleOutputs=e.slice(n-IR):(t+n>IR&&(i.vmPageStates[i.activeVmIndex].consoleOutputs=i.vmPageStates[i.activeVmIndex].consoleOutputs.slice(t+n-IR)),i.vmPageStates[i.activeVmIndex].consoleOutputs.push(...e))},lCe=zX({name:"vm",initialState:WQe,reducers:{setActiveVmIndex:(i,e)=>{i.activeVmIndex=e.payload},setName:(i,e)=>{i.vmPageStates[e.payload.index].name=e.payload.newName},addVmPageState:(i,e)=>{const t=BQe();i.vmPageStates.push({...e.payload,id:t}),i.activeVmIndex=i.vmPageStates.length-1},deleteVmPageState:(i,e)=>{(i.activeVmIndex>e.payload||i.activeVmIndex===e.payload&&i.activeVmIndex===i.vmPageStates.length-1)&&i.activeVmIndex--,i.vmPageStates.splice(e.payload,1)},setIsIrChanged:(i,e)=>{i.vmPageStates[i.activeVmIndex].isIrChanged=e.payload},setIrString:(i,e)=>{i.vmPageStates[i.activeVmIndex].irString=e.payload},setState:(i,e)=>{i.vmPageStates[i.activeVmIndex].state=e.payload},setGlobalVariableDetails:(i,e)=>{i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.payload},setLocalVariableDetailsStack:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.payload},setOptions:(i,e)=>{i.vmPageStates[i.activeVmIndex].options=e.payload},setStepCount:(i,e)=>{i.vmPageStates[i.activeVmIndex].stepCount=e.payload},setMemoryUsage:(i,e)=>{i.vmPageStates[i.activeVmIndex].memoryUsage=e.payload},setPeakMemoryUsage:(i,e)=>{i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.payload},addConsoleOutputs:(i,e)=>{cse(i,e.payload)},clearConsoleOutputs:i=>{i.vmPageStates[i.activeVmIndex].consoleOutputs=[]},setConsoleInputPrompt:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=e.payload},setConsoleInput:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInput=e.payload},setStaticErrors:(i,e)=>{i.vmPageStates[i.activeVmIndex].staticErrors=e.payload},setRuntimeErrors:(i,e)=>{i.vmPageStates[i.activeVmIndex].runtimeErrors=e.payload},setCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].currentLineNumber=e.payload},setShouldIndicateCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=e.payload},setLocalVariableTablePageIndex:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableTablePageIndex=e.payload},syncVmState:i=>{const e=jv.at(i.activeVmIndex);i.vmPageStates[i.activeVmIndex].state=e.state,i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.globalVariableDetails,i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.localVariableDetailsStack,i.vmPageStates[i.activeVmIndex].options=e.currentOptions,i.vmPageStates[i.activeVmIndex].stepCount=e.stepCount,i.vmPageStates[i.activeVmIndex].memoryUsage=e.memoryUsage,i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.currentPeakMemoryUsage,i.vmPageStates[i.activeVmIndex].staticErrors=e.staticErrors,i.vmPageStates[i.activeVmIndex].runtimeErrors=e.runtimeErrors,i.vmPageStates[i.activeVmIndex].currentLineNumber=e.currentLineNumber,e.flushWriteBuffer(t=>cse(i,t))}}}),{setActiveVmIndex:$Qe,setName:HQe,addVmPageState:cCe,deleteVmPageState:VQe,setIsIrChanged:uCe,setIrString:zQe,setState:B2t,setGlobalVariableDetails:W2t,setLocalVariableDetailsStack:$2t,setOptions:H2t,setStepCount:V2t,setMemoryUsage:z2t,setPeakMemoryUsage:U2t,addConsoleOutputs:use,clearConsoleOutputs:UQe,setConsoleInputPrompt:kM,setConsoleInput:FL,setStaticErrors:j2t,setRuntimeErrors:K2t,setCurrentLineNumber:G2t,setShouldIndicateCurrentLineNumber:O1,setLocalVariableTablePageIndex:jX,syncVmState:Qg}=lCe.actions,jQe=lCe.reducer,dse=new Int32Array(1);function tc(i){return dse[0]=i,dse[0]}function Bc(i,e){return tc(i+e)}function kR(i,e){return tc(i-e)}function KQe(i,e){const t=(i&4294901760)>>>16,n=i&65535,r=(e&4294901760)>>>16,o=e&65535;return tc((t*o+n*r<<16)+n*o)}function GQe(i,e){return tc(i/e)}var qH=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(qH||{}),dCe=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(dCe||{});function hse(i,e){return i<0||i+4>e.length?{value:null,status:1}:{value:tc(e[i]|e[i+1]<<8|e[i+2]<<16|e[i+3]<<24),status:0}}function qQe(i,e,t){return e<0||e+4>t.length?1:(t[e]=i&255,t[e+1]=(i&65280)>>>8,t[e+2]=(i&16711680)>>>16,t[e+3]=(i&4278190080)>>>24,0)}var TM=(i=>(i[i.IMM=0]="IMM",i[i.ID=1]="ID",i[i.ADDRESS_ID=2]="ADDRESS_ID",i[i.DEREF_ID=3]="DEREF_ID",i))(TM||{}),BL=(i=>(i[i.ADD=0]="ADD",i[i.SUB=1]="SUB",i[i.MUL=2]="MUL",i[i.DIV=3]="DIV",i))(BL||{}),v0=(i=>(i[i.EQ=0]="EQ",i[i.NE=1]="NE",i[i.LT=2]="LT",i[i.LE=3]="LE",i[i.GT=4]="GT",i[i.GE=5]="GE",i))(v0||{}),WL=(i=>(i[i.ID=0]="ID",i[i.DEREF_ID=1]="DEREF_ID",i))(WL||{}),XH=(i=>(i[i.SINGULAR=0]="SINGULAR",i[i.BINARY_MATH_OP=1]="BINARY_MATH_OP",i))(XH||{}),F1=(i=>(i[i.FUNCTION=0]="FUNCTION",i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.LABEL=4]="LABEL",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i[i.EMPTY=14]="EMPTY",i[i.COMMENT=15]="COMMENT",i[i.ERROR=16]="ERROR",i))(F1||{}),ja=(i=>(i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i))(ja||{});const NM=["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"],XQe=new Set(NM);class YQe{constructor(){Ls(this,"patternId",new RegExp(/^(?[a-zA-Z_]\w*)$/));Ls(this,"patternSize",new RegExp(/^(?\d+)$/));Ls(this,"patternSingular",new RegExp(/^(#(?-?\d+))$|^(?[a-zA-Z_]\w*)$|^(\*(?[a-zA-Z_]\w*))$|^(&(?[a-zA-Z_]\w*))$/));Ls(this,"patternLValue",new RegExp(/^((?[a-zA-Z_]\w*))$|^(\*(?[a-zA-Z_]\w*))$/));Ls(this,"illegalInstructionFormatError",{type:16,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"})}purify(e){return e.trim().replaceAll(/[ \t]+/g," ")}splitWhiteSpace(e){return e.replaceAll(" "," ").split(" ")}decodeComponentId(e){const t=e.match(this.patternId);return t===null||XQe.has(e)?null:t.groups.id}decodeComponentSize(e){const t=e.match(this.patternSize);if(t===null)return null;const n=parseInt(t.groups.size);return Number.isSafeInteger(n)?tc(n):1/0}decodeComponentSingular(e){const t=e.match(this.patternSingular);if(t===null)return null;if(t.groups.imm!==void 0){const n=parseInt(t.groups.imm);return Number.isSafeInteger(n)?{type:0,imm:tc(n)}:{type:0,imm:1/0}}else return t.groups.id!==void 0?{type:1,id:t.groups.id}:t.groups.derefId!==void 0?{type:3,id:t.groups.derefId}:{type:2,id:t.groups.addressId}}decodeComponentLValue(e){const t=e.match(this.patternLValue);return t===null?null:t.groups.id!==void 0?{type:0,id:t.groups.id}:{type:1,id:t.groups.derefId}}decodeFunction(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:0,value:{id:t}}}decodeAssign(e){if(e.length!==3&&e.length!==5||e[1]!==":=")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentSingular(e[2]);if(n===null)return{type:16,messageKey:e.length===3?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(n.type===0&&!Number.isFinite(n.imm))return{type:16,messageKey:e.length===3?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(e.length===3)return{type:1,value:{lValue:t,rValue:{type:0,singular:n}}};{let r=0;switch(e[3]){case"+":r=0;break;case"-":r=1;break;case"*":r=2;break;case"/":r=3;break;default:return{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const o=this.decodeComponentSingular(e[4]);return o===null?{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:o.type===0&&!Number.isFinite(o.imm)?{type:16,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}:{type:1,value:{lValue:t,rValue:{type:1,singularL:n,singularR:o,binaryMathOp:r}}}}}decodeDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:2,value:{id:t,size:n}}:{type:16,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:3,value:{id:t,size:n}}:{type:16,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"LABEL_ILLEGAL_ID"}:{type:4,value:{id:t}}}decodeGoto(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"GOTO_ILLEGAL_ID"}:{type:5,value:{id:t}}}decodeIf(e){if(e.length!==6||e[4]!=="GOTO")return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);if(t===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(t.type===0&&!Number.isFinite(t.imm))return{type:16,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let n=0;switch(e[2]){case"==":n=0;break;case"!=":n=1;break;case"<":n=2;break;case"<=":n=3;break;case">":n=4;break;case">=":n=5;break;default:return{type:16,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const r=this.decodeComponentSingular(e[3]);if(r===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(r.type===0&&!Number.isFinite(r.imm))return{type:16,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const o=this.decodeComponentId(e[5]);return o===null?{type:16,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:6,value:{condition:{singularL:t,singularR:r,binaryRelOp:n},gotoId:o}}}decodeArg(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"ARG_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"ARG_IMM_TOO_LARGE"}:{type:7,value:{value:t}}}decodeCall(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:8,value:{id:t}}}decodeAssignCall(e){if(e.length!==4||e[1]!==":="||e[2]!=="CALL")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentId(e[3]);return n===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:9,value:{lValue:t,functionId:n}}}decodeParam(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"PARAM_ILLEGAL_ID"}:{type:10,value:{id:t}}}decodeReturn(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"RETURN_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"RETURN_IMM_TOO_LARGE"}:{type:11,value:{value:t}}}decodeRead(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[1]);return t===null?{type:16,messageKey:"READ_ILLEGAL"}:{type:12,value:{lValue:t}}}decodeWrite(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"WRITE_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"WRITE_IMM_TOO_LARGE"}:{type:13,value:{value:t}}}decode(e){if(e.match(/^[ \t]*$/))return{type:14};const t={type:16,messageKey:"UNRECOGNIZED_INSTRUCTION"},n=this.purify(e);if(n.startsWith(";"))return{type:15};const r=this.splitWhiteSpace(n);if(r.length<1)return t;switch(r[0]){case"FUNCTION":return this.decodeFunction(r);case"DEC":return this.decodeDec(r);case"GLOBAL_DEC":return this.decodeGlobalDec(r);case"LABEL":return this.decodeLabel(r);case"GOTO":return this.decodeGoto(r);case"IF":return this.decodeIf(r);case"ARG":return this.decodeArg(r);case"CALL":return this.decodeCall(r);case"PARAM":return this.decodeParam(r);case"RETURN":return this.decodeReturn(r);case"READ":return this.decodeRead(r);case"WRITE":return this.decodeWrite(r);default:{const o=this.decodeAssign(r);if(o.type===1)return o;const s=this.decodeAssignCall(r);return s.type===9?s:o}}}}var Ka={},ZQe={get exports(){return Ka},set exports(i){Ka=i}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(i,e){(function(){var t,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,m=1,v=2,_=4,y=8,S=16,L=32,E=64,D=128,k=256,T=512,M=30,P="...",N=800,R=16,O=1,B=2,$=3,G=1/0,U=9007199254740991,j=17976931348623157e292,ie=0/0,Y=4294967295,J=Y-1,Q=Y>>>1,he=[["ary",D],["bind",m],["bindKey",v],["curry",y],["curryRight",S],["flip",T],["partial",L],["partialRight",E],["rearg",k]],ge="[object Arguments]",ye="[object Array]",be="[object AsyncFunction]",Ge="[object Boolean]",nt="[object Date]",je="[object DOMException]",_e="[object Error]",Ve="[object Function]",Le="[object GeneratorFunction]",Pe="[object Map]",Be="[object Number]",Qe="[object Null]",Ye="[object Object]",We="[object Promise]",dt="[object Proxy]",re="[object RegExp]",ue="[object Set]",de="[object String]",z="[object Symbol]",q="[object Undefined]",se="[object WeakMap]",ne="[object WeakSet]",pe="[object ArrayBuffer]",ke="[object DataView]",oe="[object Float32Array]",ce="[object Float64Array]",fe="[object Int8Array]",Ie="[object Int16Array]",Te="[object Int32Array]",He="[object Uint8Array]",Me="[object Uint8ClampedArray]",bt="[object Uint16Array]",rt="[object Uint32Array]",Ht=/\b__p \+= '';/g,Ue=/\b(__p \+=) '' \+/g,Ct=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Dt=/&(?:amp|lt|gt|quot|#39);/g,St=/[&<>"']/g,Kt=RegExp(Dt.source),_n=RegExp(St.source),zt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ht=/^\w*$/,Lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,At=/[\\^$.*+?()[\]{}|]/g,ln=RegExp(At.source),Si=/^\s+/,Xi=/\s/,Ir=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,En=/\{\n\/\* \[wrapped with (.+)\] \*/,fi=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,go=/[()=,{}\[\]\/\s]/,ys=/\\(\\)?/g,ws=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ut=/\w*$/,Ee=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,kt=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,dr=/^(?:0|[1-9]\d*)$/,jr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,to=/['\n\r\u2028\u2029\\]/g,$s="\\ud800-\\udfff",Hl="\\u0300-\\u036f",Oa="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",wo=Hl+Oa+Uo,Fa="\\u2700-\\u27bf",Ba="a-z\\xdf-\\xf6\\xf8-\\xff",Vl="\\xac\\xb1\\xd7\\xf7",fl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zl="\\u2000-\\u206f",yu=" \\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",wu="A-Z\\xc0-\\xd6\\xd8-\\xde",Ic="\\ufe0e\\ufe0f",Wa=Vl+fl+zl+yu,$a="['’]",Qt="["+$s+"]",$t="["+Wa+"]",On="["+wo+"]",Jt="\\d+",Zt="["+Fa+"]",oi="["+Ba+"]",Wi="[^"+$s+Wa+Jt+Fa+Ba+wu+"]",So="\\ud83c[\\udffb-\\udfff]",Hs="(?:"+On+"|"+So+")",gl="[^"+$s+"]",Vs="(?:\\ud83c[\\udde6-\\uddff]){2}",kc="[\\ud800-\\udbff][\\udc00-\\udfff]",ag="["+wu+"]",PC="\\u200d",gx="(?:"+oi+"|"+Wi+")",wB="(?:"+ag+"|"+Wi+")",nN="(?:"+$a+"(?:d|ll|m|re|s|t|ve))?",pn="(?:"+$a+"(?:D|LL|M|RE|S|T|VE))?",Zn=Hs+"?",tr="["+Ic+"]?",Fr="(?:"+PC+"(?:"+[gl,Vs,kc].join("|")+")"+tr+Zn+")*",Kr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",AC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lg=tr+Zn+Fr,px="(?:"+[Zt,Vs,kc].join("|")+")"+lg,iN="(?:"+[gl+On+"?",On,Vs,kc,Qt].join("|")+")",OC=RegExp($a,"g"),HDe=RegExp(On,"g"),SB=RegExp(So+"(?="+So+")|"+iN+lg,"g"),VDe=RegExp([ag+"?"+oi+"+"+nN+"(?="+[$t,ag,"$"].join("|")+")",wB+"+"+pn+"(?="+[$t,ag+gx,"$"].join("|")+")",ag+"?"+gx+"+"+nN,ag+"+"+pn,AC,Kr,Jt,px].join("|"),"g"),zDe=RegExp("["+PC+$s+wo+Ic+"]"),UDe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jDe=["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"],KDe=-1,no={};no[oe]=no[ce]=no[fe]=no[Ie]=no[Te]=no[He]=no[Me]=no[bt]=no[rt]=!0,no[ge]=no[ye]=no[pe]=no[Ge]=no[ke]=no[nt]=no[_e]=no[Ve]=no[Pe]=no[Be]=no[Ye]=no[re]=no[ue]=no[de]=no[se]=!1;var Gr={};Gr[ge]=Gr[ye]=Gr[pe]=Gr[ke]=Gr[Ge]=Gr[nt]=Gr[oe]=Gr[ce]=Gr[fe]=Gr[Ie]=Gr[Te]=Gr[Pe]=Gr[Be]=Gr[Ye]=Gr[re]=Gr[ue]=Gr[de]=Gr[z]=Gr[He]=Gr[Me]=Gr[bt]=Gr[rt]=!0,Gr[_e]=Gr[Ve]=Gr[se]=!1;var GDe={À:"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"},qDe={"&":"&","<":"<",">":">",'"':""","'":"'"},XDe={"&":"&","<":"<",">":">",""":'"',"'":"'"},YDe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ZDe=parseFloat,QDe=parseInt,vJ=typeof Nx=="object"&&Nx&&Nx.Object===Object&&Nx,JDe=typeof self=="object"&&self&&self.Object===Object&&self,oa=vJ||JDe||Function("return this")(),xB=e&&!e.nodeType&&e,U_=xB&&!0&&i&&!i.nodeType&&i,_J=U_&&U_.exports===xB,LB=_J&&vJ.process,Su=function(){try{var Ne=U_&&U_.require&&U_.require("util").types;return Ne||LB&&LB.binding&&LB.binding("util")}catch{}}(),bJ=Su&&Su.isArrayBuffer,CJ=Su&&Su.isDate,yJ=Su&&Su.isMap,wJ=Su&&Su.isRegExp,SJ=Su&&Su.isSet,xJ=Su&&Su.isTypedArray;function Tc(Ne,lt,it){switch(it.length){case 0:return Ne.call(lt);case 1:return Ne.call(lt,it[0]);case 2:return Ne.call(lt,it[0],it[1]);case 3:return Ne.call(lt,it[0],it[1],it[2])}return Ne.apply(lt,it)}function eIe(Ne,lt,it,rn){for(var ti=-1,or=Ne==null?0:Ne.length;++ti-1}function EB(Ne,lt,it){for(var rn=-1,ti=Ne==null?0:Ne.length;++rn-1;);return it}function RJ(Ne,lt){for(var it=Ne.length;it--&&FC(lt,Ne[it],0)>-1;);return it}function cIe(Ne,lt){for(var it=Ne.length,rn=0;it--;)Ne[it]===lt&&++rn;return rn}var uIe=TB(GDe),dIe=TB(qDe);function hIe(Ne){return"\\"+YDe[Ne]}function fIe(Ne,lt){return Ne==null?t:Ne[lt]}function BC(Ne){return zDe.test(Ne)}function gIe(Ne){return UDe.test(Ne)}function pIe(Ne){for(var lt,it=[];!(lt=Ne.next()).done;)it.push(lt.value);return it}function PB(Ne){var lt=-1,it=Array(Ne.size);return Ne.forEach(function(rn,ti){it[++lt]=[ti,rn]}),it}function MJ(Ne,lt){return function(it){return Ne(lt(it))}}function tm(Ne,lt){for(var it=-1,rn=Ne.length,ti=0,or=[];++it-1}function nke(b,x){var I=this.__data__,A=yN(I,b);return A<0?(++this.size,I.push([b,x])):I[A][1]=x,this}cg.prototype.clear=QIe,cg.prototype.delete=JIe,cg.prototype.get=eke,cg.prototype.has=tke,cg.prototype.set=nke;function ug(b){var x=-1,I=b==null?0:b.length;for(this.clear();++x=x?b:x)),b}function Du(b,x,I,A,V,ee){var ve,Se=x&d,Ae=x&h,mt=x&f;if(I&&(ve=V?I(b,A,V,ee):I(b)),ve!==t)return ve;if(!xo(b))return b;var vt=ii(b);if(vt){if(ve=sTe(b),!Se)return Ul(b,ve)}else{var xt=Va(b),Xt=xt==Ve||xt==Le;if(am(b))return pee(b,Se);if(xt==Ye||xt==ge||Xt&&!V){if(ve=Ae||Xt?{}:Pee(b),!Se)return Ae?Xke(b,_ke(ve,b)):qke(b,jJ(ve,b))}else{if(!Gr[xt])return V?b:{};ve=aTe(b,xt,Se)}}ee||(ee=new bd);var fn=ee.get(b);if(fn)return fn;ee.set(b,ve),cte(b)?b.forEach(function(Bn){ve.add(Du(Bn,x,I,Bn,b,ee))}):ate(b)&&b.forEach(function(Bn,_i){ve.set(_i,Du(Bn,x,I,_i,b,ee))});var Fn=mt?Ae?s8:o8:Ae?Kl:zs,ui=vt?t:Fn(b);return xu(ui||b,function(Bn,_i){ui&&(_i=Bn,Bn=b[_i]),wx(ve,_i,Du(Bn,x,I,_i,b,ee))}),ve}function bke(b){var x=zs(b);return function(I){return KJ(I,b,x)}}function KJ(b,x,I){var A=I.length;if(b==null)return!A;for(b=Br(b);A--;){var V=I[A],ee=x[V],ve=b[V];if(ve===t&&!(V in b)||!ee(ve))return!1}return!0}function GJ(b,x,I){if(typeof b!="function")throw new Lu(s);return kx(function(){b.apply(t,I)},x)}function Sx(b,x,I,A){var V=-1,ee=rN,ve=!0,Se=b.length,Ae=[],mt=x.length;if(!Se)return Ae;I&&(x=po(x,Nc(I))),A?(ee=EB,ve=!1):x.length>=r&&(ee=mx,ve=!1,x=new G_(x));e:for(;++VV?0:V+I),A=A===t||A>V?V:ai(A),A<0&&(A+=V),A=I>A?0:dte(A);I0&&I(Se)?x>1?sa(Se,x-1,I,A,V):em(V,Se):A||(V[V.length]=Se)}return V}var HB=yee(),YJ=yee(!0);function Fh(b,x){return b&&HB(b,x,zs)}function VB(b,x){return b&&YJ(b,x,zs)}function SN(b,x){return Jp(x,function(I){return pg(b[I])})}function X_(b,x){x=om(x,b);for(var I=0,A=x.length;b!=null&&Ix}function wke(b,x){return b!=null&&_r.call(b,x)}function Ske(b,x){return b!=null&&x in Br(b)}function xke(b,x,I){return b>=Ha(x,I)&&b=120&&vt.length>=120)?new G_(ve&&vt):t}vt=b[0];var xt=-1,Xt=Se[0];e:for(;++xt-1;)Se!==b&&gN.call(Se,Ae,1),gN.call(b,Ae,1);return b}function aee(b,x){for(var I=b?x.length:0,A=I-1;I--;){var V=x[I];if(I==A||V!==ee){var ee=V;gg(V)?gN.call(b,V,1):QB(b,V)}}return b}function XB(b,x){return b+vN(HJ()*(x-b+1))}function Fke(b,x,I,A){for(var V=-1,ee=xs(mN((x-b)/(I||1)),0),ve=it(ee);ee--;)ve[A?ee:++V]=b,b+=I;return ve}function YB(b,x){var I="";if(!b||x<1||x>U)return I;do x%2&&(I+=b),x=vN(x/2),x&&(b+=b);while(x);return I}function gi(b,x){return f8(Fee(b,x,Gl),b+"")}function Bke(b){return UJ(XC(b))}function Wke(b,x){var I=XC(b);return PN(I,q_(x,0,I.length))}function Ex(b,x,I,A){if(!xo(b))return b;x=om(x,b);for(var V=-1,ee=x.length,ve=ee-1,Se=b;Se!=null&&++VV?0:V+x),I=I>V?V:I,I<0&&(I+=V),V=x>I?0:I-x>>>0,x>>>=0;for(var ee=it(V);++A>>1,ve=b[ee];ve!==null&&!Mc(ve)&&(I?ve<=x:ve=r){var mt=x?null:Jke(b);if(mt)return sN(mt);ve=!1,V=mx,Ae=new G_}else Ae=x?[]:Se;e:for(;++A=A?b:Iu(b,x,I)}var gee=TIe||function(b){return oa.clearTimeout(b)};function pee(b,x){if(x)return b.slice();var I=b.length,A=OJ?OJ(I):new b.constructor(I);return b.copy(A),A}function n8(b){var x=new b.constructor(b.byteLength);return new hN(x).set(new hN(b)),x}function Uke(b,x){var I=x?n8(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function jke(b){var x=new b.constructor(b.source,Ut.exec(b));return x.lastIndex=b.lastIndex,x}function Kke(b){return yx?Br(yx.call(b)):{}}function mee(b,x){var I=x?n8(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function vee(b,x){if(b!==x){var I=b!==t,A=b===null,V=b===b,ee=Mc(b),ve=x!==t,Se=x===null,Ae=x===x,mt=Mc(x);if(!Se&&!mt&&!ee&&b>x||ee&&ve&&Ae&&!Se&&!mt||A&&ve&&Ae||!I&&Ae||!V)return 1;if(!A&&!ee&&!mt&&b=Se)return Ae;var mt=I[A];return Ae*(mt=="desc"?-1:1)}}return b.index-x.index}function _ee(b,x,I,A){for(var V=-1,ee=b.length,ve=I.length,Se=-1,Ae=x.length,mt=xs(ee-ve,0),vt=it(Ae+mt),xt=!A;++Se1?I[V-1]:t,ve=V>2?I[2]:t;for(ee=b.length>3&&typeof ee=="function"?(V--,ee):t,ve&&ml(I[0],I[1],ve)&&(ee=V<3?t:ee,V=1),x=Br(x);++A-1?V[ee?x[ve]:ve]:t}}function xee(b){return fg(function(x){var I=x.length,A=I,V=Eu.prototype.thru;for(b&&x.reverse();A--;){var ee=x[A];if(typeof ee!="function")throw new Lu(s);if(V&&!ve&&RN(ee)=="wrapper")var ve=new Eu([],!0)}for(A=ve?A:I;++A1&&Ni.reverse(),vt&&Ae<_i&&(Ni.length=Ae),this&&this!==oa&&this instanceof Bn&&(vg=ui||Dx(vg)),vg.apply(yd,Ni)}return Bn}function Lee(b,x){return function(I,A){return Lke(I,b,x(A),{})}}function kN(b,x){return function(I,A){var V;if(I===t&&A===t)return x;if(I!==t&&(V=I),A!==t){if(V===t)return A;typeof I=="string"||typeof A=="string"?(I=Rc(I),A=Rc(A)):(I=uee(I),A=uee(A)),V=b(I,A)}return V}}function i8(b){return fg(function(x){return x=po(x,Nc(An())),gi(function(I){var A=this;return b(x,function(V){return Tc(V,A,I)})})})}function TN(b,x){x=x===t?" ":Rc(x);var I=x.length;if(I<2)return I?YB(x,b):x;var A=YB(x,mN(b/WC(x)));return BC(x)?sm(_d(A),0,b).join(""):A.slice(0,b)}function Qke(b,x,I,A){var V=x&m,ee=Dx(b);function ve(){for(var Se=-1,Ae=arguments.length,mt=-1,vt=A.length,xt=it(vt+Ae),Xt=this&&this!==oa&&this instanceof ve?ee:b;++mtSe))return!1;var mt=ee.get(b),vt=ee.get(x);if(mt&&vt)return mt==x&&vt==b;var xt=-1,Xt=!0,fn=I&p?new G_:t;for(ee.set(b,x),ee.set(x,b);++xt1?"& ":"")+x[A],x=x.join(I>2?", ":" "),b.replace(Ir,`{ + */(function(i,e){(function(){var t,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,m=1,v=2,_=4,y=8,S=16,L=32,E=64,D=128,k=256,T=512,M=30,P="...",N=800,R=16,O=1,B=2,$=3,G=1/0,U=9007199254740991,j=17976931348623157e292,ie=0/0,Y=4294967295,J=Y-1,Q=Y>>>1,he=[["ary",D],["bind",m],["bindKey",v],["curry",y],["curryRight",S],["flip",T],["partial",L],["partialRight",E],["rearg",k]],ge="[object Arguments]",ye="[object Array]",be="[object AsyncFunction]",Ge="[object Boolean]",nt="[object Date]",je="[object DOMException]",_e="[object Error]",Ve="[object Function]",Le="[object GeneratorFunction]",Pe="[object Map]",Be="[object Number]",Qe="[object Null]",Ye="[object Object]",We="[object Promise]",dt="[object Proxy]",re="[object RegExp]",ue="[object Set]",de="[object String]",z="[object Symbol]",q="[object Undefined]",se="[object WeakMap]",ne="[object WeakSet]",pe="[object ArrayBuffer]",ke="[object DataView]",oe="[object Float32Array]",ce="[object Float64Array]",fe="[object Int8Array]",Ie="[object Int16Array]",Te="[object Int32Array]",He="[object Uint8Array]",Me="[object Uint8ClampedArray]",bt="[object Uint16Array]",rt="[object Uint32Array]",Ht=/\b__p \+= '';/g,Ue=/\b(__p \+=) '' \+/g,Ct=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Dt=/&(?:amp|lt|gt|quot|#39);/g,St=/[&<>"']/g,Kt=RegExp(Dt.source),_n=RegExp(St.source),zt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ht=/^\w*$/,Lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,At=/[\\^$.*+?()[\]{}|]/g,ln=RegExp(At.source),Si=/^\s+/,Xi=/\s/,Ir=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,En=/\{\n\/\* \[wrapped with (.+)\] \*/,fi=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,go=/[()=,{}\[\]\/\s]/,ys=/\\(\\)?/g,ws=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ut=/\w*$/,Ee=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,kt=/^\[object .+?Constructor\]$/,qn=/^0o[0-7]+$/i,dr=/^(?:0|[1-9]\d*)$/,jr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,to=/['\n\r\u2028\u2029\\]/g,$s="\\ud800-\\udfff",Hl="\\u0300-\\u036f",Oa="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",wo=Hl+Oa+Uo,Fa="\\u2700-\\u27bf",Ba="a-z\\xdf-\\xf6\\xf8-\\xff",Vl="\\xac\\xb1\\xd7\\xf7",fl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zl="\\u2000-\\u206f",yu=" \\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",wu="A-Z\\xc0-\\xd6\\xd8-\\xde",Ic="\\ufe0e\\ufe0f",Wa=Vl+fl+zl+yu,$a="['’]",Qt="["+$s+"]",$t="["+Wa+"]",On="["+wo+"]",Jt="\\d+",Zt="["+Fa+"]",oi="["+Ba+"]",Wi="[^"+$s+Wa+Jt+Fa+Ba+wu+"]",So="\\ud83c[\\udffb-\\udfff]",Hs="(?:"+On+"|"+So+")",gl="[^"+$s+"]",Vs="(?:\\ud83c[\\udde6-\\uddff]){2}",kc="[\\ud800-\\udbff][\\udc00-\\udfff]",ag="["+wu+"]",PC="\\u200d",gx="(?:"+oi+"|"+Wi+")",wB="(?:"+ag+"|"+Wi+")",nN="(?:"+$a+"(?:d|ll|m|re|s|t|ve))?",pn="(?:"+$a+"(?:D|LL|M|RE|S|T|VE))?",Zn=Hs+"?",nr="["+Ic+"]?",Fr="(?:"+PC+"(?:"+[gl,Vs,kc].join("|")+")"+nr+Zn+")*",Kr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",AC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lg=nr+Zn+Fr,px="(?:"+[Zt,Vs,kc].join("|")+")"+lg,iN="(?:"+[gl+On+"?",On,Vs,kc,Qt].join("|")+")",OC=RegExp($a,"g"),HDe=RegExp(On,"g"),SB=RegExp(So+"(?="+So+")|"+iN+lg,"g"),VDe=RegExp([ag+"?"+oi+"+"+nN+"(?="+[$t,ag,"$"].join("|")+")",wB+"+"+pn+"(?="+[$t,ag+gx,"$"].join("|")+")",ag+"?"+gx+"+"+nN,ag+"+"+pn,AC,Kr,Jt,px].join("|"),"g"),zDe=RegExp("["+PC+$s+wo+Ic+"]"),UDe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jDe=["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"],KDe=-1,no={};no[oe]=no[ce]=no[fe]=no[Ie]=no[Te]=no[He]=no[Me]=no[bt]=no[rt]=!0,no[ge]=no[ye]=no[pe]=no[Ge]=no[ke]=no[nt]=no[_e]=no[Ve]=no[Pe]=no[Be]=no[Ye]=no[re]=no[ue]=no[de]=no[se]=!1;var Gr={};Gr[ge]=Gr[ye]=Gr[pe]=Gr[ke]=Gr[Ge]=Gr[nt]=Gr[oe]=Gr[ce]=Gr[fe]=Gr[Ie]=Gr[Te]=Gr[Pe]=Gr[Be]=Gr[Ye]=Gr[re]=Gr[ue]=Gr[de]=Gr[z]=Gr[He]=Gr[Me]=Gr[bt]=Gr[rt]=!0,Gr[_e]=Gr[Ve]=Gr[se]=!1;var GDe={À:"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"},qDe={"&":"&","<":"<",">":">",'"':""","'":"'"},XDe={"&":"&","<":"<",">":">",""":'"',"'":"'"},YDe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ZDe=parseFloat,QDe=parseInt,vJ=typeof Nx=="object"&&Nx&&Nx.Object===Object&&Nx,JDe=typeof self=="object"&&self&&self.Object===Object&&self,oa=vJ||JDe||Function("return this")(),xB=e&&!e.nodeType&&e,j_=xB&&!0&&i&&!i.nodeType&&i,_J=j_&&j_.exports===xB,LB=_J&&vJ.process,Su=function(){try{var Ne=j_&&j_.require&&j_.require("util").types;return Ne||LB&&LB.binding&&LB.binding("util")}catch{}}(),bJ=Su&&Su.isArrayBuffer,CJ=Su&&Su.isDate,yJ=Su&&Su.isMap,wJ=Su&&Su.isRegExp,SJ=Su&&Su.isSet,xJ=Su&&Su.isTypedArray;function Tc(Ne,lt,it){switch(it.length){case 0:return Ne.call(lt);case 1:return Ne.call(lt,it[0]);case 2:return Ne.call(lt,it[0],it[1]);case 3:return Ne.call(lt,it[0],it[1],it[2])}return Ne.apply(lt,it)}function eIe(Ne,lt,it,rn){for(var ti=-1,sr=Ne==null?0:Ne.length;++ti-1}function EB(Ne,lt,it){for(var rn=-1,ti=Ne==null?0:Ne.length;++rn-1;);return it}function RJ(Ne,lt){for(var it=Ne.length;it--&&FC(lt,Ne[it],0)>-1;);return it}function cIe(Ne,lt){for(var it=Ne.length,rn=0;it--;)Ne[it]===lt&&++rn;return rn}var uIe=TB(GDe),dIe=TB(qDe);function hIe(Ne){return"\\"+YDe[Ne]}function fIe(Ne,lt){return Ne==null?t:Ne[lt]}function BC(Ne){return zDe.test(Ne)}function gIe(Ne){return UDe.test(Ne)}function pIe(Ne){for(var lt,it=[];!(lt=Ne.next()).done;)it.push(lt.value);return it}function PB(Ne){var lt=-1,it=Array(Ne.size);return Ne.forEach(function(rn,ti){it[++lt]=[ti,rn]}),it}function MJ(Ne,lt){return function(it){return Ne(lt(it))}}function tm(Ne,lt){for(var it=-1,rn=Ne.length,ti=0,sr=[];++it-1}function nke(b,x){var I=this.__data__,A=yN(I,b);return A<0?(++this.size,I.push([b,x])):I[A][1]=x,this}cg.prototype.clear=QIe,cg.prototype.delete=JIe,cg.prototype.get=eke,cg.prototype.has=tke,cg.prototype.set=nke;function ug(b){var x=-1,I=b==null?0:b.length;for(this.clear();++x=x?b:x)),b}function Du(b,x,I,A,V,ee){var ve,Se=x&d,Ae=x&h,mt=x&f;if(I&&(ve=V?I(b,A,V,ee):I(b)),ve!==t)return ve;if(!xo(b))return b;var vt=ii(b);if(vt){if(ve=sTe(b),!Se)return Ul(b,ve)}else{var xt=Va(b),Xt=xt==Ve||xt==Le;if(am(b))return pee(b,Se);if(xt==Ye||xt==ge||Xt&&!V){if(ve=Ae||Xt?{}:Pee(b),!Se)return Ae?Xke(b,_ke(ve,b)):qke(b,jJ(ve,b))}else{if(!Gr[xt])return V?b:{};ve=aTe(b,xt,Se)}}ee||(ee=new bd);var fn=ee.get(b);if(fn)return fn;ee.set(b,ve),cte(b)?b.forEach(function(Bn){ve.add(Du(Bn,x,I,Bn,b,ee))}):ate(b)&&b.forEach(function(Bn,_i){ve.set(_i,Du(Bn,x,I,_i,b,ee))});var Fn=mt?Ae?s8:o8:Ae?Kl:zs,ui=vt?t:Fn(b);return xu(ui||b,function(Bn,_i){ui&&(_i=Bn,Bn=b[_i]),wx(ve,_i,Du(Bn,x,I,_i,b,ee))}),ve}function bke(b){var x=zs(b);return function(I){return KJ(I,b,x)}}function KJ(b,x,I){var A=I.length;if(b==null)return!A;for(b=Br(b);A--;){var V=I[A],ee=x[V],ve=b[V];if(ve===t&&!(V in b)||!ee(ve))return!1}return!0}function GJ(b,x,I){if(typeof b!="function")throw new Lu(s);return kx(function(){b.apply(t,I)},x)}function Sx(b,x,I,A){var V=-1,ee=rN,ve=!0,Se=b.length,Ae=[],mt=x.length;if(!Se)return Ae;I&&(x=po(x,Nc(I))),A?(ee=EB,ve=!1):x.length>=r&&(ee=mx,ve=!1,x=new q_(x));e:for(;++VV?0:V+I),A=A===t||A>V?V:ai(A),A<0&&(A+=V),A=I>A?0:dte(A);I0&&I(Se)?x>1?sa(Se,x-1,I,A,V):em(V,Se):A||(V[V.length]=Se)}return V}var HB=yee(),YJ=yee(!0);function Fh(b,x){return b&&HB(b,x,zs)}function VB(b,x){return b&&YJ(b,x,zs)}function SN(b,x){return Jp(x,function(I){return pg(b[I])})}function Y_(b,x){x=om(x,b);for(var I=0,A=x.length;b!=null&&Ix}function wke(b,x){return b!=null&&_r.call(b,x)}function Ske(b,x){return b!=null&&x in Br(b)}function xke(b,x,I){return b>=Ha(x,I)&&b=120&&vt.length>=120)?new q_(ve&&vt):t}vt=b[0];var xt=-1,Xt=Se[0];e:for(;++xt-1;)Se!==b&&gN.call(Se,Ae,1),gN.call(b,Ae,1);return b}function aee(b,x){for(var I=b?x.length:0,A=I-1;I--;){var V=x[I];if(I==A||V!==ee){var ee=V;gg(V)?gN.call(b,V,1):QB(b,V)}}return b}function XB(b,x){return b+vN(HJ()*(x-b+1))}function Fke(b,x,I,A){for(var V=-1,ee=xs(mN((x-b)/(I||1)),0),ve=it(ee);ee--;)ve[A?ee:++V]=b,b+=I;return ve}function YB(b,x){var I="";if(!b||x<1||x>U)return I;do x%2&&(I+=b),x=vN(x/2),x&&(b+=b);while(x);return I}function gi(b,x){return f8(Fee(b,x,Gl),b+"")}function Bke(b){return UJ(XC(b))}function Wke(b,x){var I=XC(b);return PN(I,X_(x,0,I.length))}function Ex(b,x,I,A){if(!xo(b))return b;x=om(x,b);for(var V=-1,ee=x.length,ve=ee-1,Se=b;Se!=null&&++VV?0:V+x),I=I>V?V:I,I<0&&(I+=V),V=x>I?0:I-x>>>0,x>>>=0;for(var ee=it(V);++A>>1,ve=b[ee];ve!==null&&!Mc(ve)&&(I?ve<=x:ve=r){var mt=x?null:Jke(b);if(mt)return sN(mt);ve=!1,V=mx,Ae=new q_}else Ae=x?[]:Se;e:for(;++A=A?b:Iu(b,x,I)}var gee=TIe||function(b){return oa.clearTimeout(b)};function pee(b,x){if(x)return b.slice();var I=b.length,A=OJ?OJ(I):new b.constructor(I);return b.copy(A),A}function n8(b){var x=new b.constructor(b.byteLength);return new hN(x).set(new hN(b)),x}function Uke(b,x){var I=x?n8(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function jke(b){var x=new b.constructor(b.source,Ut.exec(b));return x.lastIndex=b.lastIndex,x}function Kke(b){return yx?Br(yx.call(b)):{}}function mee(b,x){var I=x?n8(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function vee(b,x){if(b!==x){var I=b!==t,A=b===null,V=b===b,ee=Mc(b),ve=x!==t,Se=x===null,Ae=x===x,mt=Mc(x);if(!Se&&!mt&&!ee&&b>x||ee&&ve&&Ae&&!Se&&!mt||A&&ve&&Ae||!I&&Ae||!V)return 1;if(!A&&!ee&&!mt&&b=Se)return Ae;var mt=I[A];return Ae*(mt=="desc"?-1:1)}}return b.index-x.index}function _ee(b,x,I,A){for(var V=-1,ee=b.length,ve=I.length,Se=-1,Ae=x.length,mt=xs(ee-ve,0),vt=it(Ae+mt),xt=!A;++Se1?I[V-1]:t,ve=V>2?I[2]:t;for(ee=b.length>3&&typeof ee=="function"?(V--,ee):t,ve&&ml(I[0],I[1],ve)&&(ee=V<3?t:ee,V=1),x=Br(x);++A-1?V[ee?x[ve]:ve]:t}}function xee(b){return fg(function(x){var I=x.length,A=I,V=Eu.prototype.thru;for(b&&x.reverse();A--;){var ee=x[A];if(typeof ee!="function")throw new Lu(s);if(V&&!ve&&RN(ee)=="wrapper")var ve=new Eu([],!0)}for(A=ve?A:I;++A1&&Ni.reverse(),vt&&Ae<_i&&(Ni.length=Ae),this&&this!==oa&&this instanceof Bn&&(vg=ui||Dx(vg)),vg.apply(yd,Ni)}return Bn}function Lee(b,x){return function(I,A){return Lke(I,b,x(A),{})}}function kN(b,x){return function(I,A){var V;if(I===t&&A===t)return x;if(I!==t&&(V=I),A!==t){if(V===t)return A;typeof I=="string"||typeof A=="string"?(I=Rc(I),A=Rc(A)):(I=uee(I),A=uee(A)),V=b(I,A)}return V}}function i8(b){return fg(function(x){return x=po(x,Nc(An())),gi(function(I){var A=this;return b(x,function(V){return Tc(V,A,I)})})})}function TN(b,x){x=x===t?" ":Rc(x);var I=x.length;if(I<2)return I?YB(x,b):x;var A=YB(x,mN(b/WC(x)));return BC(x)?sm(_d(A),0,b).join(""):A.slice(0,b)}function Qke(b,x,I,A){var V=x&m,ee=Dx(b);function ve(){for(var Se=-1,Ae=arguments.length,mt=-1,vt=A.length,xt=it(vt+Ae),Xt=this&&this!==oa&&this instanceof ve?ee:b;++mtSe))return!1;var mt=ee.get(b),vt=ee.get(x);if(mt&&vt)return mt==x&&vt==b;var xt=-1,Xt=!0,fn=I&p?new q_:t;for(ee.set(b,x),ee.set(x,b);++xt1?"& ":"")+x[A],x=x.join(I>2?", ":" "),b.replace(Ir,`{ /* [wrapped with `+x+`] */ -`)}function cTe(b){return ii(b)||Q_(b)||!!(WJ&&b&&b[WJ])}function gg(b,x){var I=typeof b;return x=x??U,!!x&&(I=="number"||I!="symbol"&&dr.test(b))&&b>-1&&b%1==0&&b0){if(++x>=N)return arguments[0]}else x=0;return b.apply(t,arguments)}}function PN(b,x){var I=-1,A=b.length,V=A-1;for(x=x===t?A:x;++I1?b[x-1]:t;return I=typeof I=="function"?(b.pop(),I):t,Xee(b,I)});function Yee(b){var x=Z(b);return x.__chain__=!0,x}function CNe(b,x){return x(b),b}function AN(b,x){return x(b)}var yNe=fg(function(b){var x=b.length,I=x?b[0]:0,A=this.__wrapped__,V=function(ee){return $B(ee,b)};return x>1||this.__actions__.length||!(A instanceof xi)||!gg(I)?this.thru(V):(A=A.slice(I,+I+(x?1:0)),A.__actions__.push({func:AN,args:[V],thisArg:t}),new Eu(A,this.__chain__).thru(function(ee){return x&&!ee.length&&ee.push(t),ee}))});function wNe(){return Yee(this)}function SNe(){return new Eu(this.value(),this.__chain__)}function xNe(){this.__values__===t&&(this.__values__=ute(this.value()));var b=this.__index__>=this.__values__.length,x=b?t:this.__values__[this.__index__++];return{done:b,value:x}}function LNe(){return this}function ENe(b){for(var x,I=this;I instanceof CN;){var A=zee(I);A.__index__=0,A.__values__=t,x?V.__wrapped__=A:x=A;var V=A;I=I.__wrapped__}return V.__wrapped__=b,x}function DNe(){var b=this.__wrapped__;if(b instanceof xi){var x=b;return this.__actions__.length&&(x=new xi(this)),x=x.reverse(),x.__actions__.push({func:AN,args:[g8],thisArg:t}),new Eu(x,this.__chain__)}return this.thru(g8)}function INe(){return hee(this.__wrapped__,this.__actions__)}var kNe=DN(function(b,x,I){_r.call(b,I)?++b[I]:dg(b,I,1)});function TNe(b,x,I){var A=ii(b)?LJ:Cke;return I&&ml(b,x,I)&&(x=t),A(b,An(x,3))}function NNe(b,x){var I=ii(b)?Jp:XJ;return I(b,An(x,3))}var RNe=See(Uee),MNe=See(jee);function PNe(b,x){return sa(ON(b,x),1)}function ANe(b,x){return sa(ON(b,x),G)}function ONe(b,x,I){return I=I===t?1:ai(I),sa(ON(b,x),I)}function Zee(b,x){var I=ii(b)?xu:im;return I(b,An(x,3))}function Qee(b,x){var I=ii(b)?tIe:qJ;return I(b,An(x,3))}var FNe=DN(function(b,x,I){_r.call(b,I)?b[I].push(x):dg(b,I,[x])});function BNe(b,x,I,A){b=jl(b)?b:XC(b),I=I&&!A?ai(I):0;var V=b.length;return I<0&&(I=xs(V+I,0)),HN(b)?I<=V&&b.indexOf(x,I)>-1:!!V&&FC(b,x,I)>-1}var WNe=gi(function(b,x,I){var A=-1,V=typeof x=="function",ee=jl(b)?it(b.length):[];return im(b,function(ve){ee[++A]=V?Tc(x,ve,I):xx(ve,x,I)}),ee}),$Ne=DN(function(b,x,I){dg(b,I,x)});function ON(b,x){var I=ii(b)?po:tee;return I(b,An(x,3))}function HNe(b,x,I,A){return b==null?[]:(ii(x)||(x=x==null?[]:[x]),I=A?t:I,ii(I)||(I=I==null?[]:[I]),oee(b,x,I))}var VNe=DN(function(b,x,I){b[I?0:1].push(x)},function(){return[[],[]]});function zNe(b,x,I){var A=ii(b)?DB:kJ,V=arguments.length<3;return A(b,An(x,4),I,V,im)}function UNe(b,x,I){var A=ii(b)?nIe:kJ,V=arguments.length<3;return A(b,An(x,4),I,V,qJ)}function jNe(b,x){var I=ii(b)?Jp:XJ;return I(b,WN(An(x,3)))}function KNe(b){var x=ii(b)?UJ:Bke;return x(b)}function GNe(b,x,I){(I?ml(b,x,I):x===t)?x=1:x=ai(x);var A=ii(b)?pke:Wke;return A(b,x)}function qNe(b){var x=ii(b)?mke:Hke;return x(b)}function XNe(b){if(b==null)return 0;if(jl(b))return HN(b)?WC(b):b.length;var x=Va(b);return x==Pe||x==ue?b.size:KB(b).length}function YNe(b,x,I){var A=ii(b)?IB:Vke;return I&&ml(b,x,I)&&(x=t),A(b,An(x,3))}var ZNe=gi(function(b,x){if(b==null)return[];var I=x.length;return I>1&&ml(b,x[0],x[1])?x=[]:I>2&&ml(x[0],x[1],x[2])&&(x=[x[0]]),oee(b,sa(x,1),[])}),FN=NIe||function(){return oa.Date.now()};function QNe(b,x){if(typeof x!="function")throw new Lu(s);return b=ai(b),function(){if(--b<1)return x.apply(this,arguments)}}function Jee(b,x,I){return x=I?t:x,x=b&&x==null?b.length:x,hg(b,D,t,t,t,t,x)}function ete(b,x){var I;if(typeof x!="function")throw new Lu(s);return b=ai(b),function(){return--b>0&&(I=x.apply(this,arguments)),b<=1&&(x=t),I}}var m8=gi(function(b,x,I){var A=m;if(I.length){var V=tm(I,GC(m8));A|=L}return hg(b,A,x,I,V)}),tte=gi(function(b,x,I){var A=m|v;if(I.length){var V=tm(I,GC(tte));A|=L}return hg(x,A,b,I,V)});function nte(b,x,I){x=I?t:x;var A=hg(b,y,t,t,t,t,t,x);return A.placeholder=nte.placeholder,A}function ite(b,x,I){x=I?t:x;var A=hg(b,S,t,t,t,t,t,x);return A.placeholder=ite.placeholder,A}function rte(b,x,I){var A,V,ee,ve,Se,Ae,mt=0,vt=!1,xt=!1,Xt=!0;if(typeof b!="function")throw new Lu(s);x=Tu(x)||0,xo(I)&&(vt=!!I.leading,xt="maxWait"in I,ee=xt?xs(Tu(I.maxWait)||0,x):ee,Xt="trailing"in I?!!I.trailing:Xt);function fn(Ko){var yd=A,vg=V;return A=V=t,mt=Ko,ve=b.apply(vg,yd),ve}function Fn(Ko){return mt=Ko,Se=kx(_i,x),vt?fn(Ko):ve}function ui(Ko){var yd=Ko-Ae,vg=Ko-mt,Ste=x-yd;return xt?Ha(Ste,ee-vg):Ste}function Bn(Ko){var yd=Ko-Ae,vg=Ko-mt;return Ae===t||yd>=x||yd<0||xt&&vg>=ee}function _i(){var Ko=FN();if(Bn(Ko))return Ni(Ko);Se=kx(_i,ui(Ko))}function Ni(Ko){return Se=t,Xt&&A?fn(Ko):(A=V=t,ve)}function Pc(){Se!==t&&gee(Se),mt=0,A=Ae=V=Se=t}function vl(){return Se===t?ve:Ni(FN())}function Ac(){var Ko=FN(),yd=Bn(Ko);if(A=arguments,V=this,Ae=Ko,yd){if(Se===t)return Fn(Ae);if(xt)return gee(Se),Se=kx(_i,x),fn(Ae)}return Se===t&&(Se=kx(_i,x)),ve}return Ac.cancel=Pc,Ac.flush=vl,Ac}var JNe=gi(function(b,x){return GJ(b,1,x)}),eRe=gi(function(b,x,I){return GJ(b,Tu(x)||0,I)});function tRe(b){return hg(b,T)}function BN(b,x){if(typeof b!="function"||x!=null&&typeof x!="function")throw new Lu(s);var I=function(){var A=arguments,V=x?x.apply(this,A):A[0],ee=I.cache;if(ee.has(V))return ee.get(V);var ve=b.apply(this,A);return I.cache=ee.set(V,ve)||ee,ve};return I.cache=new(BN.Cache||ug),I}BN.Cache=ug;function WN(b){if(typeof b!="function")throw new Lu(s);return function(){var x=arguments;switch(x.length){case 0:return!b.call(this);case 1:return!b.call(this,x[0]);case 2:return!b.call(this,x[0],x[1]);case 3:return!b.call(this,x[0],x[1],x[2])}return!b.apply(this,x)}}function nRe(b){return ete(2,b)}var iRe=zke(function(b,x){x=x.length==1&&ii(x[0])?po(x[0],Nc(An())):po(sa(x,1),Nc(An()));var I=x.length;return gi(function(A){for(var V=-1,ee=Ha(A.length,I);++V=x}),Q_=QJ(function(){return arguments}())?QJ:function(b){return Po(b)&&_r.call(b,"callee")&&!BJ.call(b,"callee")},ii=it.isArray,_Re=bJ?Nc(bJ):Eke;function jl(b){return b!=null&&$N(b.length)&&!pg(b)}function jo(b){return Po(b)&&jl(b)}function bRe(b){return b===!0||b===!1||Po(b)&&pl(b)==Ge}var am=MIe||I8,CRe=CJ?Nc(CJ):Dke;function yRe(b){return Po(b)&&b.nodeType===1&&!Tx(b)}function wRe(b){if(b==null)return!0;if(jl(b)&&(ii(b)||typeof b=="string"||typeof b.splice=="function"||am(b)||qC(b)||Q_(b)))return!b.length;var x=Va(b);if(x==Pe||x==ue)return!b.size;if(Ix(b))return!KB(b).length;for(var I in b)if(_r.call(b,I))return!1;return!0}function SRe(b,x){return Lx(b,x)}function xRe(b,x,I){I=typeof I=="function"?I:t;var A=I?I(b,x):t;return A===t?Lx(b,x,t,I):!!A}function _8(b){if(!Po(b))return!1;var x=pl(b);return x==_e||x==je||typeof b.message=="string"&&typeof b.name=="string"&&!Tx(b)}function LRe(b){return typeof b=="number"&&$J(b)}function pg(b){if(!xo(b))return!1;var x=pl(b);return x==Ve||x==Le||x==be||x==dt}function ste(b){return typeof b=="number"&&b==ai(b)}function $N(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=U}function xo(b){var x=typeof b;return b!=null&&(x=="object"||x=="function")}function Po(b){return b!=null&&typeof b=="object"}var ate=yJ?Nc(yJ):kke;function ERe(b,x){return b===x||jB(b,x,l8(x))}function DRe(b,x,I){return I=typeof I=="function"?I:t,jB(b,x,l8(x),I)}function IRe(b){return lte(b)&&b!=+b}function kRe(b){if(hTe(b))throw new ti(o);return JJ(b)}function TRe(b){return b===null}function NRe(b){return b==null}function lte(b){return typeof b=="number"||Po(b)&&pl(b)==Be}function Tx(b){if(!Po(b)||pl(b)!=Ye)return!1;var x=fN(b);if(x===null)return!0;var I=_r.call(x,"constructor")&&x.constructor;return typeof I=="function"&&I instanceof I&&cN.call(I)==DIe}var b8=wJ?Nc(wJ):Tke;function RRe(b){return ste(b)&&b>=-U&&b<=U}var cte=SJ?Nc(SJ):Nke;function HN(b){return typeof b=="string"||!ii(b)&&Po(b)&&pl(b)==de}function Mc(b){return typeof b=="symbol"||Po(b)&&pl(b)==z}var qC=xJ?Nc(xJ):Rke;function MRe(b){return b===t}function PRe(b){return Po(b)&&Va(b)==se}function ARe(b){return Po(b)&&pl(b)==ne}var ORe=NN(GB),FRe=NN(function(b,x){return b<=x});function ute(b){if(!b)return[];if(jl(b))return HN(b)?_d(b):Ul(b);if(vx&&b[vx])return pIe(b[vx]());var x=Va(b),I=x==Pe?PB:x==ue?sN:XC;return I(b)}function mg(b){if(!b)return b===0?b:0;if(b=Tu(b),b===G||b===-G){var x=b<0?-1:1;return x*j}return b===b?b:0}function ai(b){var x=mg(b),I=x%1;return x===x?I?x-I:x:0}function dte(b){return b?q_(ai(b),0,Y):0}function Tu(b){if(typeof b=="number")return b;if(Mc(b))return ie;if(xo(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=xo(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=TJ(b);var I=wt.test(b);return I||qn.test(b)?QDe(b.slice(2),I?2:8):Ee.test(b)?ie:+b}function hte(b){return Bh(b,Kl(b))}function BRe(b){return b?q_(ai(b),-U,U):b===0?b:0}function hr(b){return b==null?"":Rc(b)}var WRe=jC(function(b,x){if(Ix(x)||jl(x)){Bh(x,zs(x),b);return}for(var I in x)_r.call(x,I)&&wx(b,I,x[I])}),fte=jC(function(b,x){Bh(x,Kl(x),b)}),VN=jC(function(b,x,I,A){Bh(x,Kl(x),b,A)}),$Re=jC(function(b,x,I,A){Bh(x,zs(x),b,A)}),HRe=fg($B);function VRe(b,x){var I=UC(b);return x==null?I:jJ(I,x)}var zRe=gi(function(b,x){b=Br(b);var I=-1,A=x.length,V=A>2?x[2]:t;for(V&&ml(x[0],x[1],V)&&(A=1);++I1),ee}),Bh(b,s8(b),I),A&&(I=Du(I,d|h|f,eTe));for(var V=x.length;V--;)QB(I,x[V]);return I});function a2e(b,x){return pte(b,WN(An(x)))}var l2e=fg(function(b,x){return b==null?{}:Ake(b,x)});function pte(b,x){if(b==null)return{};var I=po(s8(b),function(A){return[A]});return x=An(x),see(b,I,function(A,V){return x(A,V[0])})}function c2e(b,x,I){x=om(x,b);var A=-1,V=x.length;for(V||(V=1,b=t);++Ax){var A=b;b=x,x=A}if(I||b%1||x%1){var V=HJ();return Ha(b+V*(x-b+ZDe("1e-"+((V+"").length-1))),x)}return XB(b,x)}var C2e=KC(function(b,x,I){return x=x.toLowerCase(),b+(I?_te(x):x)});function _te(b){return w8(hr(b).toLowerCase())}function bte(b){return b=hr(b),b&&b.replace(jr,uIe).replace(HDe,"")}function y2e(b,x,I){b=hr(b),x=Rc(x);var A=b.length;I=I===t?A:q_(ai(I),0,A);var V=I;return I-=x.length,I>=0&&b.slice(I,V)==x}function w2e(b){return b=hr(b),b&&_n.test(b)?b.replace(St,dIe):b}function S2e(b){return b=hr(b),b&&ln.test(b)?b.replace(At,"\\$&"):b}var x2e=KC(function(b,x,I){return b+(I?"-":"")+x.toLowerCase()}),L2e=KC(function(b,x,I){return b+(I?" ":"")+x.toLowerCase()}),E2e=wee("toLowerCase");function D2e(b,x,I){b=hr(b),x=ai(x);var A=x?WC(b):0;if(!x||A>=x)return b;var V=(x-A)/2;return TN(vN(V),I)+b+TN(mN(V),I)}function I2e(b,x,I){b=hr(b),x=ai(x);var A=x?WC(b):0;return x&&A>>0,I?(b=hr(b),b&&(typeof x=="string"||x!=null&&!b8(x))&&(x=Rc(x),!x&&BC(b))?sm(_d(b),0,I):b.split(x,I)):[]}var A2e=KC(function(b,x,I){return b+(I?" ":"")+w8(x)});function O2e(b,x,I){return b=hr(b),I=I==null?0:q_(ai(I),0,b.length),x=Rc(x),b.slice(I,I+x.length)==x}function F2e(b,x,I){var A=Z.templateSettings;I&&ml(b,x,I)&&(x=t),b=hr(b),x=VN({},x,A,kee);var V=VN({},x.imports,A.imports,kee),ee=zs(V),ve=MB(V,ee),Se,Ae,mt=0,vt=x.interpolate||ei,xt="__p += '",Xt=AB((x.escape||ei).source+"|"+vt.source+"|"+(vt===at?ws:ei).source+"|"+(x.evaluate||ei).source+"|$","g"),fn="//# sourceURL="+(_r.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++KDe+"]")+` +`)}function cTe(b){return ii(b)||J_(b)||!!(WJ&&b&&b[WJ])}function gg(b,x){var I=typeof b;return x=x??U,!!x&&(I=="number"||I!="symbol"&&dr.test(b))&&b>-1&&b%1==0&&b0){if(++x>=N)return arguments[0]}else x=0;return b.apply(t,arguments)}}function PN(b,x){var I=-1,A=b.length,V=A-1;for(x=x===t?A:x;++I1?b[x-1]:t;return I=typeof I=="function"?(b.pop(),I):t,Xee(b,I)});function Yee(b){var x=Z(b);return x.__chain__=!0,x}function CNe(b,x){return x(b),b}function AN(b,x){return x(b)}var yNe=fg(function(b){var x=b.length,I=x?b[0]:0,A=this.__wrapped__,V=function(ee){return $B(ee,b)};return x>1||this.__actions__.length||!(A instanceof xi)||!gg(I)?this.thru(V):(A=A.slice(I,+I+(x?1:0)),A.__actions__.push({func:AN,args:[V],thisArg:t}),new Eu(A,this.__chain__).thru(function(ee){return x&&!ee.length&&ee.push(t),ee}))});function wNe(){return Yee(this)}function SNe(){return new Eu(this.value(),this.__chain__)}function xNe(){this.__values__===t&&(this.__values__=ute(this.value()));var b=this.__index__>=this.__values__.length,x=b?t:this.__values__[this.__index__++];return{done:b,value:x}}function LNe(){return this}function ENe(b){for(var x,I=this;I instanceof CN;){var A=zee(I);A.__index__=0,A.__values__=t,x?V.__wrapped__=A:x=A;var V=A;I=I.__wrapped__}return V.__wrapped__=b,x}function DNe(){var b=this.__wrapped__;if(b instanceof xi){var x=b;return this.__actions__.length&&(x=new xi(this)),x=x.reverse(),x.__actions__.push({func:AN,args:[g8],thisArg:t}),new Eu(x,this.__chain__)}return this.thru(g8)}function INe(){return hee(this.__wrapped__,this.__actions__)}var kNe=DN(function(b,x,I){_r.call(b,I)?++b[I]:dg(b,I,1)});function TNe(b,x,I){var A=ii(b)?LJ:Cke;return I&&ml(b,x,I)&&(x=t),A(b,An(x,3))}function NNe(b,x){var I=ii(b)?Jp:XJ;return I(b,An(x,3))}var RNe=See(Uee),MNe=See(jee);function PNe(b,x){return sa(ON(b,x),1)}function ANe(b,x){return sa(ON(b,x),G)}function ONe(b,x,I){return I=I===t?1:ai(I),sa(ON(b,x),I)}function Zee(b,x){var I=ii(b)?xu:im;return I(b,An(x,3))}function Qee(b,x){var I=ii(b)?tIe:qJ;return I(b,An(x,3))}var FNe=DN(function(b,x,I){_r.call(b,I)?b[I].push(x):dg(b,I,[x])});function BNe(b,x,I,A){b=jl(b)?b:XC(b),I=I&&!A?ai(I):0;var V=b.length;return I<0&&(I=xs(V+I,0)),HN(b)?I<=V&&b.indexOf(x,I)>-1:!!V&&FC(b,x,I)>-1}var WNe=gi(function(b,x,I){var A=-1,V=typeof x=="function",ee=jl(b)?it(b.length):[];return im(b,function(ve){ee[++A]=V?Tc(x,ve,I):xx(ve,x,I)}),ee}),$Ne=DN(function(b,x,I){dg(b,I,x)});function ON(b,x){var I=ii(b)?po:tee;return I(b,An(x,3))}function HNe(b,x,I,A){return b==null?[]:(ii(x)||(x=x==null?[]:[x]),I=A?t:I,ii(I)||(I=I==null?[]:[I]),oee(b,x,I))}var VNe=DN(function(b,x,I){b[I?0:1].push(x)},function(){return[[],[]]});function zNe(b,x,I){var A=ii(b)?DB:kJ,V=arguments.length<3;return A(b,An(x,4),I,V,im)}function UNe(b,x,I){var A=ii(b)?nIe:kJ,V=arguments.length<3;return A(b,An(x,4),I,V,qJ)}function jNe(b,x){var I=ii(b)?Jp:XJ;return I(b,WN(An(x,3)))}function KNe(b){var x=ii(b)?UJ:Bke;return x(b)}function GNe(b,x,I){(I?ml(b,x,I):x===t)?x=1:x=ai(x);var A=ii(b)?pke:Wke;return A(b,x)}function qNe(b){var x=ii(b)?mke:Hke;return x(b)}function XNe(b){if(b==null)return 0;if(jl(b))return HN(b)?WC(b):b.length;var x=Va(b);return x==Pe||x==ue?b.size:KB(b).length}function YNe(b,x,I){var A=ii(b)?IB:Vke;return I&&ml(b,x,I)&&(x=t),A(b,An(x,3))}var ZNe=gi(function(b,x){if(b==null)return[];var I=x.length;return I>1&&ml(b,x[0],x[1])?x=[]:I>2&&ml(x[0],x[1],x[2])&&(x=[x[0]]),oee(b,sa(x,1),[])}),FN=NIe||function(){return oa.Date.now()};function QNe(b,x){if(typeof x!="function")throw new Lu(s);return b=ai(b),function(){if(--b<1)return x.apply(this,arguments)}}function Jee(b,x,I){return x=I?t:x,x=b&&x==null?b.length:x,hg(b,D,t,t,t,t,x)}function ete(b,x){var I;if(typeof x!="function")throw new Lu(s);return b=ai(b),function(){return--b>0&&(I=x.apply(this,arguments)),b<=1&&(x=t),I}}var m8=gi(function(b,x,I){var A=m;if(I.length){var V=tm(I,GC(m8));A|=L}return hg(b,A,x,I,V)}),tte=gi(function(b,x,I){var A=m|v;if(I.length){var V=tm(I,GC(tte));A|=L}return hg(x,A,b,I,V)});function nte(b,x,I){x=I?t:x;var A=hg(b,y,t,t,t,t,t,x);return A.placeholder=nte.placeholder,A}function ite(b,x,I){x=I?t:x;var A=hg(b,S,t,t,t,t,t,x);return A.placeholder=ite.placeholder,A}function rte(b,x,I){var A,V,ee,ve,Se,Ae,mt=0,vt=!1,xt=!1,Xt=!0;if(typeof b!="function")throw new Lu(s);x=Tu(x)||0,xo(I)&&(vt=!!I.leading,xt="maxWait"in I,ee=xt?xs(Tu(I.maxWait)||0,x):ee,Xt="trailing"in I?!!I.trailing:Xt);function fn(Ko){var yd=A,vg=V;return A=V=t,mt=Ko,ve=b.apply(vg,yd),ve}function Fn(Ko){return mt=Ko,Se=kx(_i,x),vt?fn(Ko):ve}function ui(Ko){var yd=Ko-Ae,vg=Ko-mt,Ste=x-yd;return xt?Ha(Ste,ee-vg):Ste}function Bn(Ko){var yd=Ko-Ae,vg=Ko-mt;return Ae===t||yd>=x||yd<0||xt&&vg>=ee}function _i(){var Ko=FN();if(Bn(Ko))return Ni(Ko);Se=kx(_i,ui(Ko))}function Ni(Ko){return Se=t,Xt&&A?fn(Ko):(A=V=t,ve)}function Pc(){Se!==t&&gee(Se),mt=0,A=Ae=V=Se=t}function vl(){return Se===t?ve:Ni(FN())}function Ac(){var Ko=FN(),yd=Bn(Ko);if(A=arguments,V=this,Ae=Ko,yd){if(Se===t)return Fn(Ae);if(xt)return gee(Se),Se=kx(_i,x),fn(Ae)}return Se===t&&(Se=kx(_i,x)),ve}return Ac.cancel=Pc,Ac.flush=vl,Ac}var JNe=gi(function(b,x){return GJ(b,1,x)}),eRe=gi(function(b,x,I){return GJ(b,Tu(x)||0,I)});function tRe(b){return hg(b,T)}function BN(b,x){if(typeof b!="function"||x!=null&&typeof x!="function")throw new Lu(s);var I=function(){var A=arguments,V=x?x.apply(this,A):A[0],ee=I.cache;if(ee.has(V))return ee.get(V);var ve=b.apply(this,A);return I.cache=ee.set(V,ve)||ee,ve};return I.cache=new(BN.Cache||ug),I}BN.Cache=ug;function WN(b){if(typeof b!="function")throw new Lu(s);return function(){var x=arguments;switch(x.length){case 0:return!b.call(this);case 1:return!b.call(this,x[0]);case 2:return!b.call(this,x[0],x[1]);case 3:return!b.call(this,x[0],x[1],x[2])}return!b.apply(this,x)}}function nRe(b){return ete(2,b)}var iRe=zke(function(b,x){x=x.length==1&&ii(x[0])?po(x[0],Nc(An())):po(sa(x,1),Nc(An()));var I=x.length;return gi(function(A){for(var V=-1,ee=Ha(A.length,I);++V=x}),J_=QJ(function(){return arguments}())?QJ:function(b){return Po(b)&&_r.call(b,"callee")&&!BJ.call(b,"callee")},ii=it.isArray,_Re=bJ?Nc(bJ):Eke;function jl(b){return b!=null&&$N(b.length)&&!pg(b)}function jo(b){return Po(b)&&jl(b)}function bRe(b){return b===!0||b===!1||Po(b)&&pl(b)==Ge}var am=MIe||I8,CRe=CJ?Nc(CJ):Dke;function yRe(b){return Po(b)&&b.nodeType===1&&!Tx(b)}function wRe(b){if(b==null)return!0;if(jl(b)&&(ii(b)||typeof b=="string"||typeof b.splice=="function"||am(b)||qC(b)||J_(b)))return!b.length;var x=Va(b);if(x==Pe||x==ue)return!b.size;if(Ix(b))return!KB(b).length;for(var I in b)if(_r.call(b,I))return!1;return!0}function SRe(b,x){return Lx(b,x)}function xRe(b,x,I){I=typeof I=="function"?I:t;var A=I?I(b,x):t;return A===t?Lx(b,x,t,I):!!A}function _8(b){if(!Po(b))return!1;var x=pl(b);return x==_e||x==je||typeof b.message=="string"&&typeof b.name=="string"&&!Tx(b)}function LRe(b){return typeof b=="number"&&$J(b)}function pg(b){if(!xo(b))return!1;var x=pl(b);return x==Ve||x==Le||x==be||x==dt}function ste(b){return typeof b=="number"&&b==ai(b)}function $N(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=U}function xo(b){var x=typeof b;return b!=null&&(x=="object"||x=="function")}function Po(b){return b!=null&&typeof b=="object"}var ate=yJ?Nc(yJ):kke;function ERe(b,x){return b===x||jB(b,x,l8(x))}function DRe(b,x,I){return I=typeof I=="function"?I:t,jB(b,x,l8(x),I)}function IRe(b){return lte(b)&&b!=+b}function kRe(b){if(hTe(b))throw new ti(o);return JJ(b)}function TRe(b){return b===null}function NRe(b){return b==null}function lte(b){return typeof b=="number"||Po(b)&&pl(b)==Be}function Tx(b){if(!Po(b)||pl(b)!=Ye)return!1;var x=fN(b);if(x===null)return!0;var I=_r.call(x,"constructor")&&x.constructor;return typeof I=="function"&&I instanceof I&&cN.call(I)==DIe}var b8=wJ?Nc(wJ):Tke;function RRe(b){return ste(b)&&b>=-U&&b<=U}var cte=SJ?Nc(SJ):Nke;function HN(b){return typeof b=="string"||!ii(b)&&Po(b)&&pl(b)==de}function Mc(b){return typeof b=="symbol"||Po(b)&&pl(b)==z}var qC=xJ?Nc(xJ):Rke;function MRe(b){return b===t}function PRe(b){return Po(b)&&Va(b)==se}function ARe(b){return Po(b)&&pl(b)==ne}var ORe=NN(GB),FRe=NN(function(b,x){return b<=x});function ute(b){if(!b)return[];if(jl(b))return HN(b)?_d(b):Ul(b);if(vx&&b[vx])return pIe(b[vx]());var x=Va(b),I=x==Pe?PB:x==ue?sN:XC;return I(b)}function mg(b){if(!b)return b===0?b:0;if(b=Tu(b),b===G||b===-G){var x=b<0?-1:1;return x*j}return b===b?b:0}function ai(b){var x=mg(b),I=x%1;return x===x?I?x-I:x:0}function dte(b){return b?X_(ai(b),0,Y):0}function Tu(b){if(typeof b=="number")return b;if(Mc(b))return ie;if(xo(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=xo(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=TJ(b);var I=wt.test(b);return I||qn.test(b)?QDe(b.slice(2),I?2:8):Ee.test(b)?ie:+b}function hte(b){return Bh(b,Kl(b))}function BRe(b){return b?X_(ai(b),-U,U):b===0?b:0}function hr(b){return b==null?"":Rc(b)}var WRe=jC(function(b,x){if(Ix(x)||jl(x)){Bh(x,zs(x),b);return}for(var I in x)_r.call(x,I)&&wx(b,I,x[I])}),fte=jC(function(b,x){Bh(x,Kl(x),b)}),VN=jC(function(b,x,I,A){Bh(x,Kl(x),b,A)}),$Re=jC(function(b,x,I,A){Bh(x,zs(x),b,A)}),HRe=fg($B);function VRe(b,x){var I=UC(b);return x==null?I:jJ(I,x)}var zRe=gi(function(b,x){b=Br(b);var I=-1,A=x.length,V=A>2?x[2]:t;for(V&&ml(x[0],x[1],V)&&(A=1);++I1),ee}),Bh(b,s8(b),I),A&&(I=Du(I,d|h|f,eTe));for(var V=x.length;V--;)QB(I,x[V]);return I});function a2e(b,x){return pte(b,WN(An(x)))}var l2e=fg(function(b,x){return b==null?{}:Ake(b,x)});function pte(b,x){if(b==null)return{};var I=po(s8(b),function(A){return[A]});return x=An(x),see(b,I,function(A,V){return x(A,V[0])})}function c2e(b,x,I){x=om(x,b);var A=-1,V=x.length;for(V||(V=1,b=t);++Ax){var A=b;b=x,x=A}if(I||b%1||x%1){var V=HJ();return Ha(b+V*(x-b+ZDe("1e-"+((V+"").length-1))),x)}return XB(b,x)}var C2e=KC(function(b,x,I){return x=x.toLowerCase(),b+(I?_te(x):x)});function _te(b){return w8(hr(b).toLowerCase())}function bte(b){return b=hr(b),b&&b.replace(jr,uIe).replace(HDe,"")}function y2e(b,x,I){b=hr(b),x=Rc(x);var A=b.length;I=I===t?A:X_(ai(I),0,A);var V=I;return I-=x.length,I>=0&&b.slice(I,V)==x}function w2e(b){return b=hr(b),b&&_n.test(b)?b.replace(St,dIe):b}function S2e(b){return b=hr(b),b&&ln.test(b)?b.replace(At,"\\$&"):b}var x2e=KC(function(b,x,I){return b+(I?"-":"")+x.toLowerCase()}),L2e=KC(function(b,x,I){return b+(I?" ":"")+x.toLowerCase()}),E2e=wee("toLowerCase");function D2e(b,x,I){b=hr(b),x=ai(x);var A=x?WC(b):0;if(!x||A>=x)return b;var V=(x-A)/2;return TN(vN(V),I)+b+TN(mN(V),I)}function I2e(b,x,I){b=hr(b),x=ai(x);var A=x?WC(b):0;return x&&A>>0,I?(b=hr(b),b&&(typeof x=="string"||x!=null&&!b8(x))&&(x=Rc(x),!x&&BC(b))?sm(_d(b),0,I):b.split(x,I)):[]}var A2e=KC(function(b,x,I){return b+(I?" ":"")+w8(x)});function O2e(b,x,I){return b=hr(b),I=I==null?0:X_(ai(I),0,b.length),x=Rc(x),b.slice(I,I+x.length)==x}function F2e(b,x,I){var A=Z.templateSettings;I&&ml(b,x,I)&&(x=t),b=hr(b),x=VN({},x,A,kee);var V=VN({},x.imports,A.imports,kee),ee=zs(V),ve=MB(V,ee),Se,Ae,mt=0,vt=x.interpolate||ei,xt="__p += '",Xt=AB((x.escape||ei).source+"|"+vt.source+"|"+(vt===at?ws:ei).source+"|"+(x.evaluate||ei).source+"|$","g"),fn="//# sourceURL="+(_r.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++KDe+"]")+` `;b.replace(Xt,function(Bn,_i,Ni,Pc,vl,Ac){return Ni||(Ni=Pc),xt+=b.slice(mt,Ac).replace(to,hIe),_i&&(Se=!0,xt+=`' + __e(`+_i+`) + '`),vl&&(Ae=!0,xt+=`'; @@ -504,9 +504,9 @@ __p += '`),Ni&&(xt+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+xt+`return __p -}`;var ui=yte(function(){return or(ee,fn+"return "+xt).apply(t,ve)});if(ui.source=xt,_8(ui))throw ui;return ui}function B2e(b){return hr(b).toLowerCase()}function W2e(b){return hr(b).toUpperCase()}function $2e(b,x,I){if(b=hr(b),b&&(I||x===t))return TJ(b);if(!b||!(x=Rc(x)))return b;var A=_d(b),V=_d(x),ee=NJ(A,V),ve=RJ(A,V)+1;return sm(A,ee,ve).join("")}function H2e(b,x,I){if(b=hr(b),b&&(I||x===t))return b.slice(0,PJ(b)+1);if(!b||!(x=Rc(x)))return b;var A=_d(b),V=RJ(A,_d(x))+1;return sm(A,0,V).join("")}function V2e(b,x,I){if(b=hr(b),b&&(I||x===t))return b.replace(Si,"");if(!b||!(x=Rc(x)))return b;var A=_d(b),V=NJ(A,_d(x));return sm(A,V).join("")}function z2e(b,x){var I=M,A=P;if(xo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,A="omission"in x?Rc(x.omission):A}b=hr(b);var ee=b.length;if(BC(b)){var ve=_d(b);ee=ve.length}if(I>=ee)return b;var Se=I-WC(A);if(Se<1)return A;var Ae=ve?sm(ve,0,Se).join(""):b.slice(0,Se);if(V===t)return Ae+A;if(ve&&(Se+=Ae.length-Se),b8(V)){if(b.slice(Se).search(V)){var mt,vt=Ae;for(V.global||(V=AB(V.source,hr(Ut.exec(V))+"g")),V.lastIndex=0;mt=V.exec(vt);)var xt=mt.index;Ae=Ae.slice(0,xt===t?Se:xt)}}else if(b.indexOf(Rc(V),Se)!=Se){var Xt=Ae.lastIndexOf(V);Xt>-1&&(Ae=Ae.slice(0,Xt))}return Ae+A}function U2e(b){return b=hr(b),b&&Kt.test(b)?b.replace(Dt,bIe):b}var j2e=KC(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),w8=wee("toUpperCase");function Cte(b,x,I){return b=hr(b),x=I?t:x,x===t?gIe(b)?wIe(b):oIe(b):b.match(x)||[]}var yte=gi(function(b,x){try{return Tc(b,t,x)}catch(I){return _8(I)?I:new ti(I)}}),K2e=fg(function(b,x){return xu(x,function(I){I=Wh(I),dg(b,I,m8(b[I],b))}),b});function G2e(b){var x=b==null?0:b.length,I=An();return b=x?po(b,function(A){if(typeof A[1]!="function")throw new Lu(s);return[I(A[0]),A[1]]}):[],gi(function(A){for(var V=-1;++VU)return[];var I=Y,A=Ha(b,Y);x=An(x),b-=Y;for(var V=RB(A,x);++I0||x<0)?new xi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},xi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},xi.prototype.toArray=function(){return this.take(Y)},Fh(xi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),A=/^(?:head|last)$/.test(x),V=Z[A?"take"+(x=="last"?"Right":""):x],ee=A||/^find/.test(x);V&&(Z.prototype[x]=function(){var ve=this.__wrapped__,Se=A?[1]:arguments,Ae=ve instanceof xi,mt=Se[0],vt=Ae||ii(ve),xt=function(_i){var Ni=V.apply(Z,em([_i],Se));return A&&Xt?Ni[0]:Ni};vt&&I&&typeof mt=="function"&&mt.length!=1&&(Ae=vt=!1);var Xt=this.__chain__,fn=!!this.__actions__.length,Fn=ee&&!Xt,ui=Ae&&!fn;if(!ee&&vt){ve=ui?ve:new xi(this);var Bn=b.apply(ve,Se);return Bn.__actions__.push({func:AN,args:[xt],thisArg:t}),new Eu(Bn,Xt)}return Fn&&ui?b.apply(this,Se):(Bn=this.thru(xt),Fn?A?Bn.value()[0]:Bn.value():Bn)})}),xu(["pop","push","shift","sort","splice","unshift"],function(b){var x=aN[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",A=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(A&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ve){return x.apply(ii(ve)?ve:[],V)})}}),Fh(xi.prototype,function(b,x){var I=Z[x];if(I){var A=I.name+"";_r.call(zC,A)||(zC[A]=[]),zC[A].push({name:x,func:I})}}),zC[IN(t,v).name]=[{name:"wrapper",func:t}],xi.prototype.clone=UIe,xi.prototype.reverse=jIe,xi.prototype.value=KIe,Z.prototype.at=yNe,Z.prototype.chain=wNe,Z.prototype.commit=SNe,Z.prototype.next=xNe,Z.prototype.plant=ENe,Z.prototype.reverse=DNe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=INe,Z.prototype.first=Z.prototype.head,vx&&(Z.prototype[vx]=LNe),Z},$C=SIe();U_?((U_.exports=$C)._=$C,xB._=$C):oa._=$C}).call(Nx)})(ZQe,Ka);var ar=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i))(ar||{});const QQe={instructions:[],text:[],memory:new Uint8Array},fse={total:0,stack:0,globalVariable:0},gse={labelTable:{},functionTable:{},globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},pse={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var nc=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(nc||{});const Hd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:16*1024*1024},stackSize:{min:512,max:16*1024*1024-1024}},mse={maxExecutionStepCount:1e6,memorySize:16*1024,stackSize:8*1024};class hCe{constructor(){Ls(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:mse.memorySize,eip:0});Ls(this,"decoder",new YQe);Ls(this,"memory",Ka.cloneDeep(QQe));Ls(this,"registers",Ka.cloneDeep(this.initialRegisters));Ls(this,"tables",Ka.cloneDeep(gse));Ls(this,"executionStatus",Ka.cloneDeep(pse));Ls(this,"peakMemoryUsage",Ka.cloneDeep(fse));Ls(this,"options",Ka.cloneDeep(mse));Ls(this,"executionStartTime",new Date);Ls(this,"writeBuffer",[]);Ls(this,"readConsole",e=>Promise.resolve(""));Ls(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,Hd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,Hd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:Hd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=tc(e.memorySize),this.registers.esp=tc(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,Hd.stackSize),e.stackSize=t(e.stackSize,{min:Hd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=Ka.cloneDeep(this.initialRegisters),this.tables=Ka.cloneDeep(gse),this.executionStatus=Ka.cloneDeep(pse),this.peakMemoryUsage=Ka.cloneDeep(fse),this.writeBuffer=[]}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){for(let t=0;tn;case m0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case ja.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Bc(this.registers.ecx,4);break}case ja.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case ja.ASSIGN_CALL:case ja.CALL:{const n=t.type===ja.CALL?t.value.id:t.value.functionId;if(!(n in this.tables.functionTable)){this.writeRuntimeError({key:"FUNCTION_NOT_FOUND",values:{id:n}});return}if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===ja.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=this.tables.functionTable[n].addressBefore;break}case ja.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case ja.GOTO:{const n=t.value.id;if(!(n in this.tables.labelTable)){this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:n}});return}this.registers.eip=this.tables.labelTable[n].addressBefore;break}case ja.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;const r=t.value.gotoId;if(!(r in this.tables.labelTable)){this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:r}});return}n&&(this.registers.eip=this.tables.labelTable[r].addressBefore);break}case ja.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4},this.registers.ebx=Bc(this.registers.ebx,4);break}case ja.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Bc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case ja.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===WL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(tc(a),r))return;break}case ja.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Bc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===ja.GLOBAL_DEC;)this.registers.eip=Bc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function JQe(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function eJe(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function fCe(i){return i.split(/\r\n|[\r\n]/)}function tJe(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function i9(i){return i/1024}function nJe(i,e){return i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},rJe={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally(Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally(Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",B_USAGE:"{used}B/{total}B",KB_USAGE:"{used, number, ::.0}KB/{total, number, ::.0}KB",BYTES:"{bytes}B",KB:"{kb, number, ::.0}KB",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error(Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function main is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error(Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable {id}",FUNCTION_NOT_FOUND:"Can't find function {id}",LABEL_NOT_FOUND:"Can't find label {id}",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id already declared",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id already declared",DUPLICATE_PARAM_ID:"PARAM's param id already declared",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},RM=[{name:"简体中文",locale:iJe},{name:"English",locale:rJe}],oJe={currentLocale:RM[0].locale},gCe=zX({name:"locale",initialState:oJe,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:sJe}=gCe.actions,aJe=gCe.reducer,YH=[{name:"Light",className:"themeLight"}],lJe={currentClassName:YH[0].className},pCe=zX({name:"theme",initialState:lJe,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:cJe}=pCe.actions,uJe=pCe.reducer,mCe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},vCe=(i,e,t,n)=>{const r=new hCe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(fCe(t)),vC.add(r),i(cCe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablePageIndex:1}))},_Ce=(i,e,t)=>{if(!t.name.endsWith(".ir")){mA.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){mA.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}vCe(i,t.name,r.target.result)}},vse="demos.json",dJe=({vmIndex:i})=>{const e=xc(),t=MS(),n=Yr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Yr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Yr(h=>eJe(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(vse).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{mA.error(e.formatMessage({id:"FETCH_FAILED"},{url:vse}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:ze(u8e,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:ze(DM,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:m=>ze(DM.Item,{onClick:()=>{fetch(m.irUrl).then(v=>v.ok?v.text():Promise.reject()).catch(()=>{mA.error(e.formatMessage({id:"FETCH_FAILED"},{url:m.irUrl}))}).then(v=>{v&&(vCe(t,m.irUrl.split("/").at(-1),v,m.vmOptions),c(!1))})},children:ze(DM.Item.Meta,{avatar:ze(uUe,{icon:ze(xie,{})}),title:m.name,description:m.remark})})})}]})))})},[l]),Nn("aside",{className:ZC.asideSideBarWrapper,children:[Nn("div",{className:ZC.divIconWrapperUpper,children:[ze(t0,{icon:ze(yBe,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new hCe;vC.add(h),t(cCe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablePageIndex:1}))}}),ze(t0,{icon:ze(xie,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),ze(t0,{icon:ze(Ame,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),ze("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)_Ce(t,e,f);document.getElementById("inImportIr").value=""}}}),ze(t0,{icon:ze(o8e,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(mCe(n,r),t(uCe(!1)))}})]}),Nn("div",{className:ZC.divIconWrapperLower,children:[ze(GD,{menu:{items:RM.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(sJe(RM[parseInt(h.key)].locale)),document.title=RM[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:ze(DH,{children:ze(t0,{icon:ze(m8e,{}),label:"Lang"})})}),ze(GD,{menu:{items:YH.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(cJe(YH[parseInt(h.key)].className))}},placement:"topLeft",children:ze(DH,{children:ze(t0,{icon:ze(kme,{}),label:e.formatMessage({id:"THEME"})})})}),ze(t0,{icon:ze(Vme,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),ze(MH,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[ze(ed,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:Nn("article",{className:ZC.articleAbout,children:[ze("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),Nn("p",{children:[ze("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),ze("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),Nn("p",{children:[ze("div",{children:"April 🌼 2023"}),ze("div",{children:"V3.0 March 🌸 2024"})]}),Nn("p",{children:[ze("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),ze("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),ze("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),Nn("p",{className:"info",children:[ze("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",ze("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"})]}),Nn("p",{className:"info",children:[ze("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",ze("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",ze("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),ze(MH,{open:l,title:Nn("span",{children:[e.formatMessage({id:"DEMOS"}),Nn("a",{className:ZC.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:ze(vX,{className:ZC.menuDemos,mode:"inline",selectable:!1,items:u})})]})},hJe="_navTabBarWrapper_nfao3_1",fJe={navTabBarWrapper:hJe},gJe="_divTabBarItemWrapperBase_11raq_1",pJe="_divTabBarItemWrapperActive_11raq_1",mJe="_divTabBarItemWrapperInactive_11raq_1",vJe="_divIconTitleWrapper_11raq_23",_Je="_divCloseWrapper_11raq_28",bJe="_divCloseWrapperChanged_11raq_28",CJe="_iconVm_11raq_53",yJe="_iconClose_11raq_60",wJe="_lblTitle_11raq_65",SJe="_iconDot_11raq_71",xJe="_inVmRename_11raq_78",Hh={divTabBarItemWrapperBase:gJe,divTabBarItemWrapperActive:pJe,divTabBarItemWrapperInactive:mJe,divIconTitleWrapper:vJe,divCloseWrapper:_Je,divCloseWrapperChanged:bJe,iconVm:CJe,iconClose:yJe,lblTitle:wJe,iconDot:SJe,inVmRename:xJe},LJe=i=>Nn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[Nn("g",{children:[ze("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),ze("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r +}`;var ui=yte(function(){return sr(ee,fn+"return "+xt).apply(t,ve)});if(ui.source=xt,_8(ui))throw ui;return ui}function B2e(b){return hr(b).toLowerCase()}function W2e(b){return hr(b).toUpperCase()}function $2e(b,x,I){if(b=hr(b),b&&(I||x===t))return TJ(b);if(!b||!(x=Rc(x)))return b;var A=_d(b),V=_d(x),ee=NJ(A,V),ve=RJ(A,V)+1;return sm(A,ee,ve).join("")}function H2e(b,x,I){if(b=hr(b),b&&(I||x===t))return b.slice(0,PJ(b)+1);if(!b||!(x=Rc(x)))return b;var A=_d(b),V=RJ(A,_d(x))+1;return sm(A,0,V).join("")}function V2e(b,x,I){if(b=hr(b),b&&(I||x===t))return b.replace(Si,"");if(!b||!(x=Rc(x)))return b;var A=_d(b),V=NJ(A,_d(x));return sm(A,V).join("")}function z2e(b,x){var I=M,A=P;if(xo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,A="omission"in x?Rc(x.omission):A}b=hr(b);var ee=b.length;if(BC(b)){var ve=_d(b);ee=ve.length}if(I>=ee)return b;var Se=I-WC(A);if(Se<1)return A;var Ae=ve?sm(ve,0,Se).join(""):b.slice(0,Se);if(V===t)return Ae+A;if(ve&&(Se+=Ae.length-Se),b8(V)){if(b.slice(Se).search(V)){var mt,vt=Ae;for(V.global||(V=AB(V.source,hr(Ut.exec(V))+"g")),V.lastIndex=0;mt=V.exec(vt);)var xt=mt.index;Ae=Ae.slice(0,xt===t?Se:xt)}}else if(b.indexOf(Rc(V),Se)!=Se){var Xt=Ae.lastIndexOf(V);Xt>-1&&(Ae=Ae.slice(0,Xt))}return Ae+A}function U2e(b){return b=hr(b),b&&Kt.test(b)?b.replace(Dt,bIe):b}var j2e=KC(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),w8=wee("toUpperCase");function Cte(b,x,I){return b=hr(b),x=I?t:x,x===t?gIe(b)?wIe(b):oIe(b):b.match(x)||[]}var yte=gi(function(b,x){try{return Tc(b,t,x)}catch(I){return _8(I)?I:new ti(I)}}),K2e=fg(function(b,x){return xu(x,function(I){I=Wh(I),dg(b,I,m8(b[I],b))}),b});function G2e(b){var x=b==null?0:b.length,I=An();return b=x?po(b,function(A){if(typeof A[1]!="function")throw new Lu(s);return[I(A[0]),A[1]]}):[],gi(function(A){for(var V=-1;++VU)return[];var I=Y,A=Ha(b,Y);x=An(x),b-=Y;for(var V=RB(A,x);++I0||x<0)?new xi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},xi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},xi.prototype.toArray=function(){return this.take(Y)},Fh(xi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),A=/^(?:head|last)$/.test(x),V=Z[A?"take"+(x=="last"?"Right":""):x],ee=A||/^find/.test(x);V&&(Z.prototype[x]=function(){var ve=this.__wrapped__,Se=A?[1]:arguments,Ae=ve instanceof xi,mt=Se[0],vt=Ae||ii(ve),xt=function(_i){var Ni=V.apply(Z,em([_i],Se));return A&&Xt?Ni[0]:Ni};vt&&I&&typeof mt=="function"&&mt.length!=1&&(Ae=vt=!1);var Xt=this.__chain__,fn=!!this.__actions__.length,Fn=ee&&!Xt,ui=Ae&&!fn;if(!ee&&vt){ve=ui?ve:new xi(this);var Bn=b.apply(ve,Se);return Bn.__actions__.push({func:AN,args:[xt],thisArg:t}),new Eu(Bn,Xt)}return Fn&&ui?b.apply(this,Se):(Bn=this.thru(xt),Fn?A?Bn.value()[0]:Bn.value():Bn)})}),xu(["pop","push","shift","sort","splice","unshift"],function(b){var x=aN[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",A=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(A&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ve){return x.apply(ii(ve)?ve:[],V)})}}),Fh(xi.prototype,function(b,x){var I=Z[x];if(I){var A=I.name+"";_r.call(zC,A)||(zC[A]=[]),zC[A].push({name:x,func:I})}}),zC[IN(t,v).name]=[{name:"wrapper",func:t}],xi.prototype.clone=UIe,xi.prototype.reverse=jIe,xi.prototype.value=KIe,Z.prototype.at=yNe,Z.prototype.chain=wNe,Z.prototype.commit=SNe,Z.prototype.next=xNe,Z.prototype.plant=ENe,Z.prototype.reverse=DNe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=INe,Z.prototype.first=Z.prototype.head,vx&&(Z.prototype[vx]=LNe),Z},$C=SIe();j_?((j_.exports=$C)._=$C,xB._=$C):oa._=$C}).call(Nx)})(ZQe,Ka);var Zi=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i[i.CLOSED=9]="CLOSED",i))(Zi||{});const QQe={instructions:[],text:[],memory:new Uint8Array},fse={total:0,stack:0,globalVariable:0},gse={labelTable:{},functionTable:{},globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},pse={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var nc=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(nc||{});const Hd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:16*1024*1024},stackSize:{min:512,max:16*1024*1024-1024}},mse={maxExecutionStepCount:1e6,memorySize:16*1024,stackSize:8*1024};class hCe{constructor(){Ls(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:mse.memorySize,eip:0});Ls(this,"decoder",new YQe);Ls(this,"memory",Ka.cloneDeep(QQe));Ls(this,"registers",Ka.cloneDeep(this.initialRegisters));Ls(this,"tables",Ka.cloneDeep(gse));Ls(this,"executionStatus",Ka.cloneDeep(pse));Ls(this,"peakMemoryUsage",Ka.cloneDeep(fse));Ls(this,"options",Ka.cloneDeep(mse));Ls(this,"executionStartTime",new Date);Ls(this,"writeBuffer",[]);Ls(this,"readConsole",e=>Promise.resolve(""));Ls(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,Hd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,Hd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:Hd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=tc(e.memorySize),this.registers.esp=tc(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,Hd.stackSize),e.stackSize=t(e.stackSize,{min:Hd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=Ka.cloneDeep(this.initialRegisters),this.tables=Ka.cloneDeep(gse),this.executionStatus=Ka.cloneDeep(pse),this.peakMemoryUsage=Ka.cloneDeep(fse),this.writeBuffer=[]}close(){this.executionStatus.state=9}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){for(let t=0;tn;case v0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case ja.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Bc(this.registers.ecx,4);break}case ja.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case ja.ASSIGN_CALL:case ja.CALL:{const n=t.type===ja.CALL?t.value.id:t.value.functionId;if(!(n in this.tables.functionTable)){this.writeRuntimeError({key:"FUNCTION_NOT_FOUND",values:{id:n}});return}if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===ja.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=this.tables.functionTable[n].addressBefore;break}case ja.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case ja.GOTO:{const n=t.value.id;if(!(n in this.tables.labelTable)){this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:n}});return}this.registers.eip=this.tables.labelTable[n].addressBefore;break}case ja.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;const r=t.value.gotoId;if(!(r in this.tables.labelTable)){this.writeRuntimeError({key:"LABEL_NOT_FOUND",values:{id:r}});return}n&&(this.registers.eip=this.tables.labelTable[r].addressBefore);break}case ja.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4},this.registers.ebx=Bc(this.registers.ebx,4);break}case ja.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Bc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case ja.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===WL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(tc(a),r))return;break}case ja.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Bc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===ja.GLOBAL_DEC;)this.registers.eip=Bc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function JQe(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function eJe(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function fCe(i){return i.split(/\r\n|[\r\n]/)}function tJe(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function i9(i){return i/1024}function nJe(i,e){return i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},rJe={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally(Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally(Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",B_USAGE:"{used}B/{total}B",KB_USAGE:"{used, number, ::.0}KB/{total, number, ::.0}KB",BYTES:"{bytes}B",KB:"{kb, number, ::.0}KB",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error(Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function main is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error(Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable {id}",FUNCTION_NOT_FOUND:"Can't find function {id}",LABEL_NOT_FOUND:"Can't find label {id}",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id already declared",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id already declared",DUPLICATE_PARAM_ID:"PARAM's param id already declared",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},RM=[{name:"简体中文",locale:iJe},{name:"English",locale:rJe}],oJe={currentLocale:RM[0].locale},gCe=zX({name:"locale",initialState:oJe,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:sJe}=gCe.actions,aJe=gCe.reducer,YH=[{name:"Light",className:"themeLight"}],lJe={currentClassName:YH[0].className},pCe=zX({name:"theme",initialState:lJe,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:cJe}=pCe.actions,uJe=pCe.reducer,mCe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},vCe=(i,e,t,n)=>{const r=new hCe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(fCe(t)),jv.add(r),i(cCe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablePageIndex:1}))},_Ce=(i,e,t)=>{if(!t.name.endsWith(".ir")){mA.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){mA.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}vCe(i,t.name,r.target.result)}},vse="demos.json",dJe=({vmIndex:i})=>{const e=xc(),t=MS(),n=Yr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Yr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Yr(h=>eJe(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(vse).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{mA.error(e.formatMessage({id:"FETCH_FAILED"},{url:vse}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:ze(u8e,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:ze(DM,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:m=>ze(DM.Item,{onClick:()=>{fetch(m.irUrl).then(v=>v.ok?v.text():Promise.reject()).catch(()=>{mA.error(e.formatMessage({id:"FETCH_FAILED"},{url:m.irUrl}))}).then(v=>{v&&(vCe(t,m.irUrl.split("/").at(-1),v,m.vmOptions),c(!1))})},children:ze(DM.Item.Meta,{avatar:ze(uUe,{icon:ze(xie,{})}),title:m.name,description:m.remark})})})}]})))})},[l]),Nn("aside",{className:ZC.asideSideBarWrapper,children:[Nn("div",{className:ZC.divIconWrapperUpper,children:[ze(n0,{icon:ze(yBe,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new hCe;jv.add(h),t(cCe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablePageIndex:1}))}}),ze(n0,{icon:ze(xie,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),ze(n0,{icon:ze(Ame,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),ze("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)_Ce(t,e,f);document.getElementById("inImportIr").value=""}}}),ze(n0,{icon:ze(o8e,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(mCe(n,r),t(uCe(!1)))}})]}),Nn("div",{className:ZC.divIconWrapperLower,children:[ze(GD,{menu:{items:RM.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(sJe(RM[parseInt(h.key)].locale)),document.title=RM[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:ze(DH,{children:ze(n0,{icon:ze(m8e,{}),label:"Lang"})})}),ze(GD,{menu:{items:YH.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(cJe(YH[parseInt(h.key)].className))}},placement:"topLeft",children:ze(DH,{children:ze(n0,{icon:ze(kme,{}),label:e.formatMessage({id:"THEME"})})})}),ze(n0,{icon:ze(Vme,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),ze(MH,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[ze(ed,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:Nn("article",{className:ZC.articleAbout,children:[ze("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),Nn("p",{children:[ze("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),ze("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),Nn("p",{children:[ze("div",{children:"April 🌼 2023"}),ze("div",{children:"V3.0 March 🌸 2024"})]}),Nn("p",{children:[ze("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),ze("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),ze("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),Nn("p",{className:"info",children:[ze("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",ze("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"})]}),Nn("p",{className:"info",children:[ze("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",ze("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",ze("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),ze(MH,{open:l,title:Nn("span",{children:[e.formatMessage({id:"DEMOS"}),Nn("a",{className:ZC.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:ze(vX,{className:ZC.menuDemos,mode:"inline",selectable:!1,items:u})})]})},hJe="_navTabBarWrapper_nfao3_1",fJe={navTabBarWrapper:hJe},gJe="_divTabBarItemWrapperBase_11raq_1",pJe="_divTabBarItemWrapperActive_11raq_1",mJe="_divTabBarItemWrapperInactive_11raq_1",vJe="_divIconTitleWrapper_11raq_23",_Je="_divCloseWrapper_11raq_28",bJe="_divCloseWrapperChanged_11raq_28",CJe="_iconVm_11raq_53",yJe="_iconClose_11raq_60",wJe="_lblTitle_11raq_65",SJe="_iconDot_11raq_71",xJe="_inVmRename_11raq_78",Hh={divTabBarItemWrapperBase:gJe,divTabBarItemWrapperActive:pJe,divTabBarItemWrapperInactive:mJe,divIconTitleWrapper:vJe,divCloseWrapper:_Je,divCloseWrapperChanged:bJe,iconVm:CJe,iconClose:yJe,lblTitle:wJe,iconDot:SJe,inVmRename:xJe},LJe=i=>Nn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[Nn("g",{children:[ze("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),ze("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r M34.06,26.2l0.3-2.13h0.08l3.89-10.17h1.73v2.23h-0.73L35.44,26.2H34.06z M39.56,36.09V13.91h1.94v22.19H39.56z`})]}),ze("g",{children:ze("path",{fill:"none",strokeWidth:"2",strokeMiterlimit:"10",d:`M1.5,36.5c0,3.87,3.13,7,7,7h33c3.87,0,7-3.13,7-7\r - v-22c0-3.87-3.13-7-7-7h-33c-3.87,0-7,3.13-7,7V36.5z`})}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{})]}),EJe=i=>Nn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[ze("circle",{cx:"25",cy:"25",r:"25"}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{})]}),DJe=i=>{const e=xc(),[t,n]=C.useState(!1),[r,o]=C.useState(i.title);return C.useEffect(()=>{if(t){const s=document.getElementById("inVmRename");s!==null&&(s.focus(),s.select())}},[t]),Nn("div",{className:De({[Hh.divTabBarItemWrapperActive]:i.isActive,[Hh.divTabBarItemWrapperInactive]:!i.isActive}),onClick:s=>{s.stopPropagation(),i.onClick()},title:i.title,onDoubleClick:()=>{o(i.title),n(!0)},children:[Nn("div",{className:Hh.divIconTitleWrapper,children:[ze(LJe,{className:Hh.iconVm}),t?ze("input",{id:"inVmRename",className:Hh.inVmRename,value:r,onChange:s=>o(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&(i.onRename(r),n(!1))},onBlur:()=>{i.onRename(r),n(!1)}}):ze("label",{className:Hh.lblTitle,children:JQe(i.title)})]}),Nn("div",{className:De({[Hh.divCloseWrapperChanged]:i.isChanged,[Hh.divCloseWrapper]:!i.isChanged}),title:e.formatMessage({id:"CLOSE"}),onClick:s=>{s.stopPropagation(),i.onCloseClick()},children:[i.isChanged&&ze(EJe,{className:Hh.iconDot}),ze(Vk,{className:Hh.iconClose})]})]})},IJe=()=>{var l;const i=xc(),e=Yr(c=>c.vm),t=MS(),[n,r]=C.useState(!1),[o,s]=C.useState(0),a=c=>{t(VQe(c)),vC.delete(c)};return Nn("nav",{className:fJe.navTabBarWrapper,children:[e.vmPageStates.map((c,u)=>ze(DJe,{title:c.name,isActive:u===e.activeVmIndex,isChanged:c.isIrChanged,onClick:()=>t($Qe(u)),onCloseClick:()=>{if(!c.isIrChanged){a(u);return}s(u),r(!0)},onRename:d=>{d!==""&&t(HQe({index:u,newName:d}))}},c.id)),ze(MH,{open:n,title:i.formatMessage({id:"CONFIRM_UNSAVED_CLOSE"},{name:(l=e.vmPageStates[o])==null?void 0:l.name}),onCancel:()=>r(!1),footer:[ze(ed,{onClick:()=>r(!1),children:i.formatMessage({id:"CANCEL"})}),ze(ed,{danger:!0,onClick:()=>{a(o),r(!1)},children:i.formatMessage({id:"UNSAVE_CLOSE"})}),ze(ed,{type:"primary",onClick:()=>{mCe(e.vmPageStates[e.activeVmIndex].name,e.vmPageStates[e.activeVmIndex].irString),a(o),r(!1)},children:i.formatMessage({id:"SAVE_CLOSE"})})]})]})},kJe="_divEmptyHolder_3r6f3_11",TJe="_imgLogo_3r6f3_25",NJe="_divEmptyHolderText_3r6f3_30",RJe="_spanDesc_3r6f3_39",MJe="_divEmptyHolderHintsWrapper_3r6f3_45",Yx={divEmptyHolder:kJe,"empty-holder-in":"_empty-holder-in_3r6f3_1",imgLogo:TJe,divEmptyHolderText:NJe,spanDesc:RJe,divEmptyHolderHintsWrapper:MJe};function PJe(){const i=navigator.userAgent.toLowerCase();return i.includes("android")||i.includes("harmony")||i.includes("iphone")||i.includes("ipad")||i.includes("mobile")}const AJe=()=>{const i=xc();return Nn("div",{className:Yx.divEmptyHolder,children:[ze("img",{className:Yx.imgLogo,src:"logo.svg"}),Nn("div",{className:Yx.divEmptyHolderText,children:[ze("span",{className:Yx.spanDesc,children:i.formatMessage({id:"EMPTY_PLACEHOLDER_DESC"})}),Nn("div",{className:Yx.divEmptyHolderHintsWrapper,children:[ze("span",{className:"hint-title",children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_TITLE"})}),ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_1"})}),ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_2"})}),!PJe()&&ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_3"})})]})]})]})};const OJe="_divMonacoEditorWrapper_1a3zn_1",FJe={divMonacoEditorWrapper:OJe};function BJe(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function _se(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function bse(i){for(var e=1;e=0)&&(t[r]=i[r]);return t}function $Je(i,e){if(i==null)return{};var t=WJe(i,e),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function HJe(i,e){return VJe(i)||zJe(i,e)||UJe(i,e)||jJe()}function VJe(i){if(Array.isArray(i))return i}function zJe(i,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(i)))){var t=[],n=!0,r=!1,o=void 0;try{for(var s=i[Symbol.iterator](),a;!(n=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){r=!0,o=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(r)throw o}}return t}}function UJe(i,e){if(i){if(typeof i=="string")return Cse(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cse(i,e)}}function Cse(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);tNn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[ze("circle",{cx:"25",cy:"25",r:"25"}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{}),ze("g",{})]}),DJe=i=>{const e=xc(),[t,n]=C.useState(!1),[r,o]=C.useState(i.title);return C.useEffect(()=>{if(t){const s=document.getElementById("inVmRename");s!==null&&(s.focus(),s.select())}},[t]),Nn("div",{className:De({[Hh.divTabBarItemWrapperActive]:i.isActive,[Hh.divTabBarItemWrapperInactive]:!i.isActive}),onClick:s=>{s.stopPropagation(),i.onClick()},title:i.title,onDoubleClick:()=>{o(i.title),n(!0)},children:[Nn("div",{className:Hh.divIconTitleWrapper,children:[ze(LJe,{className:Hh.iconVm}),t?ze("input",{id:"inVmRename",className:Hh.inVmRename,value:r,onChange:s=>o(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&(i.onRename(r),n(!1))},onBlur:()=>{i.onRename(r),n(!1)}}):ze("label",{className:Hh.lblTitle,children:JQe(i.title)})]}),Nn("div",{className:De({[Hh.divCloseWrapperChanged]:i.isChanged,[Hh.divCloseWrapper]:!i.isChanged}),title:e.formatMessage({id:"CLOSE"}),onClick:s=>{s.stopPropagation(),i.onCloseClick()},children:[i.isChanged&&ze(EJe,{className:Hh.iconDot}),ze(Vk,{className:Hh.iconClose})]})]})},IJe=()=>{var l;const i=xc(),e=Yr(c=>c.vm),t=MS(),[n,r]=C.useState(!1),[o,s]=C.useState(0),a=c=>{t(VQe(c)),jv.at(c).close(),jv.delete(c)};return Nn("nav",{className:fJe.navTabBarWrapper,children:[e.vmPageStates.map((c,u)=>ze(DJe,{title:c.name,isActive:u===e.activeVmIndex,isChanged:c.isIrChanged,onClick:()=>t($Qe(u)),onCloseClick:()=>{if(!c.isIrChanged){a(u);return}s(u),r(!0)},onRename:d=>{d!==""&&t(HQe({index:u,newName:d}))}},c.id)),ze(MH,{open:n,title:i.formatMessage({id:"CONFIRM_UNSAVED_CLOSE"},{name:(l=e.vmPageStates[o])==null?void 0:l.name}),onCancel:()=>r(!1),footer:[ze(ed,{onClick:()=>r(!1),children:i.formatMessage({id:"CANCEL"})}),ze(ed,{danger:!0,onClick:()=>{a(o),r(!1)},children:i.formatMessage({id:"UNSAVE_CLOSE"})}),ze(ed,{type:"primary",onClick:()=>{mCe(e.vmPageStates[e.activeVmIndex].name,e.vmPageStates[e.activeVmIndex].irString),a(o),r(!1)},children:i.formatMessage({id:"SAVE_CLOSE"})})]})]})},kJe="_divEmptyHolder_3r6f3_11",TJe="_imgLogo_3r6f3_25",NJe="_divEmptyHolderText_3r6f3_30",RJe="_spanDesc_3r6f3_39",MJe="_divEmptyHolderHintsWrapper_3r6f3_45",Yx={divEmptyHolder:kJe,"empty-holder-in":"_empty-holder-in_3r6f3_1",imgLogo:TJe,divEmptyHolderText:NJe,spanDesc:RJe,divEmptyHolderHintsWrapper:MJe};function PJe(){const i=navigator.userAgent.toLowerCase();return i.includes("android")||i.includes("harmony")||i.includes("iphone")||i.includes("ipad")||i.includes("mobile")}const AJe=()=>{const i=xc();return Nn("div",{className:Yx.divEmptyHolder,children:[ze("img",{className:Yx.imgLogo,src:"logo.svg"}),Nn("div",{className:Yx.divEmptyHolderText,children:[ze("span",{className:Yx.spanDesc,children:i.formatMessage({id:"EMPTY_PLACEHOLDER_DESC"})}),Nn("div",{className:Yx.divEmptyHolderHintsWrapper,children:[ze("span",{className:"hint-title",children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_TITLE"})}),ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_1"})}),ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_2"})}),!PJe()&&ze("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_3"})})]})]})]})};const OJe="_divMonacoEditorWrapper_1a3zn_1",FJe={divMonacoEditorWrapper:OJe};function BJe(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function _se(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function bse(i){for(var e=1;e=0)&&(t[r]=i[r]);return t}function $Je(i,e){if(i==null)return{};var t=WJe(i,e),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function HJe(i,e){return VJe(i)||zJe(i,e)||UJe(i,e)||jJe()}function VJe(i){if(Array.isArray(i))return i}function zJe(i,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(i)))){var t=[],n=!0,r=!1,o=void 0;try{for(var s=i[Symbol.iterator](),a;!(n=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){r=!0,o=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(r)throw o}}return t}}function UJe(i,e){if(i){if(typeof i=="string")return Cse(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cse(i,e)}}function Cse(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};TR.initial(i),TR.handler(e);var t={current:i},n=$L(oet)(t,e),r=$L(ret)(t),o=$L(TR.changes)(i),s=$L(iet)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return TR.selector(c),c(t.current)}function l(c){GJe(n,r,o,s)(c)}return[a,l]}function iet(i,e){return QD(e)?e(i.current):e}function ret(i,e){return i.current=wse(wse({},i.current),e),e}function oet(i,e,t){return QD(e)?e(i.current):Object.keys(t).forEach(function(n){var r;return(r=e[n])===null||r===void 0?void 0:r.call(e,i.current[n])}),t}var set={create:net},aet={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function cet(i){return function e(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l{n.current=!1}:i,e)}var Uc=Aet;function ME(){}function ly(i,e,t,n){return Oet(i,n)||Fet(i,e,t,n)}function Oet(i,e){return i.editor.getModel(LCe(i,e))}function Fet(i,e,t,n){return i.editor.createModel(e,t,n?LCe(i,n):void 0)}function LCe(i,e){return i.Uri.parse(e)}function Bet({original:i,modified:e,language:t,originalLanguage:n,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=ME,onMount:v=ME}){let[_,y]=C.useState(!1),[S,L]=C.useState(!0),E=C.useRef(null),D=C.useRef(null),k=C.useRef(null),T=C.useRef(v),M=C.useRef(m),P=C.useRef(!1);xCe(()=>{let B=t3.init();return B.then($=>(D.current=$)&&L(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>E.current?O():B.cancel()}),Uc(()=>{if(E.current&&D.current){let B=E.current.getOriginalEditor(),$=ly(D.current,i||"",n||t||"text",o||"");$!==B.getModel()&&B.setModel($)}},[o],_),Uc(()=>{if(E.current&&D.current){let B=E.current.getModifiedEditor(),$=ly(D.current,e||"",r||t||"text",s||"");$!==B.getModel()&&B.setModel($)}},[s],_),Uc(()=>{let B=E.current.getModifiedEditor();B.getOption(D.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],_),Uc(()=>{var B,$;($=(B=E.current)==null?void 0:B.getModel())==null||$.original.setValue(i||"")},[i],_),Uc(()=>{let{original:B,modified:$}=E.current.getModel();D.current.editor.setModelLanguage(B,n||t||"text"),D.current.editor.setModelLanguage($,r||t||"text")},[t,n,r],_),Uc(()=>{var B;(B=D.current)==null||B.editor.setTheme(c)},[c],_),Uc(()=>{var B;(B=E.current)==null||B.updateOptions(d)},[d],_);let N=C.useCallback(()=>{var G;if(!D.current)return;M.current(D.current);let B=ly(D.current,i||"",n||t||"text",o||""),$=ly(D.current,e||"",r||t||"text",s||"");(G=E.current)==null||G.setModel({original:B,modified:$})},[t,e,r,i,n,o,s]),R=C.useCallback(()=>{var B;!P.current&&k.current&&(E.current=D.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),N(),(B=D.current)==null||B.editor.setTheme(c),y(!0),P.current=!0)},[d,c,N]);C.useEffect(()=>{_&&T.current(E.current,D.current)},[_]),C.useEffect(()=>{!S&&!_&&R()},[S,_,R]);function O(){var $,G,U,j;let B=($=E.current)==null?void 0:$.getModel();a||((G=B==null?void 0:B.original)==null||G.dispose()),l||((U=B==null?void 0:B.modified)==null||U.dispose()),(j=E.current)==null||j.dispose()}return qe.createElement(SCe,{width:f,height:h,isEditorReady:_,loading:u,_ref:k,className:g,wrapperProps:p})}var Wet=Bet;C.memo(Wet);function $et(i){let e=C.useRef();return C.useEffect(()=>{e.current=i},[i]),e.current}var Het=$et,NR=new Map;function Vet({defaultValue:i,defaultLanguage:e,defaultPath:t,value:n,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:v=ME,onMount:_=ME,onChange:y,onValidate:S=ME}){let[L,E]=C.useState(!1),[D,k]=C.useState(!0),T=C.useRef(null),M=C.useRef(null),P=C.useRef(null),N=C.useRef(_),R=C.useRef(v),O=C.useRef(),B=C.useRef(n),$=Het(o),G=C.useRef(!1),U=C.useRef(!1);xCe(()=>{let Y=t3.init();return Y.then(J=>(T.current=J)&&k(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>M.current?ie():Y.cancel()}),Uc(()=>{var J,Q,he,ge;let Y=ly(T.current,i||n||"",e||r||"",o||t||"");Y!==((J=M.current)==null?void 0:J.getModel())&&(d&&NR.set($,(Q=M.current)==null?void 0:Q.saveViewState()),(he=M.current)==null||he.setModel(Y),d&&((ge=M.current)==null||ge.restoreViewState(NR.get(o))))},[o],L),Uc(()=>{var Y;(Y=M.current)==null||Y.updateOptions(c)},[c],L),Uc(()=>{!M.current||n===void 0||(M.current.getOption(T.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(U.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),U.current=!1))},[n],L),Uc(()=>{var J,Q;let Y=(J=M.current)==null?void 0:J.getModel();Y&&r&&((Q=T.current)==null||Q.editor.setModelLanguage(Y,r))},[r],L),Uc(()=>{var Y;a!==void 0&&((Y=M.current)==null||Y.revealLine(a))},[a],L),Uc(()=>{var Y;(Y=T.current)==null||Y.editor.setTheme(s)},[s],L);let j=C.useCallback(()=>{var Y;if(!(!P.current||!T.current)&&!G.current){R.current(T.current);let J=o||t,Q=ly(T.current,n||i||"",e||r||"",J||"");M.current=(Y=T.current)==null?void 0:Y.editor.create(P.current,{model:Q,automaticLayout:!0,...c},u),d&&M.current.restoreViewState(NR.get(J)),T.current.editor.setTheme(s),a!==void 0&&M.current.revealLine(a),E(!0),G.current=!0}},[i,e,t,n,r,o,c,u,d,s,a]);C.useEffect(()=>{L&&N.current(M.current,T.current)},[L]),C.useEffect(()=>{!D&&!L&&j()},[D,L,j]),B.current=n,C.useEffect(()=>{var Y,J;L&&y&&((Y=O.current)==null||Y.dispose(),O.current=(J=M.current)==null?void 0:J.onDidChangeModelContent(Q=>{U.current||y(M.current.getValue(),Q)}))},[L,y]),C.useEffect(()=>{if(L){let Y=T.current.editor.onDidChangeMarkers(J=>{var he;let Q=(he=M.current.getModel())==null?void 0:he.uri;if(Q&&J.find(ge=>ge.path===Q.path)){let ge=T.current.editor.getModelMarkers({resource:Q});S==null||S(ge)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[L,S]);function ie(){var Y,J;(Y=O.current)==null||Y.dispose(),h?d&&NR.set(o,M.current.saveViewState()):(J=M.current.getModel())==null||J.dispose(),M.current.dispose()}return qe.createElement(SCe,{width:f,height:g,isEditorReady:L,loading:l,_ref:P,className:p,wrapperProps:m})}var zet=Vet,Uet=C.memo(zet);let xse=!1;const Zx="ir";function jet(i){if(xse)return;i.languages.register({id:Zx}),i.editor.defineTheme("ir-theme",{base:"vs",inherit:!0,rules:[{token:"function",foreground:"#74531f"},{token:"number.size",foreground:"#0097ff"}],colors:{}});const e="[a-zA-Z_]\\w*",t="[ \\t\\r\\n]+";i.languages.setMonarchTokensProvider(Zx,{keywords:NM,identifier:e,whitespace:t,defaultToken:"source",tokenizer:{root:[[/#-?\d+/,"number"],[/\d+/,"number.size"],[/(:=)|(\+)|(-)|(\*)|(\/)|(==)|(!=)|(<=)|(<)|(>=)|(>)|(&)/,"operators"],[/:/,"delimiter"],[/;.*/,"comment"],[/@whitespace/,"white"],[/(FUNCTION)(@whitespace)(@identifier)/,["keyword","white","function"]],[/(CALL)(@whitespace)(@identifier)/,["keyword","white","function"]],[/@identifier/,{cases:{"@keywords":"keyword","@default":"identifier"}}]]}});const n=["FUNCTION ${1:id} :\n","DEC ${1:id} ${2:size}","GLOBAL_DEC ${1:id} ${2:size}","LABEL ${1:id} :\n","GOTO ${1:label}","IF ${1:condition} GOTO ${2:label}","ARG ${1:value}","PARAM ${1:id}","CALL ${1:id}","RETURN ${1:value}","READ ${1:id}","WRITE ${1:value}"];i.languages.registerCompletionItemProvider(Zx,{provideCompletionItems:(r,o)=>{const s=r.getWordUntilPosition(o),a={startLineNumber:o.lineNumber,endLineNumber:o.lineNumber,startColumn:s.startColumn,endColumn:s.endColumn};return{suggestions:[...NM.map(l=>({label:l,kind:i.languages.CompletionItemKind.Keyword,insertText:l,range:a})),...NM.map((l,c)=>({label:`${l} Snippet`,kind:i.languages.CompletionItemKind.Snippet,insertText:n[c],insertTextRules:i.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}))]}}}),i.languages.registerFoldingRangeProvider(Zx,{provideFoldingRanges:r=>{const o=r.getLinesContent(),s=[];let a=-1,l=-1,c=-1;for(let u=0;u{const e=xc(),t=Yr(m=>m.vm.vmPageStates[i].staticErrors),n=Yr(m=>m.vm.vmPageStates[i].runtimeErrors),r=Yr(m=>m.vm.vmPageStates[i].currentLineNumber),o=Yr(m=>m.vm.vmPageStates[i].shouldIndicateCurrentLineNumber),s=Yr(m=>m.vm.vmPageStates[i].irString),a=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=MS(),f=vC.at(i),g=()=>{a.current!==null&&l.current!==null&&l.current.getModel()!==null&&a.current.editor.setModelMarkers(l.current.getModel(),"IR Decoder",t.map(m=>({startLineNumber:m.startLineNumber,endLineNumber:m.endLineNumber,startColumn:m.startColumn,endColumn:m.endColumn+1,message:e.formatMessage({id:m.message.key},m.message.values),severity:a.current.MarkerSeverity.Error})))};C.useEffect(g,[t,e.messages]),C.useEffect(()=>{c.current!==null&&c.current.clear(),a.current!==null&&l.current!==null&&l.current.getModel()!==null&&(n.length>0&&l.current.revealLineInCenterIfOutsideViewport(r),c.current=l.current.createDecorationsCollection(n.map(m=>({range:new a.current.Range(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn),options:{isWholeLine:!0,className:"rangeError",marginClassName:"rangeError",hoverMessage:{value:e.formatMessage({id:m.message.key},m.message.values)}}}))))},[n,e.messages]),C.useEffect(()=>{u.current!==null&&u.current.clear(),!(!o||f.instructions[r-1]===void 0)&&a.current!==null&&l.current!==null&&(l.current.revealLineInCenterIfOutsideViewport(r),u.current=l.current.createDecorationsCollection([{range:new a.current.Range(r,1,r,f.instructions[r-1].length+1),options:{isWholeLine:!0,className:"rangeCurrentLine",marginClassName:"rangeCurrentLine"}}]))},[r,o]);const p=m=>{if(m===void 0)return;const v=new Date().getTime();(d.current===null||d.current.time{f.decodeInstructions(!0),h(Qg())},Lse)}),f.loadNewInstructions(fCe(m)),h(O1(!1)),h(kM([])),h(FL("")),h(jX(1)),h(zQe(m)),h(uCe(!0)),h(Qg())};return ze("div",{className:FJe.divMonacoEditorWrapper,children:ze(Uet,{language:"ir",theme:"ir-theme",beforeMount:m=>{a.current=m,jet(m)},onMount:m=>{l.current=m,m.setValue(s),g()},onChange:m=>p(m),options:{scrollbar:{verticalScrollbarSize:13,horizontalScrollbarSize:13},minimap:{enabled:!1}}})})},Get="_divVmConsoleWrapper_emhz3_1",qet="_divVmConsole_emhz3_1",Xet="_divVmConsoleBoxShadow_emhz3_42",Yet="_divConsoleBlankArea_emhz3_46",RR={divVmConsoleWrapper:Get,divVmConsole:qet,divVmConsoleBoxShadow:Xet,divConsoleBlankArea:Yet},Zet="_divInputBlockWrapper_1w97i_1",Qet="_spanArrow_1w97i_9",Jet="_spanPrompt_1w97i_13",MR={divInputBlockWrapper:Zet,spanArrow:Qet,spanPrompt:Jet,in:"_in_1w97i_18"},ett=i=>{const e=xc();return Nn("div",{className:MR.divInputBlockWrapper,children:[ze("span",{className:MR.spanArrow,children:e.formatMessage({id:"CONSOLE_ARROW"})}),ze("span",{className:MR.spanPrompt,children:i.prompt.reduce((t,n)=>t+e.formatMessage({id:n.key},n.values),"")}),ze("input",{ref:i.inputRef,className:MR.in,spellCheck:!1,value:i.value,onChange:t=>i.onChange(t.currentTarget.value),onKeyDown:t=>{t.key==="Enter"&&i.onEnter()}})]})},ttt="_divControlPanelWrapper_x2oa8_1",ntt="_divSide_x2oa8_11",itt="_iconRun_x2oa8_17",rtt="_iconStep_x2oa8_21",ott="_iconReset_x2oa8_25",stt="_iconClear_x2oa8_29",d1={divControlPanelWrapper:ttt,divSide:ntt,iconRun:itt,iconStep:rtt,iconReset:ott,iconClear:stt},att="_divIconWrapper_shrpr_1",ltt={divIconWrapper:att},PR=i=>Nn("div",{className:De(ltt.divIconWrapper,i.className),title:i.keyTooltip!==void 0?`${i.label} (${i.keyTooltip})`:i.label,onClick:e=>{e.stopPropagation(),i.onClick()},children:[i.icon,i.label!==void 0&&ze("label",{children:i.label})]}),ctt=i=>{const e=xc();return ze("div",{className:d1.divControlPanelWrapper,children:Nn("div",{className:d1.divSide,children:[ze(PR,{className:d1.iconRun,icon:ze(PBe,{}),label:e.formatMessage({id:"RUN"}),keyTooltip:"F2",onClick:i.onRunClick}),ze(PR,{className:d1.iconStep,icon:ze(K5e,{}),label:e.formatMessage({id:"RUN_STEP"}),keyTooltip:"F8",onClick:i.onRunStepClick}),ze(PR,{className:d1.iconReset,icon:ze(e8e,{}),label:e.formatMessage({id:"RESET"}),keyTooltip:"F9",onClick:i.onResetClick}),ze(PR,{className:d1.iconClear,icon:ze(f8e,{}),label:e.formatMessage({id:"CLEAR_CONSOLE"}),keyTooltip:"F10",onClick:i.onClearClick})]})})},utt="_divOutputBlocksWrapper_1gqjv_1",dtt="_divOutputBlockWrapper_1gqjv_6",htt="_spanError_1gqjv_16",ftt="_spanWarning_1gqjv_20",gtt="_spanSuccess_1gqjv_24",ptt="_spanInput_1gqjv_28",mtt="_spanOutput_1gqjv_32",vtt="_spanPrompt_1gqjv_36",_tt="_spanArrow_1gqjv_40",Cg={divOutputBlocksWrapper:utt,divOutputBlockWrapper:dtt,spanError:htt,spanWarning:ftt,spanSuccess:gtt,spanInput:ptt,spanOutput:mtt,spanPrompt:vtt,spanArrow:_tt},btt=C.memo(({messages:i})=>{const e=xc();return ze("div",{className:Cg.divOutputBlocksWrapper,children:i.map((t,n)=>ze("div",{className:Cg.divOutputBlockWrapper,children:t.map((r,o)=>{const s=e.formatMessage({id:r.key},r.values);return ze("span",{className:De({[Cg.spanError]:r.type===nc.ERROR,[Cg.spanWarning]:r.type===nc.WARNING,[Cg.spanSuccess]:r.type===nc.SUCCESS,[Cg.spanInput]:r.type===nc.INPUT,[Cg.spanOutput]:r.type===nc.OUTPUT,[Cg.spanPrompt]:r.type===nc.PROMPT,[Cg.spanArrow]:r.type===nc.ARROW}),children:s},o)})},n))})}),Ctt=({vmIndex:i})=>{const e=MS(),[t,n]=C.useState(!1),r=Yr(_=>_.vm.vmPageStates[i].consoleInput),o=Yr(_=>_.vm.vmPageStates[i].consoleInputPrompt),s=Yr(_=>_.vm.vmPageStates[i].consoleOutputs),a=C.useRef(null),l=C.useRef({buffer:[],nextInputIndex:0}),c=()=>{l.current.buffer=[],l.current.nextInputIndex=0},u=C.useRef(null),d=C.useRef(null),h=C.useRef(!1),f=vC.at(i);C.useEffect(()=>{f.setReadConsoleFn(_=>{var y;return h.current||e(O1(!0)),e(Qg()),(y=d.current)==null||y.focus(),l.current.nextInputIndex({...S,type:nc.PROMPT})),{key:"READ_INPUT",values:{value:r},type:nc.INPUT}]])),Promise.resolve(l.current.buffer[l.current.nextInputIndex++])):(e(kM(_)),new Promise(S=>{a.current=S}))})},[]),C.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo(0,u.current.scrollHeight)},[r,o,s]);const g=async()=>{var _;if(!f.canContinueExecution){f.state===ar.WAIT_INPUT&&((_=d.current)==null||_.focus());return}h.current=!0,e(O1(!1)),await f.executeContinuously(),c(),e(Qg())},p=async()=>{var _;if(!f.canContinueExecution){f.state===ar.WAIT_INPUT&&((_=d.current)==null||_.focus());return}switch(h.current=!1,await f.executeSingleStep(),f.state){case ar.FREE:e(O1(!0));break;case ar.EXITED_NORMALLY:case ar.EXITED_ABNORMALLY:c(),e(O1(!1));break}e(Qg())},m=()=>{e(O1(!1)),e(kM([])),e(FL("")),e(jX(1)),f.reset(),f.decodeInstructions(!0),a.current!==null&&(a.current(""),a.current=null),c(),e(Qg())},v=()=>{var _;e(UQe()),e(FL("")),f.state===ar.WAIT_INPUT&&((_=d.current)==null||_.focus())};return Nn("div",{className:RR.divVmConsoleWrapper,tabIndex:0,onKeyDown:_=>{if(!(_.key!=="F2"&&_.key!=="F8"&&_.key!=="F9"&&_.key!=="F10"))switch(_.preventDefault(),_.key){case"F2":g();break;case"F8":p();break;case"F9":m();break;case"F10":v();break}},children:[ze(ctt,{onRunClick:g,onRunStepClick:p,onResetClick:m,onClearClick:v}),Nn("div",{ref:u,className:De(RR.divVmConsole,t&&RR.divVmConsoleBoxShadow),onScroll:_=>{_.currentTarget.scrollTop>0&&!t?n(!0):_.currentTarget.scrollTop<=0&&t&&n(!1)},children:[ze(btt,{messages:s}),ze(ett,{inputRef:d,prompt:o,value:r,onChange:_=>e(FL(_)),onEnter:()=>{if(f.state===ar.WAIT_INPUT||f.state===ar.BUSY||f.state===ar.FREE){const _=tJe(r);l.current.buffer.push(..._),a.current!==null&&l.current.nextInputIndex({..._,type:nc.PROMPT})),{key:"READ_INPUT",values:{value:r},type:nc.INPUT}]])),e(kM([])),e(FL(""))}}),ze("div",{className:RR.divConsoleBlankArea,onClick:()=>{var _;return(_=d.current)==null?void 0:_.focus()}})]})]})},ytt="_divVmInspectorWrapper_1lk9c_1",wtt="_divVmInspectorWrapperBoxShadow_1lk9c_34",Stt="_divStepStateCard_1lk9c_38",xtt="_divStepStateWrapper_1lk9c_49",Ltt="_lblStepStateLabel_1lk9c_55",Ett="_divStepCount_1lk9c_62",Dtt="_divStateBase_1lk9c_68",Itt="_divStateExitedAbnormally_1lk9c_68",ktt="_divStateExitedNormally_1lk9c_68",Ttt="_divStateMaxStepReached_1lk9c_68",Ntt="_divStateRuntimeError_1lk9c_68",Rtt="_divStateStaticCheckFailed_1lk9c_68",Mtt="_divStateFree_1lk9c_68",Ptt="_divStateWaitInput_1lk9c_68",Att="_divStateBusy_1lk9c_68",Ott="_divStateInitial_1lk9c_68",Ftt="_divOptionsCard_1lk9c_109",Btt="_divOptionWrapper_1lk9c_121",Wtt="_lblOption_1lk9c_128",$tt="_iconOptionInfo_1lk9c_133",Htt="_inOptionValue_1lk9c_143",Vtt="_divMemoryUsageCard_1lk9c_147",ztt="_divGlobalVariableTableCard_1lk9c_162",Utt="_divLocalVariableTableCard_1lk9c_178",jtt="_divLocalVariableTableWrapper_1lk9c_198",Ktt="_divLocalVariableTable_1lk9c_178",Gtt="_paginationLocalVariableTable_1lk9c_225",Hi={divVmInspectorWrapper:ytt,divVmInspectorWrapperBoxShadow:wtt,divStepStateCard:Stt,divStepStateWrapper:xtt,lblStepStateLabel:Ltt,divStepCount:Ett,divStateBase:Dtt,divStateExitedAbnormally:Itt,divStateExitedNormally:ktt,divStateMaxStepReached:Ttt,divStateRuntimeError:Ntt,divStateStaticCheckFailed:Rtt,divStateFree:Mtt,divStateWaitInput:Ptt,divStateBusy:Att,divStateInitial:Ott,divOptionsCard:Ftt,divOptionWrapper:Btt,lblOption:Wtt,iconOptionInfo:$tt,inOptionValue:Htt,divMemoryUsageCard:Vtt,divGlobalVariableTableCard:ztt,divLocalVariableTableCard:Utt,divLocalVariableTableWrapper:jtt,divLocalVariableTable:Ktt,paginationLocalVariableTable:Gtt},qtt="_divMemoryUsageWrapper_1rsex_1",Xtt="_divUsageBlock_1rsex_7",Ytt="_progress_1rsex_25",Qx={divMemoryUsageWrapper:qtt,divUsageBlock:Xtt,progress:Ytt},a9=i=>{const e=xc();return Nn("div",{className:Qx.divMemoryUsageWrapper,children:[Nn("div",{className:Qx.divUsageBlock,children:[ze(Ioe,{className:Qx.progress,percent:i.usedBytes/i.totalBytes*100,showInfo:!1,status:"normal"}),Nn("div",{children:[ze("label",{children:i.title}),ze("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.usedBytes/i.totalBytes*100})})]}),ze("span",{children:e.formatMessage({id:"B_USAGE"},{used:i.usedBytes,total:i.totalBytes})}),ze("span",{children:e.formatMessage({id:"KB_USAGE"},{used:i9(i.usedBytes),total:i9(i.totalBytes)})})]}),Nn("div",{className:Qx.divUsageBlock,children:[ze(Ioe,{className:Qx.progress,percent:i.peakBytes/i.totalBytes*100,showInfo:!1,status:"exception"}),Nn("div",{children:[ze("label",{children:e.formatMessage({id:"PEAK_MEMORY_USAGE"})}),ze("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.peakBytes/i.totalBytes*100})})]}),ze("span",{children:e.formatMessage({id:"BYTES"},{bytes:i.peakBytes})}),ze("span",{children:e.formatMessage({id:"KB"},{kb:i9(i.peakBytes)})})]})]})},Ztt="_divVariableTableWrapper_1pgdz_1",Qtt="_divValues_1pgdz_10",Ese={divVariableTableWrapper:Ztt,divValues:Qtt},Dse=C.memo(i=>{const e=xc(),t=[{title:e.formatMessage({id:"VARIABLE_ID"}),dataIndex:"id",showSorterTooltip:!1,sorter:(n,r)=>nJe(n.id,r.id)},{title:e.formatMessage({id:"ADDRESS"}),dataIndex:"address",showSorterTooltip:!1,sorter:(n,r)=>n.address-r.address},{title:e.formatMessage({id:"SIZE"}),dataIndex:"size",showSorterTooltip:!1,sorter:(n,r)=>n.size-r.size},{title:e.formatMessage({id:"VALUES"}),dataIndex:"values",render:n=>ze("div",{className:Ese.divValues,children:n.map((r,o)=>ze("div",{children:n.length===1?r:Nn(nPe,{children:["[",o,"]: ",r]})},`${o}${r}`))})}];return ze("div",{className:Ese.divVariableTableWrapper,children:i.variables.length===0?ze("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):ze(jZe,{rowKey:"id",columns:t,dataSource:i.variables,size:"small",pagination:!1})})});function Jtt(i){switch(i){case ar.BUSY:return"STATE_BUSY";case ar.EXITED_ABNORMALLY:return"STATE_EXITED_ABNORMALLY";case ar.EXITED_NORMALLY:return"STATE_EXITED_NORMALLY";case ar.FREE:return"STATE_FREE";case ar.INITIAL:return"STATE_INITIAL";case ar.MAX_STEP_REACHED:return"STATE_MAX_STEP_REACHED";case ar.RUNTIME_ERROR:return"STATE_RUNTIME_ERROR";case ar.STATIC_CHECK_FAILED:return"STATE_STATIC_CHECK_FAILED";case ar.WAIT_INPUT:return"STATE_WAIT_INPUT"}}const l9=10,ent=({vmIndex:i})=>{const e=xc(),t=MS(),n=Yr(p=>p.vm.vmPageStates[i].state),r=Yr(p=>p.vm.vmPageStates[i].stepCount),o=Yr(p=>p.vm.vmPageStates[i].options),s=Yr(p=>p.vm.vmPageStates[i].memoryUsage),a=Yr(p=>p.vm.vmPageStates[i].peakMemoryUsage),l=Yr(p=>p.vm.vmPageStates[i].globalVariableDetails),c=Yr(p=>p.vm.vmPageStates[i].localVariableDetailsStack),u=Yr(p=>p.vm.vmPageStates[i].localVariableTablePageIndex),[d,h]=C.useState(!1),f=C.useRef(null),g=vC.at(i);return Nn("div",{ref:f,className:De(Hi.divVmInspectorWrapper,d&&Hi.divVmInspectorWrapperBoxShadow),onScroll:p=>{p.currentTarget.scrollTop>0&&!d?h(!0):p.currentTarget.scrollTop<=0&&d&&h(!1)},children:[Nn("div",{className:Hi.divStepStateCard,children:[Nn("div",{className:Hi.divStepStateWrapper,children:[ze("label",{className:Hi.lblStepStateLabel,children:e.formatMessage({id:"STEP_COUNT"})}),ze("div",{className:Hi.divStepCount,children:e.formatMessage({id:"STEP_COUNT_NUMBER"},{stepCount:r})})]}),Nn("div",{className:Hi.divStepStateWrapper,children:[ze("label",{className:Hi.lblStepStateLabel,children:e.formatMessage({id:"STATE"})}),ze("div",{className:De({[Hi.divStateInitial]:n===ar.INITIAL,[Hi.divStateBusy]:n===ar.BUSY,[Hi.divStateWaitInput]:n===ar.WAIT_INPUT,[Hi.divStateFree]:n===ar.FREE,[Hi.divStateStaticCheckFailed]:n===ar.STATIC_CHECK_FAILED,[Hi.divStateRuntimeError]:n===ar.RUNTIME_ERROR,[Hi.divStateMaxStepReached]:n===ar.MAX_STEP_REACHED,[Hi.divStateExitedNormally]:n===ar.EXITED_NORMALLY,[Hi.divStateExitedAbnormally]:n===ar.EXITED_ABNORMALLY}),children:e.formatMessage({id:Jtt(n)})})]})]}),Nn("div",{className:Hi.divOptionsCard,children:[Nn("div",{className:Hi.divOptionWrapper,children:[Nn("label",{className:Hi.lblOption,children:[e.formatMessage({id:"MAX_EXECUTION_STEP_COUNT"}),ze(Qk,{title:e.formatMessage({id:"SET_0_MEANS_NO_STEP_LIMIT"}),children:ze(Vme,{className:Hi.iconOptionInfo})})]}),ze(K6,{className:Hi.inOptionValue,disabled:n!==ar.INITIAL,min:Hd.maxExecutionStepCount.min,max:Hd.maxExecutionStepCount.max,value:o.maxExecutionStepCount,onChange:p=>{g.configure({maxExecutionStepCount:p??void 0}),t(Qg())}})]}),Nn("div",{className:Hi.divOptionWrapper,children:[ze("label",{className:Hi.lblOption,children:e.formatMessage({id:"MEMORY_SIZE"})}),ze(K6,{className:Hi.inOptionValue,disabled:n!==ar.INITIAL,min:Hd.memorySize.min,max:Hd.memorySize.max,value:o.memorySize,onChange:p=>{g.configure({memorySize:p??void 0}),t(Qg())}})]}),Nn("div",{className:Hi.divOptionWrapper,children:[ze("label",{className:Hi.lblOption,children:e.formatMessage({id:"STACK_SIZE"})}),ze(K6,{className:Hi.inOptionValue,disabled:n!==ar.INITIAL,min:Hd.stackSize.min,max:Hd.stackSize.max,value:o.stackSize,onChange:p=>{g.configure({stackSize:p??void 0}),t(Qg())}})]})]}),Nn("div",{className:Hi.divMemoryUsageCard,children:[ze(a9,{title:e.formatMessage({id:"TOTAL_MEMORY_USAGE"}),usedBytes:s.used,totalBytes:s.total,peakBytes:a.total}),ze(a9,{title:e.formatMessage({id:"STACK_MEMORY_USAGE"}),usedBytes:s.stackUsed,totalBytes:s.stackTotal,peakBytes:a.stack}),ze(a9,{title:e.formatMessage({id:"GLOBAL_VARIABLE_MEMORY_USAGE"}),usedBytes:s.globalVariableUsed,totalBytes:s.globalVariableTotal,peakBytes:a.globalVariable})]}),Nn("div",{className:Hi.divGlobalVariableTableCard,children:[ze("label",{className:"title",children:e.formatMessage({id:"GLOBAL_VARIABLE_TABLE"})}),ze(Dse,{variables:l})]}),Nn("div",{className:Hi.divLocalVariableTableCard,children:[ze("label",{className:"title",children:e.formatMessage({id:"LOCAL_VARIABLE_TABLE"})}),c.length===0?ze("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):Nn("div",{className:Hi.divLocalVariableTableWrapper,children:[c.slice(l9*(u-1),l9*u).map(p=>Nn("div",{className:Hi.divLocalVariableTable,children:[Nn("div",{className:"titleWrapper",children:[ze("label",{className:"functionName",children:p.functionName}),Nn("label",{className:"callStackDepth",children:["(",e.formatMessage({id:"CALL_STACK_DEPTH"},{depth:p.stackDepth}),")"]})]}),ze(Dse,{variables:p.details})]},`${p.functionName}${p.stackDepth}`)),ze(kX,{className:Hi.paginationLocalVariableTable,current:u,onChange:p=>t(jX(p)),pageSize:l9,showSizeChanger:!1,total:c.length,size:"small"})]})]})]})},tnt=()=>{const i=xc(),e=MS(),t=Yr(l=>l.vm.vmPageStates.length),n=Yr(l=>l.vm.activeVmIndex),r=Yr(l=>l.vm.vmPageStates.map(c=>c.id),(l,c)=>l.length===c.length&&l.every((u,d)=>u===c[d])),o=Yr(l=>l.vm.vmPageStates.every(c=>!c.isIrChanged)),[s,a]=C.useState(window.innerWidth{window.onresize=()=>a(window.innerWidth{window.onbeforeunload=o?null:l=>(l.preventDefault(),l.returnValue="Your unsaved changes will be lost. Sure to leave?")},[o]),Nn("main",{className:Vx.main,onDragEnter:l=>l.preventDefault(),onDragOver:l=>l.preventDefault(),onDrop:l=>{for(const c of l.dataTransfer.files)_Ce(e,i,c);l.preventDefault()},children:[ze(dJe,{vmIndex:n}),Nn("div",{className:Vx.divRight,children:[ze(IJe,{}),ze("div",{className:Vx.divVmWrapper,children:t===0?ze(AJe,{}):new Array(t).fill(null).map((l,c)=>Nn("div",{className:De({[Vx.divVmContentHorizontal]:!s,[Vx.divVmContentVertical]:s}),style:{display:c===n?"flex":"none"},children:[ze("section",{className:"sectionIrEditor",children:ze(Ket,{vmIndex:c})}),ze("section",{className:"sectionVmConsole",children:ze(Ctt,{vmIndex:c})}),ze("section",{className:"sectionVmInspector",children:ze(ent,{vmIndex:c})})]},r[c]))})]})]})},nnt=m4e([{path:"/",element:ze(tnt,{})}],{basename:"/ir-virtual-machine"});function Wc(i,e=0){return i[i.length-(1+e)]}function int(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function lr(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,r=i.length;nt(i[n],e))}function ont(i,e){let t=0,n=i-1;for(;t<=n;){const r=(t+n)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)n=r-1;else return r}return-(t+1)}function ZH(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,n);l<0?r.push(a):l>0?o.push(a):s.push(a)}return i!!e)}function kse(i){let e=0;for(let t=0;t0}function Ap(i,e=t=>t){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function GX(i,e){return i.length>0?i[0]:e}function ua(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let r=t;re;r--)n.push(r);return n}function n3(i,e,t){const n=i.slice(0,e),r=i.slice(e);return n.concat(t,r)}function c9(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function AR(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function QH(i,e){for(const t of e)i.push(t)}function qX(i){return Array.isArray(i)?i:[i]}function ant(i,e,t){const n=ICe(i,e),r=i.length,o=t.length;i.length=r+o;for(let s=r-1;s>=n;s--)i[s+o]=i[s];for(let s=0;s0}i.isGreaterThan=n;function r(o){return o===0}i.isNeitherLessOrGreaterThan=r,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(eI||(eI={}));function nu(i,e){return(t,n)=>e(i(t),i(n))}function lnt(...i){return(e,t)=>{for(const n of i){const r=n(e,t);if(!eI.isNeitherLessOrGreaterThan(r))return r}return eI.neitherLessOrGreaterThan}}const mp=(i,e)=>i-e,cnt=(i,e)=>mp(i?1:0,e?1:0);function kCe(i){return(e,t)=>-i(e,t)}class Op{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=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Mf{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Mf(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Mf(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||eI.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}}Mf.empty=new Mf(i=>{});function Ea(i){return typeof i=="string"}function ba(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function unt(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Kv(i){return typeof i=="number"&&!isNaN(i)}function Nse(i){return!!i&&typeof i[Symbol.iterator]=="function"}function TCe(i){return i===!0||i===!1}function xl(i){return typeof i>"u"}function Pf(i){return!sc(i)}function sc(i){return xl(i)||i===null}function Yn(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Ym(i){if(sc(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function tI(i){return typeof i=="function"}function dnt(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?Fg(n):n}),e}function fnt(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(NCe.call(t,n)){const r=t[n];typeof r=="object"&&!Object.isFrozen(r)&&!unt(r)&&e.push(r)}}return i}const NCe=Object.prototype.hasOwnProperty;function RCe(i,e){return JH(i,e,new Set)}function JH(i,e,t){if(sc(i))return i;const n=e(i);if(typeof n<"u")return n;if(Array.isArray(i)){const r=[];for(const o of i)r.push(JH(o,e,t));return r}if(ba(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const r={};for(const o in i)NCe.call(i,o)&&(r[o]=JH(i[o],e,t));return t.delete(i),r}return i}function i3(i,e,t=!0){return ba(i)?(ba(e)&&Object.keys(e).forEach(n=>{n in i?t&&(ba(i[n])&&ba(e[n])?i3(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function pc(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},n={};for(const r of i)n[r]=t(r);return n}let mnt=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function MCe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,r)=>{const o=r[0],s=e[o];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),mnt&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(i,e,...t){return MCe(e,t)}function Hn(i,e,...t){const n=MCe(e,t);return{value:n,original:n}}var u9;const cy="en";let EA=!1,DA=!1,MM=!1,PCe=!1,YX=!1,ZX=!1,ACe=!1,OR,PM=cy,Rse=cy,vnt,Ed;const vp=globalThis;let da;typeof vp.vscode<"u"&&typeof vp.vscode.process<"u"?da=vp.vscode.process:typeof process<"u"&&(da=process);const _nt=typeof((u9=da==null?void 0:da.versions)===null||u9===void 0?void 0:u9.electron)=="string",bnt=_nt&&(da==null?void 0:da.type)==="renderer";if(typeof da=="object"){EA=da.platform==="win32",DA=da.platform==="darwin",MM=da.platform==="linux",MM&&da.env.SNAP&&da.env.SNAP_REVISION,da.env.CI||da.env.BUILD_ARTIFACTSTAGINGDIRECTORY,OR=cy,PM=cy;const i=da.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];OR=e.locale,Rse=e.osLocale,PM=t||cy,vnt=e._translationsConfigFile}catch{}PCe=!0}else typeof navigator=="object"&&!bnt?(Ed=navigator.userAgent,EA=Ed.indexOf("Windows")>=0,DA=Ed.indexOf("Macintosh")>=0,ZX=(Ed.indexOf("Macintosh")>=0||Ed.indexOf("iPad")>=0||Ed.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MM=Ed.indexOf("Linux")>=0,ACe=(Ed==null?void 0:Ed.indexOf("Mobi"))>=0,YX=!0,w({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),OR=cy,PM=OR,Rse=navigator.language):console.error("Unable to resolve platform.");const Os=EA,Dn=DA,ka=MM,nh=PCe,I_=YX,Cnt=YX&&typeof vp.importScripts=="function",ynt=Cnt?vp.origin:void 0,fh=ZX,OCe=ACe,zf=Ed,wnt=PM,Snt=typeof vp.postMessage=="function"&&!vp.importScripts,FCe=(()=>{if(Snt){const i=[];vp.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=i.length;n{const n=++e;i.push({id:n,callback:t}),vp.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Ll=DA||ZX?2:EA?1:3;let Mse=!0,Pse=!1;function BCe(){if(!Pse){Pse=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Mse=new Uint16Array(i.buffer)[0]===(2<<8)+1}return Mse}const WCe=!!(zf&&zf.indexOf("Chrome")>=0),xnt=!!(zf&&zf.indexOf("Firefox")>=0),Lnt=!!(!WCe&&zf&&zf.indexOf("Safari")>=0),Ent=!!(zf&&zf.indexOf("Edg/")>=0),Dnt=!!(zf&&zf.indexOf("Android")>=0),Ts={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var In;(function(i){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*r(y){yield y}i.single=r;function o(y){return e(y)?y:r(y)}i.wrap=o;function s(y){return y||t}i.from=s;function*a(y){for(let S=y.length-1;S>=0;S--)yield y[S]}i.reverse=a;function l(y){return!y||y[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(y){return y[Symbol.iterator]().next().value}i.first=c;function u(y,S){for(const L of y)if(S(L))return!0;return!1}i.some=u;function d(y,S){for(const L of y)if(S(L))return L}i.find=d;function*h(y,S){for(const L of y)S(L)&&(yield L)}i.filter=h;function*f(y,S){let L=0;for(const E of y)yield S(E,L++)}i.map=f;function*g(...y){for(const S of y)yield*S}i.concat=g;function p(y,S,L){let E=L;for(const D of y)E=S(E,D);return E}i.reduce=p;function*m(y,S,L=y.length){for(S<0&&(S+=y.length),L<0?L+=y.length:L>y.length&&(L=y.length);S{r||(r=!0,this._remove(n))}}shift(){if(this._first!==oo.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oo.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oo.Undefined&&e.next!==oo.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===oo.Undefined&&e.next===oo.Undefined?(this._first=oo.Undefined,this._last=oo.Undefined):e.next===oo.Undefined?(this._last=this._last.prev,this._last.next=oo.Undefined):e.prev===oo.Undefined&&(this._first=this._first.next,this._first.prev=oo.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oo.Undefined;)yield e.element,e=e.next}}const $Ce="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Int(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of $Ce)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const QX=Int();function JX(i){let e=QX;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const HCe=new Ca;HCe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function nI(i,e,t,n,r){if(e=JX(e),r||(r=In.first(HCe)),t.length>r.maxLen){let c=i-r.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+r.maxLen/2),nI(i,e,t,n,r)}const o=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=knt(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function knt(i,e,t,n){let r;for(;r=i.exec(e);){const o=r.index||0;if(o<=t&&i.lastIndex>=t)return r;if(n>0&&o>n)return null}return null}const ym=8;class VCe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class zCe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class ir{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return r3(e,t)}compute(e,t,n){return n}}class PE{constructor(e,t){this.newValue=e,this.didChange=t}}function r3(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new PE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&lr(i,e);return new PE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const r=r3(i[n],e[n]);r.didChange&&(i[n]=r.newValue,t=!0)}return new PE(i,t)}class lT{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return r3(e,t)}validate(e){return this.defaultValue}}class HS{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return r3(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,n){return n}}function Tt(i,e){return typeof i>"u"?e:i==="false"?!1:!!i}class Wn extends HS{constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=n),super(e,t,n,r)}validate(e){return Tt(e,this.defaultValue)}}function v0(i,e,t,n){if(typeof i>"u")return e;let r=parseInt(i,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(n,r),r|0)}class bi extends HS{static clampedInt(e,t,n,r){return v0(e,t,n,r)}constructor(e,t,n,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=r,s.maximum=o),super(e,t,n,s),this.minimum=r,this.maximum=o}validate(e){return bi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Tnt(i,e,t,n){if(typeof i>"u")return e;const r=Ku.float(i,e);return Ku.clamp(r,t,n)}class Ku extends HS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,r,o){typeof o<"u"&&(o.type="number",o.default=n),super(e,t,n,o),this.validationFn=r}validate(e){return this.validationFn(Ku.float(e,this.defaultValue))}}class ga extends HS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="string",r.default=n),super(e,t,n,r)}validate(e){return ga.string(e,this.defaultValue)}}function yr(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class fr extends HS{constructor(e,t,n,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=n),super(e,t,n,o),this._allowedValues=r}validate(e){return yr(e,this.defaultValue,this._allowedValues)}}class FR extends ir{constructor(e,t,n,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,n,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Nnt(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Rnt extends ir{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("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,n){return n===0?e.accessibilitySupport:n}}class Mnt extends ir{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("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:Tt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Tt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Pnt(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Jo;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Jo||(Jo={}));function Ant(i){switch(i){case"line":return Jo.Line;case"block":return Jo.Block;case"underline":return Jo.Underline;case"line-thin":return Jo.LineThin;case"block-outline":return Jo.BlockOutline;case"underline-thin":return Jo.UnderlineThin}}class Ont extends lT{constructor(){super(141)}compute(e,t,n){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(111)&&r.push("showUnused"),t.get(139)&&r.push("showDeprecated"),r.join(" ")}}class Fnt extends Wn{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class Bnt extends ir{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:w("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:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("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:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Dn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("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:w("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:Tt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":yr(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":yr(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Tt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Tt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Tt(t.loop,this.defaultValue.loop)}}}class ac extends ir{constructor(){super(51,"fontLigatures",ac.OFF,{anyOf:[{type:"boolean",description:w("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:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("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?ac.OFF:e==="true"?ac.ON:e:e?ac.ON:ac.OFF}}ac.OFF='"liga" off, "calt" off';ac.ON='"liga" on, "calt" on';class Gd extends ir{constructor(){super(54,"fontVariations",Gd.OFF,{anyOf:[{type:"boolean",description:w("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:w("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:w("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"?Gd.OFF:e==="true"?Gd.TRANSLATE:e:e?Gd.TRANSLATE:Gd.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Gd.OFF="normal";Gd.TRANSLATE="translate";class Wnt extends lT{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class $nt extends HS{constructor(){super(52,"fontSize",il.fontSize,{type:"number",minimum:6,maximum:100,default:il.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=Ku.float(e,this.defaultValue);return t===0?il.fontSize:Ku.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class ff extends ir{constructor(){super(53,"fontWeight",il.fontWeight,{anyOf:[{type:"number",minimum:ff.MINIMUM_VALUE,maximum:ff.MAXIMUM_VALUE,errorMessage:w("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:ff.SUGGESTION_VALUES}],default:il.fontWeight,description:w("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(bi.clampedInt(e,il.fontWeight,ff.MINIMUM_VALUE,ff.MAXIMUM_VALUE))}}ff.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ff.MINIMUM_VALUE=1;ff.MAXIMUM_VALUE=1e3;class Hnt extends ir{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:w("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:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:w("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:w("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:w("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:w("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:yr(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:yr(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:yr(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:yr(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:yr(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:yr(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ga.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ga.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ga.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ga.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ga.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Vnt extends ir{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:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("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:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),delay:bi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Tt(t.sticky,this.defaultValue.sticky),hidingDelay:bi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Tt(t.above,this.defaultValue.above)}}}class Gy extends lT{constructor(){super(144)}compute(e,t,n){return Gy.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,n=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,r=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,v=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,S=d?2:3;let L=Math.floor(o*r);const E=L/o;let D=!1,k=!1,T=S*h,M=h/o,P=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:U,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:ie,desiredRatio:Y,minimapLineCount:J}=Gy.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(v/J>1)D=!0,k=!0,h=1,T=1,M=h/o;else{let he=!1,ge=h+1;if(g==="fit"){const ye=Math.ceil((j+v+ie)*T);y&&a&&_<=t.stableFitRemainingWidth?(he=!0,ge=t.stableFitMaxMinimapScale):he=ye>L}if(g==="fill"||he){D=!0;const ye=h;T=Math.min(l*o,Math.max(1,Math.floor(1/Y))),y&&a&&_<=t.stableFitRemainingWidth&&(ge=t.stableFitMaxMinimapScale),h=Math.min(ge,Math.max(1,Math.floor(T/S))),h>ye&&(P=Math.min(2,h/ye)),M=h/o/P,L=Math.ceil(Math.max(U,j+v+ie)*T),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const N=Math.floor(f*M),R=Math.min(N,Math.max(0,Math.floor((_-m-2)*M/(c+M)))+ym);let O=Math.floor(o*R);const B=O/o;O=Math.floor(O*P);const $=d?1:2,G=p==="left"?0:n-R-m;return{renderMinimap:$,minimapLeft:G,minimapWidth:R,minimapHeightIsEditorHeight:D,minimapIsSampling:k,minimapScale:h,minimapLineHeight:T,minimapCanvasInnerWidth:O,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const n=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(136),h=d==="inherit"?e.get(135):d,f=h==="inherit"?e.get(131):h,g=e.get(134),p=t.isDominatedByLongLines,m=e.get(57),v=e.get(68).renderType!==0,_=e.get(69),y=e.get(105),S=e.get(84),L=e.get(73),E=e.get(103),D=E.verticalScrollbarSize,k=E.verticalHasArrows,T=E.arrowSize,M=E.horizontalScrollbarSize,P=e.get(43),N=e.get(110)!=="never";let R=e.get(66);P&&N&&(R+=16);let O=0;if(v){const Ge=Math.max(s,_);O=Math.round(Ge*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let $=0,G=$+B,U=G+O,j=U+R;const ie=n-B-O-R;let Y=!1,J=!1,Q=-1;h==="inherit"&&p?(Y=!0,J=!0):f==="on"||f==="bounded"?J=!0:f==="wordWrapColumn"&&(Q=g);const he=Gy._computeMinimapLayout({outerWidth:n,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:S.top,paddingBottom:S.bottom,minimap:L,verticalScrollbarWidth:D,viewLineCount:u,remainingWidth:ie,isViewportWrapping:J},t.memory||new zCe);he.renderMinimap!==0&&he.minimapLeft===0&&($+=he.minimapWidth,G+=he.minimapWidth,U+=he.minimapWidth,j+=he.minimapWidth);const ge=ie-he.minimapWidth,ye=Math.max(1,Math.floor((ge-D-2)/a)),be=k?T:0;return J&&(Q=Math.max(1,ye),f==="bounded"&&(Q=Math.min(Q,g))),{width:n,height:r,glyphMarginLeft:$,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:G,lineNumbersWidth:O,decorationsLeft:U,decorationsWidth:R,contentLeft:j,contentWidth:ge,minimap:he,viewportColumn:ye,isWordWrapMinified:Y,isViewportWrapping:J,wrappingColumn:Q,verticalScrollbarWidth:D,horizontalScrollbarHeight:M,overviewRuler:{top:be,width:D,height:r-2*be,right:0}}}}class znt extends ir{constructor(){super(138,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("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."),w("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:w("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 yr(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}var $u;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})($u||($u={}));class Unt extends ir{constructor(){const e={enabled:$u.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[$u.Off,$u.OnCode,$u.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:yr(e.enabled,this.defaultValue.enabled,[$u.Off,$u.OnCode,$u.On])}}}class jnt extends ir{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("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:w("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:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),maxLineCount:bi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:yr(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Tt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Knt extends ir{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(140,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Dn?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Dn?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("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:w("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:w("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:yr(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:bi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily),padding:Tt(t.padding,this.defaultValue.padding)}}}class Gnt extends ir{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):bi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?bi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class qnt extends Ku{constructor(){super(67,"lineHeight",il.lineHeight,e=>Ku.clamp(e,0,150),{markdownDescription:w("lineHeight",`Controls the line height. + `},Sse=cet(fet)(bCe),get={config:det},pet=function(){for(var e=arguments.length,t=new Array(e),n=0;n{n.current=!1}:i,e)}var Uc=Aet;function ME(){}function ly(i,e,t,n){return Oet(i,n)||Fet(i,e,t,n)}function Oet(i,e){return i.editor.getModel(LCe(i,e))}function Fet(i,e,t,n){return i.editor.createModel(e,t,n?LCe(i,n):void 0)}function LCe(i,e){return i.Uri.parse(e)}function Bet({original:i,modified:e,language:t,originalLanguage:n,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=ME,onMount:v=ME}){let[_,y]=C.useState(!1),[S,L]=C.useState(!0),E=C.useRef(null),D=C.useRef(null),k=C.useRef(null),T=C.useRef(v),M=C.useRef(m),P=C.useRef(!1);xCe(()=>{let B=t3.init();return B.then($=>(D.current=$)&&L(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>E.current?O():B.cancel()}),Uc(()=>{if(E.current&&D.current){let B=E.current.getOriginalEditor(),$=ly(D.current,i||"",n||t||"text",o||"");$!==B.getModel()&&B.setModel($)}},[o],_),Uc(()=>{if(E.current&&D.current){let B=E.current.getModifiedEditor(),$=ly(D.current,e||"",r||t||"text",s||"");$!==B.getModel()&&B.setModel($)}},[s],_),Uc(()=>{let B=E.current.getModifiedEditor();B.getOption(D.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],_),Uc(()=>{var B,$;($=(B=E.current)==null?void 0:B.getModel())==null||$.original.setValue(i||"")},[i],_),Uc(()=>{let{original:B,modified:$}=E.current.getModel();D.current.editor.setModelLanguage(B,n||t||"text"),D.current.editor.setModelLanguage($,r||t||"text")},[t,n,r],_),Uc(()=>{var B;(B=D.current)==null||B.editor.setTheme(c)},[c],_),Uc(()=>{var B;(B=E.current)==null||B.updateOptions(d)},[d],_);let N=C.useCallback(()=>{var G;if(!D.current)return;M.current(D.current);let B=ly(D.current,i||"",n||t||"text",o||""),$=ly(D.current,e||"",r||t||"text",s||"");(G=E.current)==null||G.setModel({original:B,modified:$})},[t,e,r,i,n,o,s]),R=C.useCallback(()=>{var B;!P.current&&k.current&&(E.current=D.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),N(),(B=D.current)==null||B.editor.setTheme(c),y(!0),P.current=!0)},[d,c,N]);C.useEffect(()=>{_&&T.current(E.current,D.current)},[_]),C.useEffect(()=>{!S&&!_&&R()},[S,_,R]);function O(){var $,G,U,j;let B=($=E.current)==null?void 0:$.getModel();a||((G=B==null?void 0:B.original)==null||G.dispose()),l||((U=B==null?void 0:B.modified)==null||U.dispose()),(j=E.current)==null||j.dispose()}return qe.createElement(SCe,{width:f,height:h,isEditorReady:_,loading:u,_ref:k,className:g,wrapperProps:p})}var Wet=Bet;C.memo(Wet);function $et(i){let e=C.useRef();return C.useEffect(()=>{e.current=i},[i]),e.current}var Het=$et,NR=new Map;function Vet({defaultValue:i,defaultLanguage:e,defaultPath:t,value:n,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:v=ME,onMount:_=ME,onChange:y,onValidate:S=ME}){let[L,E]=C.useState(!1),[D,k]=C.useState(!0),T=C.useRef(null),M=C.useRef(null),P=C.useRef(null),N=C.useRef(_),R=C.useRef(v),O=C.useRef(),B=C.useRef(n),$=Het(o),G=C.useRef(!1),U=C.useRef(!1);xCe(()=>{let Y=t3.init();return Y.then(J=>(T.current=J)&&k(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>M.current?ie():Y.cancel()}),Uc(()=>{var J,Q,he,ge;let Y=ly(T.current,i||n||"",e||r||"",o||t||"");Y!==((J=M.current)==null?void 0:J.getModel())&&(d&&NR.set($,(Q=M.current)==null?void 0:Q.saveViewState()),(he=M.current)==null||he.setModel(Y),d&&((ge=M.current)==null||ge.restoreViewState(NR.get(o))))},[o],L),Uc(()=>{var Y;(Y=M.current)==null||Y.updateOptions(c)},[c],L),Uc(()=>{!M.current||n===void 0||(M.current.getOption(T.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(U.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),U.current=!1))},[n],L),Uc(()=>{var J,Q;let Y=(J=M.current)==null?void 0:J.getModel();Y&&r&&((Q=T.current)==null||Q.editor.setModelLanguage(Y,r))},[r],L),Uc(()=>{var Y;a!==void 0&&((Y=M.current)==null||Y.revealLine(a))},[a],L),Uc(()=>{var Y;(Y=T.current)==null||Y.editor.setTheme(s)},[s],L);let j=C.useCallback(()=>{var Y;if(!(!P.current||!T.current)&&!G.current){R.current(T.current);let J=o||t,Q=ly(T.current,n||i||"",e||r||"",J||"");M.current=(Y=T.current)==null?void 0:Y.editor.create(P.current,{model:Q,automaticLayout:!0,...c},u),d&&M.current.restoreViewState(NR.get(J)),T.current.editor.setTheme(s),a!==void 0&&M.current.revealLine(a),E(!0),G.current=!0}},[i,e,t,n,r,o,c,u,d,s,a]);C.useEffect(()=>{L&&N.current(M.current,T.current)},[L]),C.useEffect(()=>{!D&&!L&&j()},[D,L,j]),B.current=n,C.useEffect(()=>{var Y,J;L&&y&&((Y=O.current)==null||Y.dispose(),O.current=(J=M.current)==null?void 0:J.onDidChangeModelContent(Q=>{U.current||y(M.current.getValue(),Q)}))},[L,y]),C.useEffect(()=>{if(L){let Y=T.current.editor.onDidChangeMarkers(J=>{var he;let Q=(he=M.current.getModel())==null?void 0:he.uri;if(Q&&J.find(ge=>ge.path===Q.path)){let ge=T.current.editor.getModelMarkers({resource:Q});S==null||S(ge)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[L,S]);function ie(){var Y,J;(Y=O.current)==null||Y.dispose(),h?d&&NR.set(o,M.current.saveViewState()):(J=M.current.getModel())==null||J.dispose(),M.current.dispose()}return qe.createElement(SCe,{width:f,height:g,isEditorReady:L,loading:l,_ref:P,className:p,wrapperProps:m})}var zet=Vet,Uet=C.memo(zet);let xse=!1;const Zx="ir";function jet(i){if(xse)return;i.languages.register({id:Zx}),i.editor.defineTheme("ir-theme",{base:"vs",inherit:!0,rules:[{token:"function",foreground:"#74531f"},{token:"number.size",foreground:"#0097ff"}],colors:{}});const e="[a-zA-Z_]\\w*",t="[ \\t\\r\\n]+";i.languages.setMonarchTokensProvider(Zx,{keywords:NM,identifier:e,whitespace:t,defaultToken:"source",tokenizer:{root:[[/#-?\d+/,"number"],[/\d+/,"number.size"],[/(:=)|(\+)|(-)|(\*)|(\/)|(==)|(!=)|(<=)|(<)|(>=)|(>)|(&)/,"operators"],[/:/,"delimiter"],[/;.*/,"comment"],[/@whitespace/,"white"],[/(FUNCTION)(@whitespace)(@identifier)/,["keyword","white","function"]],[/(CALL)(@whitespace)(@identifier)/,["keyword","white","function"]],[/@identifier/,{cases:{"@keywords":"keyword","@default":"identifier"}}]]}});const n=["FUNCTION ${1:id} :\n","DEC ${1:id} ${2:size}","GLOBAL_DEC ${1:id} ${2:size}","LABEL ${1:id} :\n","GOTO ${1:label}","IF ${1:condition} GOTO ${2:label}","ARG ${1:value}","PARAM ${1:id}","CALL ${1:id}","RETURN ${1:value}","READ ${1:id}","WRITE ${1:value}"];i.languages.registerCompletionItemProvider(Zx,{provideCompletionItems:(r,o)=>{const s=r.getWordUntilPosition(o),a={startLineNumber:o.lineNumber,endLineNumber:o.lineNumber,startColumn:s.startColumn,endColumn:s.endColumn};return{suggestions:[...NM.map(l=>({label:l,kind:i.languages.CompletionItemKind.Keyword,insertText:l,range:a})),...NM.map((l,c)=>({label:`${l} Snippet`,kind:i.languages.CompletionItemKind.Snippet,insertText:n[c],insertTextRules:i.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}))]}}}),i.languages.registerFoldingRangeProvider(Zx,{provideFoldingRanges:r=>{const o=r.getLinesContent(),s=[];let a=-1,l=-1,c=-1;for(let u=0;u{const e=xc(),t=Yr(m=>m.vm.vmPageStates[i].staticErrors),n=Yr(m=>m.vm.vmPageStates[i].runtimeErrors),r=Yr(m=>m.vm.vmPageStates[i].currentLineNumber),o=Yr(m=>m.vm.vmPageStates[i].shouldIndicateCurrentLineNumber),s=Yr(m=>m.vm.vmPageStates[i].irString),a=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=MS(),f=jv.at(i),g=()=>{a.current!==null&&l.current!==null&&l.current.getModel()!==null&&a.current.editor.setModelMarkers(l.current.getModel(),"IR Decoder",t.map(m=>({startLineNumber:m.startLineNumber,endLineNumber:m.endLineNumber,startColumn:m.startColumn,endColumn:m.endColumn+1,message:e.formatMessage({id:m.message.key},m.message.values),severity:a.current.MarkerSeverity.Error})))};C.useEffect(g,[t,e.messages]),C.useEffect(()=>{c.current!==null&&c.current.clear(),a.current!==null&&l.current!==null&&l.current.getModel()!==null&&(n.length>0&&l.current.revealLineInCenterIfOutsideViewport(r),c.current=l.current.createDecorationsCollection(n.map(m=>({range:new a.current.Range(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn),options:{isWholeLine:!0,className:"rangeError",marginClassName:"rangeError",hoverMessage:{value:e.formatMessage({id:m.message.key},m.message.values)}}}))))},[n,e.messages]),C.useEffect(()=>{u.current!==null&&u.current.clear(),!(!o||f.instructions[r-1]===void 0)&&a.current!==null&&l.current!==null&&(l.current.revealLineInCenterIfOutsideViewport(r),u.current=l.current.createDecorationsCollection([{range:new a.current.Range(r,1,r,f.instructions[r-1].length+1),options:{isWholeLine:!0,className:"rangeCurrentLine",marginClassName:"rangeCurrentLine"}}]))},[r,o]);const p=m=>{if(m===void 0)return;const v=new Date().getTime();(d.current===null||d.current.time{f.decodeInstructions(!0),h(Qg())},Lse)}),f.loadNewInstructions(fCe(m)),h(O1(!1)),h(kM([])),h(FL("")),h(jX(1)),h(zQe(m)),h(uCe(!0)),h(Qg())};return ze("div",{className:FJe.divMonacoEditorWrapper,children:ze(Uet,{language:"ir",theme:"ir-theme",beforeMount:m=>{a.current=m,jet(m)},onMount:m=>{l.current=m,m.setValue(s),g()},onChange:m=>p(m),options:{scrollbar:{verticalScrollbarSize:13,horizontalScrollbarSize:13},minimap:{enabled:!1}}})})},Get="_divVmConsoleWrapper_emhz3_1",qet="_divVmConsole_emhz3_1",Xet="_divVmConsoleBoxShadow_emhz3_42",Yet="_divConsoleBlankArea_emhz3_46",RR={divVmConsoleWrapper:Get,divVmConsole:qet,divVmConsoleBoxShadow:Xet,divConsoleBlankArea:Yet},Zet="_divInputBlockWrapper_1w97i_1",Qet="_spanArrow_1w97i_9",Jet="_spanPrompt_1w97i_13",MR={divInputBlockWrapper:Zet,spanArrow:Qet,spanPrompt:Jet,in:"_in_1w97i_18"},ett=i=>{const e=xc();return Nn("div",{className:MR.divInputBlockWrapper,children:[ze("span",{className:MR.spanArrow,children:e.formatMessage({id:"CONSOLE_ARROW"})}),ze("span",{className:MR.spanPrompt,children:i.prompt.reduce((t,n)=>t+e.formatMessage({id:n.key},n.values),"")}),ze("input",{ref:i.inputRef,className:MR.in,spellCheck:!1,value:i.value,onChange:t=>i.onChange(t.currentTarget.value),onKeyDown:t=>{t.key==="Enter"&&i.onEnter()}})]})},ttt="_divControlPanelWrapper_x2oa8_1",ntt="_divSide_x2oa8_11",itt="_iconRun_x2oa8_17",rtt="_iconStep_x2oa8_21",ott="_iconReset_x2oa8_25",stt="_iconClear_x2oa8_29",d1={divControlPanelWrapper:ttt,divSide:ntt,iconRun:itt,iconStep:rtt,iconReset:ott,iconClear:stt},att="_divIconWrapper_shrpr_1",ltt={divIconWrapper:att},PR=i=>Nn("div",{className:De(ltt.divIconWrapper,i.className),title:i.keyTooltip!==void 0?`${i.label} (${i.keyTooltip})`:i.label,onClick:e=>{e.stopPropagation(),i.onClick()},children:[i.icon,i.label!==void 0&&ze("label",{children:i.label})]}),ctt=i=>{const e=xc();return ze("div",{className:d1.divControlPanelWrapper,children:Nn("div",{className:d1.divSide,children:[ze(PR,{className:d1.iconRun,icon:ze(PBe,{}),label:e.formatMessage({id:"RUN"}),keyTooltip:"F2",onClick:i.onRunClick}),ze(PR,{className:d1.iconStep,icon:ze(K5e,{}),label:e.formatMessage({id:"RUN_STEP"}),keyTooltip:"F8",onClick:i.onRunStepClick}),ze(PR,{className:d1.iconReset,icon:ze(e8e,{}),label:e.formatMessage({id:"RESET"}),keyTooltip:"F9",onClick:i.onResetClick}),ze(PR,{className:d1.iconClear,icon:ze(f8e,{}),label:e.formatMessage({id:"CLEAR_CONSOLE"}),keyTooltip:"F10",onClick:i.onClearClick})]})})},utt="_divOutputBlocksWrapper_1gqjv_1",dtt="_divOutputBlockWrapper_1gqjv_6",htt="_spanError_1gqjv_16",ftt="_spanWarning_1gqjv_20",gtt="_spanSuccess_1gqjv_24",ptt="_spanInput_1gqjv_28",mtt="_spanOutput_1gqjv_32",vtt="_spanPrompt_1gqjv_36",_tt="_spanArrow_1gqjv_40",Cg={divOutputBlocksWrapper:utt,divOutputBlockWrapper:dtt,spanError:htt,spanWarning:ftt,spanSuccess:gtt,spanInput:ptt,spanOutput:mtt,spanPrompt:vtt,spanArrow:_tt},btt=C.memo(({messages:i})=>{const e=xc();return ze("div",{className:Cg.divOutputBlocksWrapper,children:i.map((t,n)=>ze("div",{className:Cg.divOutputBlockWrapper,children:t.map((r,o)=>{const s=e.formatMessage({id:r.key},r.values);return ze("span",{className:De({[Cg.spanError]:r.type===nc.ERROR,[Cg.spanWarning]:r.type===nc.WARNING,[Cg.spanSuccess]:r.type===nc.SUCCESS,[Cg.spanInput]:r.type===nc.INPUT,[Cg.spanOutput]:r.type===nc.OUTPUT,[Cg.spanPrompt]:r.type===nc.PROMPT,[Cg.spanArrow]:r.type===nc.ARROW}),children:s},o)})},n))})}),Ctt=({vmIndex:i})=>{const e=MS(),[t,n]=C.useState(!1),r=Yr(_=>_.vm.vmPageStates[i].consoleInput),o=Yr(_=>_.vm.vmPageStates[i].consoleInputPrompt),s=Yr(_=>_.vm.vmPageStates[i].consoleOutputs),a=C.useRef(null),l=C.useRef({buffer:[],nextInputIndex:0}),c=()=>{l.current.buffer=[],l.current.nextInputIndex=0},u=C.useRef(null),d=C.useRef(null),h=C.useRef(!1),f=jv.at(i);C.useEffect(()=>(f.setReadConsoleFn(_=>{var y;return h.current||e(O1(!0)),e(Qg()),(y=d.current)==null||y.focus(),l.current.nextInputIndex({...S,type:nc.PROMPT})),{key:"READ_INPUT",values:{value:r},type:nc.INPUT}]])),Promise.resolve(l.current.buffer[l.current.nextInputIndex++])):(e(kM(_)),new Promise(S=>{a.current=S}))}),()=>{a.current!==null&&(a.current(""),a.current=null)}),[]),C.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo(0,u.current.scrollHeight)},[r,o,s]);const g=async()=>{var _;if(!f.canContinueExecution){f.state===Zi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}h.current=!0,e(O1(!1)),await f.executeContinuously(),f.state!==Zi.CLOSED&&(c(),e(Qg()))},p=async()=>{var _;if(!f.canContinueExecution){f.state===Zi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}switch(h.current=!1,await f.executeSingleStep(),f.state){case Zi.FREE:e(O1(!0));break;case Zi.EXITED_NORMALLY:case Zi.EXITED_ABNORMALLY:c(),e(O1(!1));break;case Zi.CLOSED:return}e(Qg())},m=()=>{e(O1(!1)),e(kM([])),e(FL("")),e(jX(1)),f.reset(),f.decodeInstructions(!0),a.current!==null&&(a.current(""),a.current=null),c(),e(Qg())},v=()=>{var _;e(UQe()),e(FL("")),f.state===Zi.WAIT_INPUT&&((_=d.current)==null||_.focus())};return Nn("div",{className:RR.divVmConsoleWrapper,tabIndex:0,onKeyDown:_=>{if(!(_.key!=="F2"&&_.key!=="F8"&&_.key!=="F9"&&_.key!=="F10"))switch(_.preventDefault(),_.key){case"F2":g();break;case"F8":p();break;case"F9":m();break;case"F10":v();break}},children:[ze(ctt,{onRunClick:g,onRunStepClick:p,onResetClick:m,onClearClick:v}),Nn("div",{ref:u,className:De(RR.divVmConsole,t&&RR.divVmConsoleBoxShadow),onScroll:_=>{_.currentTarget.scrollTop>0&&!t?n(!0):_.currentTarget.scrollTop<=0&&t&&n(!1)},children:[ze(btt,{messages:s}),ze(ett,{inputRef:d,prompt:o,value:r,onChange:_=>e(FL(_)),onEnter:()=>{if(f.state===Zi.WAIT_INPUT||f.state===Zi.BUSY||f.state===Zi.FREE){const _=tJe(r);l.current.buffer.push(..._),a.current!==null&&l.current.nextInputIndex({..._,type:nc.PROMPT})),{key:"READ_INPUT",values:{value:r},type:nc.INPUT}]])),e(kM([])),e(FL(""))}}),ze("div",{className:RR.divConsoleBlankArea,onClick:()=>{var _;return(_=d.current)==null?void 0:_.focus()}})]})]})},ytt="_divVmInspectorWrapper_1lk9c_1",wtt="_divVmInspectorWrapperBoxShadow_1lk9c_34",Stt="_divStepStateCard_1lk9c_38",xtt="_divStepStateWrapper_1lk9c_49",Ltt="_lblStepStateLabel_1lk9c_55",Ett="_divStepCount_1lk9c_62",Dtt="_divStateBase_1lk9c_68",Itt="_divStateExitedAbnormally_1lk9c_68",ktt="_divStateExitedNormally_1lk9c_68",Ttt="_divStateMaxStepReached_1lk9c_68",Ntt="_divStateRuntimeError_1lk9c_68",Rtt="_divStateStaticCheckFailed_1lk9c_68",Mtt="_divStateFree_1lk9c_68",Ptt="_divStateWaitInput_1lk9c_68",Att="_divStateBusy_1lk9c_68",Ott="_divStateInitial_1lk9c_68",Ftt="_divOptionsCard_1lk9c_109",Btt="_divOptionWrapper_1lk9c_121",Wtt="_lblOption_1lk9c_128",$tt="_iconOptionInfo_1lk9c_133",Htt="_inOptionValue_1lk9c_143",Vtt="_divMemoryUsageCard_1lk9c_147",ztt="_divGlobalVariableTableCard_1lk9c_162",Utt="_divLocalVariableTableCard_1lk9c_178",jtt="_divLocalVariableTableWrapper_1lk9c_198",Ktt="_divLocalVariableTable_1lk9c_178",Gtt="_paginationLocalVariableTable_1lk9c_225",Hi={divVmInspectorWrapper:ytt,divVmInspectorWrapperBoxShadow:wtt,divStepStateCard:Stt,divStepStateWrapper:xtt,lblStepStateLabel:Ltt,divStepCount:Ett,divStateBase:Dtt,divStateExitedAbnormally:Itt,divStateExitedNormally:ktt,divStateMaxStepReached:Ttt,divStateRuntimeError:Ntt,divStateStaticCheckFailed:Rtt,divStateFree:Mtt,divStateWaitInput:Ptt,divStateBusy:Att,divStateInitial:Ott,divOptionsCard:Ftt,divOptionWrapper:Btt,lblOption:Wtt,iconOptionInfo:$tt,inOptionValue:Htt,divMemoryUsageCard:Vtt,divGlobalVariableTableCard:ztt,divLocalVariableTableCard:Utt,divLocalVariableTableWrapper:jtt,divLocalVariableTable:Ktt,paginationLocalVariableTable:Gtt},qtt="_divMemoryUsageWrapper_1rsex_1",Xtt="_divUsageBlock_1rsex_7",Ytt="_progress_1rsex_25",Qx={divMemoryUsageWrapper:qtt,divUsageBlock:Xtt,progress:Ytt},a9=i=>{const e=xc();return Nn("div",{className:Qx.divMemoryUsageWrapper,children:[Nn("div",{className:Qx.divUsageBlock,children:[ze(Ioe,{className:Qx.progress,percent:i.usedBytes/i.totalBytes*100,showInfo:!1,status:"normal"}),Nn("div",{children:[ze("label",{children:i.title}),ze("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.usedBytes/i.totalBytes*100})})]}),ze("span",{children:e.formatMessage({id:"B_USAGE"},{used:i.usedBytes,total:i.totalBytes})}),ze("span",{children:e.formatMessage({id:"KB_USAGE"},{used:i9(i.usedBytes),total:i9(i.totalBytes)})})]}),Nn("div",{className:Qx.divUsageBlock,children:[ze(Ioe,{className:Qx.progress,percent:i.peakBytes/i.totalBytes*100,showInfo:!1,status:"exception"}),Nn("div",{children:[ze("label",{children:e.formatMessage({id:"PEAK_MEMORY_USAGE"})}),ze("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.peakBytes/i.totalBytes*100})})]}),ze("span",{children:e.formatMessage({id:"BYTES"},{bytes:i.peakBytes})}),ze("span",{children:e.formatMessage({id:"KB"},{kb:i9(i.peakBytes)})})]})]})},Ztt="_divVariableTableWrapper_1pgdz_1",Qtt="_divValues_1pgdz_10",Ese={divVariableTableWrapper:Ztt,divValues:Qtt},Dse=C.memo(i=>{const e=xc(),t=[{title:e.formatMessage({id:"VARIABLE_ID"}),dataIndex:"id",showSorterTooltip:!1,sorter:(n,r)=>nJe(n.id,r.id)},{title:e.formatMessage({id:"ADDRESS"}),dataIndex:"address",showSorterTooltip:!1,sorter:(n,r)=>n.address-r.address},{title:e.formatMessage({id:"SIZE"}),dataIndex:"size",showSorterTooltip:!1,sorter:(n,r)=>n.size-r.size},{title:e.formatMessage({id:"VALUES"}),dataIndex:"values",render:n=>ze("div",{className:Ese.divValues,children:n.map((r,o)=>ze("div",{children:n.length===1?r:Nn(nPe,{children:["[",o,"]: ",r]})},`${o}${r}`))})}];return ze("div",{className:Ese.divVariableTableWrapper,children:i.variables.length===0?ze("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):ze(jZe,{rowKey:"id",columns:t,dataSource:i.variables,size:"small",pagination:!1})})});function Jtt(i){switch(i){case Zi.BUSY:return"STATE_BUSY";case Zi.EXITED_ABNORMALLY:return"STATE_EXITED_ABNORMALLY";case Zi.EXITED_NORMALLY:return"STATE_EXITED_NORMALLY";case Zi.FREE:return"STATE_FREE";case Zi.INITIAL:return"STATE_INITIAL";case Zi.MAX_STEP_REACHED:return"STATE_MAX_STEP_REACHED";case Zi.RUNTIME_ERROR:return"STATE_RUNTIME_ERROR";case Zi.STATIC_CHECK_FAILED:return"STATE_STATIC_CHECK_FAILED";case Zi.WAIT_INPUT:return"STATE_WAIT_INPUT"}}const l9=10,ent=({vmIndex:i})=>{const e=xc(),t=MS(),n=Yr(p=>p.vm.vmPageStates[i].state),r=Yr(p=>p.vm.vmPageStates[i].stepCount),o=Yr(p=>p.vm.vmPageStates[i].options),s=Yr(p=>p.vm.vmPageStates[i].memoryUsage),a=Yr(p=>p.vm.vmPageStates[i].peakMemoryUsage),l=Yr(p=>p.vm.vmPageStates[i].globalVariableDetails),c=Yr(p=>p.vm.vmPageStates[i].localVariableDetailsStack),u=Yr(p=>p.vm.vmPageStates[i].localVariableTablePageIndex),[d,h]=C.useState(!1),f=C.useRef(null),g=jv.at(i);return Nn("div",{ref:f,className:De(Hi.divVmInspectorWrapper,d&&Hi.divVmInspectorWrapperBoxShadow),onScroll:p=>{p.currentTarget.scrollTop>0&&!d?h(!0):p.currentTarget.scrollTop<=0&&d&&h(!1)},children:[Nn("div",{className:Hi.divStepStateCard,children:[Nn("div",{className:Hi.divStepStateWrapper,children:[ze("label",{className:Hi.lblStepStateLabel,children:e.formatMessage({id:"STEP_COUNT"})}),ze("div",{className:Hi.divStepCount,children:e.formatMessage({id:"STEP_COUNT_NUMBER"},{stepCount:r})})]}),Nn("div",{className:Hi.divStepStateWrapper,children:[ze("label",{className:Hi.lblStepStateLabel,children:e.formatMessage({id:"STATE"})}),ze("div",{className:De({[Hi.divStateInitial]:n===Zi.INITIAL,[Hi.divStateBusy]:n===Zi.BUSY,[Hi.divStateWaitInput]:n===Zi.WAIT_INPUT,[Hi.divStateFree]:n===Zi.FREE,[Hi.divStateStaticCheckFailed]:n===Zi.STATIC_CHECK_FAILED,[Hi.divStateRuntimeError]:n===Zi.RUNTIME_ERROR,[Hi.divStateMaxStepReached]:n===Zi.MAX_STEP_REACHED,[Hi.divStateExitedNormally]:n===Zi.EXITED_NORMALLY,[Hi.divStateExitedAbnormally]:n===Zi.EXITED_ABNORMALLY}),children:e.formatMessage({id:Jtt(n)})})]})]}),Nn("div",{className:Hi.divOptionsCard,children:[Nn("div",{className:Hi.divOptionWrapper,children:[Nn("label",{className:Hi.lblOption,children:[e.formatMessage({id:"MAX_EXECUTION_STEP_COUNT"}),ze(Qk,{title:e.formatMessage({id:"SET_0_MEANS_NO_STEP_LIMIT"}),children:ze(Vme,{className:Hi.iconOptionInfo})})]}),ze(K6,{className:Hi.inOptionValue,disabled:n!==Zi.INITIAL,min:Hd.maxExecutionStepCount.min,max:Hd.maxExecutionStepCount.max,value:o.maxExecutionStepCount,onChange:p=>{g.configure({maxExecutionStepCount:p??void 0}),t(Qg())}})]}),Nn("div",{className:Hi.divOptionWrapper,children:[ze("label",{className:Hi.lblOption,children:e.formatMessage({id:"MEMORY_SIZE"})}),ze(K6,{className:Hi.inOptionValue,disabled:n!==Zi.INITIAL,min:Hd.memorySize.min,max:Hd.memorySize.max,value:o.memorySize,onChange:p=>{g.configure({memorySize:p??void 0}),t(Qg())}})]}),Nn("div",{className:Hi.divOptionWrapper,children:[ze("label",{className:Hi.lblOption,children:e.formatMessage({id:"STACK_SIZE"})}),ze(K6,{className:Hi.inOptionValue,disabled:n!==Zi.INITIAL,min:Hd.stackSize.min,max:Hd.stackSize.max,value:o.stackSize,onChange:p=>{g.configure({stackSize:p??void 0}),t(Qg())}})]})]}),Nn("div",{className:Hi.divMemoryUsageCard,children:[ze(a9,{title:e.formatMessage({id:"TOTAL_MEMORY_USAGE"}),usedBytes:s.used,totalBytes:s.total,peakBytes:a.total}),ze(a9,{title:e.formatMessage({id:"STACK_MEMORY_USAGE"}),usedBytes:s.stackUsed,totalBytes:s.stackTotal,peakBytes:a.stack}),ze(a9,{title:e.formatMessage({id:"GLOBAL_VARIABLE_MEMORY_USAGE"}),usedBytes:s.globalVariableUsed,totalBytes:s.globalVariableTotal,peakBytes:a.globalVariable})]}),Nn("div",{className:Hi.divGlobalVariableTableCard,children:[ze("label",{className:"title",children:e.formatMessage({id:"GLOBAL_VARIABLE_TABLE"})}),ze(Dse,{variables:l})]}),Nn("div",{className:Hi.divLocalVariableTableCard,children:[ze("label",{className:"title",children:e.formatMessage({id:"LOCAL_VARIABLE_TABLE"})}),c.length===0?ze("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):Nn("div",{className:Hi.divLocalVariableTableWrapper,children:[c.slice(l9*(u-1),l9*u).map(p=>Nn("div",{className:Hi.divLocalVariableTable,children:[Nn("div",{className:"titleWrapper",children:[ze("label",{className:"functionName",children:p.functionName}),Nn("label",{className:"callStackDepth",children:["(",e.formatMessage({id:"CALL_STACK_DEPTH"},{depth:p.stackDepth}),")"]})]}),ze(Dse,{variables:p.details})]},`${p.functionName}${p.stackDepth}`)),ze(kX,{className:Hi.paginationLocalVariableTable,current:u,onChange:p=>t(jX(p)),pageSize:l9,showSizeChanger:!1,total:c.length,size:"small"})]})]})]})},tnt=()=>{const i=xc(),e=MS(),t=Yr(l=>l.vm.vmPageStates.length),n=Yr(l=>l.vm.activeVmIndex),r=Yr(l=>l.vm.vmPageStates.map(c=>c.id),(l,c)=>l.length===c.length&&l.every((u,d)=>u===c[d])),o=Yr(l=>l.vm.vmPageStates.every(c=>!c.isIrChanged)),[s,a]=C.useState(window.innerWidth{window.onresize=()=>a(window.innerWidth{window.onbeforeunload=o?null:l=>(l.preventDefault(),l.returnValue="Your unsaved changes will be lost. Sure to leave?")},[o]),Nn("main",{className:Vx.main,onDragEnter:l=>l.preventDefault(),onDragOver:l=>l.preventDefault(),onDrop:l=>{for(const c of l.dataTransfer.files)_Ce(e,i,c);l.preventDefault()},children:[ze(dJe,{vmIndex:n}),Nn("div",{className:Vx.divRight,children:[ze(IJe,{}),ze("div",{className:Vx.divVmWrapper,children:t===0?ze(AJe,{}):new Array(t).fill(null).map((l,c)=>Nn("div",{className:De({[Vx.divVmContentHorizontal]:!s,[Vx.divVmContentVertical]:s}),style:{display:c===n?"flex":"none"},children:[ze("section",{className:"sectionIrEditor",children:ze(Ket,{vmIndex:c})}),ze("section",{className:"sectionVmConsole",children:ze(Ctt,{vmIndex:c})}),ze("section",{className:"sectionVmInspector",children:ze(ent,{vmIndex:c})})]},r[c]))})]})]})},nnt=m4e([{path:"/",element:ze(tnt,{})}],{basename:"/ir-virtual-machine"});function Wc(i,e=0){return i[i.length-(1+e)]}function int(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function lr(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,r=i.length;nt(i[n],e))}function ont(i,e){let t=0,n=i-1;for(;t<=n;){const r=(t+n)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)n=r-1;else return r}return-(t+1)}function ZH(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,n);l<0?r.push(a):l>0?o.push(a):s.push(a)}return i!!e)}function kse(i){let e=0;for(let t=0;t0}function Ap(i,e=t=>t){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function GX(i,e){return i.length>0?i[0]:e}function ua(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let r=t;re;r--)n.push(r);return n}function n3(i,e,t){const n=i.slice(0,e),r=i.slice(e);return n.concat(t,r)}function c9(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function AR(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function QH(i,e){for(const t of e)i.push(t)}function qX(i){return Array.isArray(i)?i:[i]}function ant(i,e,t){const n=ICe(i,e),r=i.length,o=t.length;i.length=r+o;for(let s=r-1;s>=n;s--)i[s+o]=i[s];for(let s=0;s0}i.isGreaterThan=n;function r(o){return o===0}i.isNeitherLessOrGreaterThan=r,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(eI||(eI={}));function nu(i,e){return(t,n)=>e(i(t),i(n))}function lnt(...i){return(e,t)=>{for(const n of i){const r=n(e,t);if(!eI.isNeitherLessOrGreaterThan(r))return r}return eI.neitherLessOrGreaterThan}}const mp=(i,e)=>i-e,cnt=(i,e)=>mp(i?1:0,e?1:0);function kCe(i){return(e,t)=>-i(e,t)}class Op{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=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Mf{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Mf(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Mf(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||eI.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}}Mf.empty=new Mf(i=>{});function Ea(i){return typeof i=="string"}function ba(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function unt(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Gv(i){return typeof i=="number"&&!isNaN(i)}function Nse(i){return!!i&&typeof i[Symbol.iterator]=="function"}function TCe(i){return i===!0||i===!1}function xl(i){return typeof i>"u"}function Pf(i){return!sc(i)}function sc(i){return xl(i)||i===null}function Yn(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Ym(i){if(sc(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function tI(i){return typeof i=="function"}function dnt(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?Fg(n):n}),e}function fnt(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(NCe.call(t,n)){const r=t[n];typeof r=="object"&&!Object.isFrozen(r)&&!unt(r)&&e.push(r)}}return i}const NCe=Object.prototype.hasOwnProperty;function RCe(i,e){return JH(i,e,new Set)}function JH(i,e,t){if(sc(i))return i;const n=e(i);if(typeof n<"u")return n;if(Array.isArray(i)){const r=[];for(const o of i)r.push(JH(o,e,t));return r}if(ba(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const r={};for(const o in i)NCe.call(i,o)&&(r[o]=JH(i[o],e,t));return t.delete(i),r}return i}function i3(i,e,t=!0){return ba(i)?(ba(e)&&Object.keys(e).forEach(n=>{n in i?t&&(ba(i[n])&&ba(e[n])?i3(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function pc(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},n={};for(const r of i)n[r]=t(r);return n}let mnt=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function MCe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,r)=>{const o=r[0],s=e[o];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),mnt&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(i,e,...t){return MCe(e,t)}function Hn(i,e,...t){const n=MCe(e,t);return{value:n,original:n}}var u9;const cy="en";let EA=!1,DA=!1,MM=!1,PCe=!1,YX=!1,ZX=!1,ACe=!1,OR,PM=cy,Rse=cy,vnt,Ed;const vp=globalThis;let da;typeof vp.vscode<"u"&&typeof vp.vscode.process<"u"?da=vp.vscode.process:typeof process<"u"&&(da=process);const _nt=typeof((u9=da==null?void 0:da.versions)===null||u9===void 0?void 0:u9.electron)=="string",bnt=_nt&&(da==null?void 0:da.type)==="renderer";if(typeof da=="object"){EA=da.platform==="win32",DA=da.platform==="darwin",MM=da.platform==="linux",MM&&da.env.SNAP&&da.env.SNAP_REVISION,da.env.CI||da.env.BUILD_ARTIFACTSTAGINGDIRECTORY,OR=cy,PM=cy;const i=da.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];OR=e.locale,Rse=e.osLocale,PM=t||cy,vnt=e._translationsConfigFile}catch{}PCe=!0}else typeof navigator=="object"&&!bnt?(Ed=navigator.userAgent,EA=Ed.indexOf("Windows")>=0,DA=Ed.indexOf("Macintosh")>=0,ZX=(Ed.indexOf("Macintosh")>=0||Ed.indexOf("iPad")>=0||Ed.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MM=Ed.indexOf("Linux")>=0,ACe=(Ed==null?void 0:Ed.indexOf("Mobi"))>=0,YX=!0,w({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),OR=cy,PM=OR,Rse=navigator.language):console.error("Unable to resolve platform.");const Os=EA,Dn=DA,ka=MM,nh=PCe,k_=YX,Cnt=YX&&typeof vp.importScripts=="function",ynt=Cnt?vp.origin:void 0,fh=ZX,OCe=ACe,zf=Ed,wnt=PM,Snt=typeof vp.postMessage=="function"&&!vp.importScripts,FCe=(()=>{if(Snt){const i=[];vp.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=i.length;n{const n=++e;i.push({id:n,callback:t}),vp.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Ll=DA||ZX?2:EA?1:3;let Mse=!0,Pse=!1;function BCe(){if(!Pse){Pse=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Mse=new Uint16Array(i.buffer)[0]===(2<<8)+1}return Mse}const WCe=!!(zf&&zf.indexOf("Chrome")>=0),xnt=!!(zf&&zf.indexOf("Firefox")>=0),Lnt=!!(!WCe&&zf&&zf.indexOf("Safari")>=0),Ent=!!(zf&&zf.indexOf("Edg/")>=0),Dnt=!!(zf&&zf.indexOf("Android")>=0),Ts={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var In;(function(i){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*r(y){yield y}i.single=r;function o(y){return e(y)?y:r(y)}i.wrap=o;function s(y){return y||t}i.from=s;function*a(y){for(let S=y.length-1;S>=0;S--)yield y[S]}i.reverse=a;function l(y){return!y||y[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(y){return y[Symbol.iterator]().next().value}i.first=c;function u(y,S){for(const L of y)if(S(L))return!0;return!1}i.some=u;function d(y,S){for(const L of y)if(S(L))return L}i.find=d;function*h(y,S){for(const L of y)S(L)&&(yield L)}i.filter=h;function*f(y,S){let L=0;for(const E of y)yield S(E,L++)}i.map=f;function*g(...y){for(const S of y)yield*S}i.concat=g;function p(y,S,L){let E=L;for(const D of y)E=S(E,D);return E}i.reduce=p;function*m(y,S,L=y.length){for(S<0&&(S+=y.length),L<0?L+=y.length:L>y.length&&(L=y.length);S{r||(r=!0,this._remove(n))}}shift(){if(this._first!==oo.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oo.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oo.Undefined&&e.next!==oo.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===oo.Undefined&&e.next===oo.Undefined?(this._first=oo.Undefined,this._last=oo.Undefined):e.next===oo.Undefined?(this._last=this._last.prev,this._last.next=oo.Undefined):e.prev===oo.Undefined&&(this._first=this._first.next,this._first.prev=oo.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oo.Undefined;)yield e.element,e=e.next}}const $Ce="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Int(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of $Ce)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const QX=Int();function JX(i){let e=QX;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const HCe=new Ca;HCe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function nI(i,e,t,n,r){if(e=JX(e),r||(r=In.first(HCe)),t.length>r.maxLen){let c=i-r.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+r.maxLen/2),nI(i,e,t,n,r)}const o=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=knt(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function knt(i,e,t,n){let r;for(;r=i.exec(e);){const o=r.index||0;if(o<=t&&i.lastIndex>=t)return r;if(n>0&&o>n)return null}return null}const ym=8;class VCe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class zCe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class rr{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return r3(e,t)}compute(e,t,n){return n}}class PE{constructor(e,t){this.newValue=e,this.didChange=t}}function r3(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new PE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&lr(i,e);return new PE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const r=r3(i[n],e[n]);r.didChange&&(i[n]=r.newValue,t=!0)}return new PE(i,t)}class lT{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return r3(e,t)}validate(e){return this.defaultValue}}class HS{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return r3(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,n){return n}}function Tt(i,e){return typeof i>"u"?e:i==="false"?!1:!!i}class Wn extends HS{constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=n),super(e,t,n,r)}validate(e){return Tt(e,this.defaultValue)}}function _0(i,e,t,n){if(typeof i>"u")return e;let r=parseInt(i,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(n,r),r|0)}class bi extends HS{static clampedInt(e,t,n,r){return _0(e,t,n,r)}constructor(e,t,n,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=r,s.maximum=o),super(e,t,n,s),this.minimum=r,this.maximum=o}validate(e){return bi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Tnt(i,e,t,n){if(typeof i>"u")return e;const r=Ku.float(i,e);return Ku.clamp(r,t,n)}class Ku extends HS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,r,o){typeof o<"u"&&(o.type="number",o.default=n),super(e,t,n,o),this.validationFn=r}validate(e){return this.validationFn(Ku.float(e,this.defaultValue))}}class ga extends HS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="string",r.default=n),super(e,t,n,r)}validate(e){return ga.string(e,this.defaultValue)}}function yr(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class fr extends HS{constructor(e,t,n,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=n),super(e,t,n,o),this._allowedValues=r}validate(e){return yr(e,this.defaultValue,this._allowedValues)}}class FR extends rr{constructor(e,t,n,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,n,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Nnt(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Rnt extends rr{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("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,n){return n===0?e.accessibilitySupport:n}}class Mnt extends rr{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("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:Tt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Tt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Pnt(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Jo;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Jo||(Jo={}));function Ant(i){switch(i){case"line":return Jo.Line;case"block":return Jo.Block;case"underline":return Jo.Underline;case"line-thin":return Jo.LineThin;case"block-outline":return Jo.BlockOutline;case"underline-thin":return Jo.UnderlineThin}}class Ont extends lT{constructor(){super(141)}compute(e,t,n){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(111)&&r.push("showUnused"),t.get(139)&&r.push("showDeprecated"),r.join(" ")}}class Fnt extends Wn{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class Bnt extends rr{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:w("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:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("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:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Dn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("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:w("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:Tt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":yr(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":yr(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Tt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Tt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Tt(t.loop,this.defaultValue.loop)}}}class ac extends rr{constructor(){super(51,"fontLigatures",ac.OFF,{anyOf:[{type:"boolean",description:w("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:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("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?ac.OFF:e==="true"?ac.ON:e:e?ac.ON:ac.OFF}}ac.OFF='"liga" off, "calt" off';ac.ON='"liga" on, "calt" on';class Gd extends rr{constructor(){super(54,"fontVariations",Gd.OFF,{anyOf:[{type:"boolean",description:w("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:w("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:w("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"?Gd.OFF:e==="true"?Gd.TRANSLATE:e:e?Gd.TRANSLATE:Gd.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Gd.OFF="normal";Gd.TRANSLATE="translate";class Wnt extends lT{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class $nt extends HS{constructor(){super(52,"fontSize",il.fontSize,{type:"number",minimum:6,maximum:100,default:il.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=Ku.float(e,this.defaultValue);return t===0?il.fontSize:Ku.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class ff extends rr{constructor(){super(53,"fontWeight",il.fontWeight,{anyOf:[{type:"number",minimum:ff.MINIMUM_VALUE,maximum:ff.MAXIMUM_VALUE,errorMessage:w("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:ff.SUGGESTION_VALUES}],default:il.fontWeight,description:w("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(bi.clampedInt(e,il.fontWeight,ff.MINIMUM_VALUE,ff.MAXIMUM_VALUE))}}ff.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ff.MINIMUM_VALUE=1;ff.MAXIMUM_VALUE=1e3;class Hnt extends rr{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:w("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:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:w("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:w("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:w("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:w("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:yr(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:yr(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:yr(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:yr(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:yr(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:yr(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ga.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ga.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ga.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ga.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ga.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Vnt extends rr{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:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("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:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),delay:bi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Tt(t.sticky,this.defaultValue.sticky),hidingDelay:bi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Tt(t.above,this.defaultValue.above)}}}class Gy extends lT{constructor(){super(144)}compute(e,t,n){return Gy.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,n=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,r=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,v=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,S=d?2:3;let L=Math.floor(o*r);const E=L/o;let D=!1,k=!1,T=S*h,M=h/o,P=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:U,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:ie,desiredRatio:Y,minimapLineCount:J}=Gy.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(v/J>1)D=!0,k=!0,h=1,T=1,M=h/o;else{let he=!1,ge=h+1;if(g==="fit"){const ye=Math.ceil((j+v+ie)*T);y&&a&&_<=t.stableFitRemainingWidth?(he=!0,ge=t.stableFitMaxMinimapScale):he=ye>L}if(g==="fill"||he){D=!0;const ye=h;T=Math.min(l*o,Math.max(1,Math.floor(1/Y))),y&&a&&_<=t.stableFitRemainingWidth&&(ge=t.stableFitMaxMinimapScale),h=Math.min(ge,Math.max(1,Math.floor(T/S))),h>ye&&(P=Math.min(2,h/ye)),M=h/o/P,L=Math.ceil(Math.max(U,j+v+ie)*T),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const N=Math.floor(f*M),R=Math.min(N,Math.max(0,Math.floor((_-m-2)*M/(c+M)))+ym);let O=Math.floor(o*R);const B=O/o;O=Math.floor(O*P);const $=d?1:2,G=p==="left"?0:n-R-m;return{renderMinimap:$,minimapLeft:G,minimapWidth:R,minimapHeightIsEditorHeight:D,minimapIsSampling:k,minimapScale:h,minimapLineHeight:T,minimapCanvasInnerWidth:O,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const n=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(136),h=d==="inherit"?e.get(135):d,f=h==="inherit"?e.get(131):h,g=e.get(134),p=t.isDominatedByLongLines,m=e.get(57),v=e.get(68).renderType!==0,_=e.get(69),y=e.get(105),S=e.get(84),L=e.get(73),E=e.get(103),D=E.verticalScrollbarSize,k=E.verticalHasArrows,T=E.arrowSize,M=E.horizontalScrollbarSize,P=e.get(43),N=e.get(110)!=="never";let R=e.get(66);P&&N&&(R+=16);let O=0;if(v){const Ge=Math.max(s,_);O=Math.round(Ge*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let $=0,G=$+B,U=G+O,j=U+R;const ie=n-B-O-R;let Y=!1,J=!1,Q=-1;h==="inherit"&&p?(Y=!0,J=!0):f==="on"||f==="bounded"?J=!0:f==="wordWrapColumn"&&(Q=g);const he=Gy._computeMinimapLayout({outerWidth:n,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:S.top,paddingBottom:S.bottom,minimap:L,verticalScrollbarWidth:D,viewLineCount:u,remainingWidth:ie,isViewportWrapping:J},t.memory||new zCe);he.renderMinimap!==0&&he.minimapLeft===0&&($+=he.minimapWidth,G+=he.minimapWidth,U+=he.minimapWidth,j+=he.minimapWidth);const ge=ie-he.minimapWidth,ye=Math.max(1,Math.floor((ge-D-2)/a)),be=k?T:0;return J&&(Q=Math.max(1,ye),f==="bounded"&&(Q=Math.min(Q,g))),{width:n,height:r,glyphMarginLeft:$,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:G,lineNumbersWidth:O,decorationsLeft:U,decorationsWidth:R,contentLeft:j,contentWidth:ge,minimap:he,viewportColumn:ye,isWordWrapMinified:Y,isViewportWrapping:J,wrappingColumn:Q,verticalScrollbarWidth:D,horizontalScrollbarHeight:M,overviewRuler:{top:be,width:D,height:r-2*be,right:0}}}}class znt extends rr{constructor(){super(138,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("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."),w("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:w("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 yr(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}var $u;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})($u||($u={}));class Unt extends rr{constructor(){const e={enabled:$u.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[$u.Off,$u.OnCode,$u.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:yr(e.enabled,this.defaultValue.enabled,[$u.Off,$u.OnCode,$u.On])}}}class jnt extends rr{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("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:w("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:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),maxLineCount:bi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:yr(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Tt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Knt extends rr{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(140,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Dn?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Dn?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("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:w("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:w("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:yr(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:bi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily),padding:Tt(t.padding,this.defaultValue.padding)}}}class Gnt extends rr{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):bi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?bi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class qnt extends Ku{constructor(){super(67,"lineHeight",il.lineHeight,e=>Ku.clamp(e,0,150),{markdownDescription:w("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,n){return e.fontInfo.lineHeight}}class Xnt extends ir{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:w("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:w("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[w("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),w("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),w("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:w("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:w("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:w("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:w("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:w("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:w("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Tt(t.enabled,this.defaultValue.enabled),autohide:Tt(t.autohide,this.defaultValue.autohide),size:yr(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:yr(t.side,this.defaultValue.side,["right","left"]),showSlider:yr(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Tt(t.renderCharacters,this.defaultValue.renderCharacters),scale:bi.clampedInt(t.scale,1,1,3),maxColumn:bi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Ynt(i){return i==="ctrlCmd"?Dn?"metaKey":"ctrlKey":"altKey"}class Znt extends ir{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:w("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:w("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:bi.clampedInt(t.top,0,0,1e3),bottom:bi.clampedInt(t.bottom,0,0,1e3)}}}class Qnt extends ir{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),cycle:Tt(t.cycle,this.defaultValue.cycle)}}}class Jnt extends lT{constructor(){super(142)}compute(e,t,n){return e.pixelRatio}}class eit extends ir{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[w("on","Quick suggestions show inside the suggest widget"),w("inline","Quick suggestions show as ghost text"),w("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:w("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:w("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:w("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:w("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:n,strings:r}=e,o=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=yr(t,this.defaultValue.other,o),typeof n=="boolean"?a=n?"on":"off":a=yr(n,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=yr(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class tit extends ir{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[w("lineNumbers.off","Line numbers are not rendered."),w("lineNumbers.on","Line numbers are rendered as absolute number."),w("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),w("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:w("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function IA(i){const e=i.get(98);return e==="editable"?i.get(91):e!=="on"}class nit extends ir{constructor(){const e=[],t={type:"number",description:w("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:w("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:w("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 n of e)if(typeof n=="number")t.push({column:bi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const r=n;t.push({column:bi.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((n,r)=>n.column-r.column),t}return this.defaultValue}}class iit extends ir{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Ase(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}let rit=class extends ir{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(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),w("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),w("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),w("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),w("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:w("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:w("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:w("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:w("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,n=bi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=bi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:bi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Ase(t.vertical,this.defaultValue.vertical),horizontal:Ase(t.horizontal,this.defaultValue.horizontal),useShadows:Tt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Tt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Tt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Tt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Tt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:bi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:bi.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Tt(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Tt(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Yl="inUntrustedWorkspace",Za={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 oit extends ir{constructor(){const e={nonBasicASCII:Yl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Yl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[Za.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.nonBasicASCII,description:w("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.")},[Za.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:w("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Za.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:w("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.")},[Za.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.includeComments,description:w("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Za.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.includeStrings,description:w("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Za.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:w("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Za.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:w("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(pc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(pc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));const r=super.applyUpdate(e,t);return n?new PE(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:qy(t.nonBasicASCII,Yl,[!0,!1,Yl]),invisibleCharacters:Tt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Tt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:qy(t.includeComments,Yl,[!0,!1,Yl]),includeStrings:qy(t.includeStrings,Yl,[!0,!1,Yl]),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 n={};for(const[r,o]of Object.entries(e))o===!0&&(n[r]=!0);return n}}class sit extends ir{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:w("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:[w("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),w("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),w("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:w("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),mode:yr(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:yr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Tt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Tt(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily)}}}class ait extends ir{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:w("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[w("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),w("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),w("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:w("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:w("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Tt(t.enabled,this.defaultValue.enabled),showToolbar:yr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:Tt(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:Tt(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class lit extends ir{constructor(){const e={enabled:Ts.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ts.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Tt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class cit extends ir{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:[w("editor.guides.bracketPairs.true","Enables bracket pair guides."),w("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),w("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:w("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[w("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),w("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),w("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:w("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:w("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:w("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[w("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),w("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),w("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:w("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:qy(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:qy(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Tt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Tt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:qy(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function qy(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class uit extends ir{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(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[w("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),w("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:w("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:w("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:w("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:w("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:[w("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),w("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:w("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:w("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:w("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:w("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:w("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:w("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:w("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:w("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:w("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:w("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:w("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:yr(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Tt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Tt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Tt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Tt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:yr(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Tt(t.showIcons,this.defaultValue.showIcons),showStatusBar:Tt(t.showStatusBar,this.defaultValue.showStatusBar),preview:Tt(t.preview,this.defaultValue.preview),previewMode:yr(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Tt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Tt(t.showMethods,this.defaultValue.showMethods),showFunctions:Tt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Tt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Tt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Tt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Tt(t.showFields,this.defaultValue.showFields),showVariables:Tt(t.showVariables,this.defaultValue.showVariables),showClasses:Tt(t.showClasses,this.defaultValue.showClasses),showStructs:Tt(t.showStructs,this.defaultValue.showStructs),showInterfaces:Tt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Tt(t.showModules,this.defaultValue.showModules),showProperties:Tt(t.showProperties,this.defaultValue.showProperties),showEvents:Tt(t.showEvents,this.defaultValue.showEvents),showOperators:Tt(t.showOperators,this.defaultValue.showOperators),showUnits:Tt(t.showUnits,this.defaultValue.showUnits),showValues:Tt(t.showValues,this.defaultValue.showValues),showConstants:Tt(t.showConstants,this.defaultValue.showConstants),showEnums:Tt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Tt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Tt(t.showKeywords,this.defaultValue.showKeywords),showWords:Tt(t.showWords,this.defaultValue.showWords),showColors:Tt(t.showColors,this.defaultValue.showColors),showFiles:Tt(t.showFiles,this.defaultValue.showFiles),showReferences:Tt(t.showReferences,this.defaultValue.showReferences),showFolders:Tt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Tt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Tt(t.showSnippets,this.defaultValue.showSnippets),showUsers:Tt(t.showUsers,this.defaultValue.showUsers),showIssues:Tt(t.showIssues,this.defaultValue.showIssues)}}}class dit extends ir{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:w("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:w("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:Tt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Tt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class hit extends ir{constructor(){super(137,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[w("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),w("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),w("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),w("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:w("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,n){return t.get(2)===2?0:n}}class fit extends lT{constructor(){super(145)}compute(e,t,n){const r=t.get(144);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class git extends ir{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("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:w("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:[w("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),w("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:Tt(t.enabled,this.defaultValue.enabled),showDropSelector:yr(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class pit extends ir{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:w("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:[w("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),w("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:Tt(t.enabled,this.defaultValue.enabled),showPasteSelector:yr(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const mit="Consolas, 'Courier New', monospace",vit="Menlo, Monaco, 'Courier New', monospace",_it="'Droid Sans Mono', 'monospace', monospace",il={fontFamily:Dn?vit:ka?_it:mit,fontWeight:"normal",fontSize:Dn?12:14,lineHeight:0,letterSpacing:0},uy=[];function Ze(i){return uy[i.id]=i,i}const kh={acceptSuggestionOnCommitCharacter:Ze(new Wn(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:w("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:Ze(new fr(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",w("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:w("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:Ze(new Rnt),accessibilityPageSize:Ze(new bi(3,"accessibilityPageSize",10,1,1073741824,{description:w("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:Ze(new ga(4,"ariaLabel",w("editorViewAccessibleLabel","Editor content"))),ariaRequired:Ze(new Wn(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ze(new Wn(8,"screenReaderAnnounceInlineSuggestion",!0,{description:w("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ze(new fr(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),w("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:w("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Ze(new fr(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),w("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:w("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Ze(new fr(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Ze(new fr(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Ze(new fr(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),w("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:w("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Ze(new FR(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Nnt,{enumDescriptions:[w("editor.autoIndent.none","The editor will not insert indentation automatically."),w("editor.autoIndent.keep","The editor will keep the current line's indentation."),w("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),w("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),w("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:w("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Ze(new Wn(13,"automaticLayout",!1)),autoSurround:Ze(new fr(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[w("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),w("editor.autoSurround.quotes","Surround with quotes but not brackets."),w("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:w("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Ze(new lit),bracketPairGuides:Ze(new cit),stickyTabStops:Ze(new Wn(116,"stickyTabStops",!1,{description:w("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Ze(new Wn(17,"codeLens",!0,{description:w("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ze(new ga(18,"codeLensFontFamily","",{description:w("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Ze(new bi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:w("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Ze(new Wn(20,"colorDecorators",!0,{description:w("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ze(new fr(147,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[w("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),w("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),w("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:w("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Ze(new bi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:w("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Ze(new Wn(22,"columnSelection",!1,{description:w("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ze(new Mnt),contextmenu:Ze(new Wn(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Ze(new Wn(25,"copyWithSyntaxHighlighting",!0,{description:w("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ze(new FR(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Pnt,{description:w("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ze(new fr(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[w("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),w("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),w("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:w("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Ze(new FR(28,"cursorStyle",Jo.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Ant,{description:w("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Ze(new bi(29,"cursorSurroundingLines",0,0,1073741824,{description:w("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:Ze(new fr(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[w("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),w("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:w("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Ze(new bi(31,"cursorWidth",0,0,1073741824,{markdownDescription:w("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ze(new Wn(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ze(new Wn(33,"disableMonospaceOptimizations",!1)),domReadOnly:Ze(new Wn(34,"domReadOnly",!1)),dragAndDrop:Ze(new Wn(35,"dragAndDrop",!0,{description:w("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ze(new Fnt),dropIntoEditor:Ze(new git),stickyScroll:Ze(new jnt),experimentalWhitespaceRendering:Ze(new fr(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[w("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),w("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),w("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:w("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Ze(new ga(39,"extraEditorClassName","")),fastScrollSensitivity:Ze(new Ku(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:w("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Ze(new Bnt),fixedOverflowWidgets:Ze(new Wn(42,"fixedOverflowWidgets",!1)),folding:Ze(new Wn(43,"folding",!0,{description:w("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Ze(new fr(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[w("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),w("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:w("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Ze(new Wn(45,"foldingHighlight",!0,{description:w("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ze(new Wn(46,"foldingImportsByDefault",!1,{description:w("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ze(new bi(47,"foldingMaximumRegions",5e3,10,65e3,{description:w("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:Ze(new Wn(48,"unfoldOnClickAfterEndOfLine",!1,{description:w("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ze(new ga(49,"fontFamily",il.fontFamily,{description:w("fontFamily","Controls the font family.")})),fontInfo:Ze(new Wnt),fontLigatures2:Ze(new ac),fontSize:Ze(new $nt),fontWeight:Ze(new ff),fontVariations:Ze(new Gd),formatOnPaste:Ze(new Wn(55,"formatOnPaste",!1,{description:w("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:Ze(new Wn(56,"formatOnType",!1,{description:w("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ze(new Wn(57,"glyphMargin",!0,{description:w("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Ze(new Hnt),hideCursorInOverviewRuler:Ze(new Wn(59,"hideCursorInOverviewRuler",!1,{description:w("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ze(new Vnt),inDiffEditor:Ze(new Wn(61,"inDiffEditor",!1)),letterSpacing:Ze(new Ku(64,"letterSpacing",il.letterSpacing,i=>Ku.clamp(i,-5,20),{description:w("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Ze(new Unt),lineDecorationsWidth:Ze(new Gnt),lineHeight:Ze(new qnt),lineNumbers:Ze(new tit),lineNumbersMinChars:Ze(new bi(69,"lineNumbersMinChars",5,1,300)),linkedEditing:Ze(new Wn(70,"linkedEditing",!1,{description:w("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Ze(new Wn(71,"links",!0,{description:w("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ze(new fr(72,"matchBrackets","always",["always","near","never"],{description:w("matchBrackets","Highlight matching brackets.")})),minimap:Ze(new Xnt),mouseStyle:Ze(new fr(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ze(new Ku(75,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:w("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Ze(new Wn(76,"mouseWheelZoom",!1,{markdownDescription:Dn?w("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):w("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Ze(new Wn(77,"multiCursorMergeOverlapping",!0,{description:w("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ze(new FR(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Ynt,{markdownEnumDescriptions:[w("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:w({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:Ze(new fr(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[w("multiCursorPaste.spread","Each cursor pastes a single line of the text."),w("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:w("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Ze(new bi(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:w("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Ze(new fr(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[w("occurrencesHighlight.off","Does not highlight occurrences."),w("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),w("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:w("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Ze(new Wn(82,"overviewRulerBorder",!0,{description:w("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ze(new bi(83,"overviewRulerLanes",3,0,3)),padding:Ze(new Znt),pasteAs:Ze(new pit),parameterHints:Ze(new Qnt),peekWidgetDefaultFocus:Ze(new fr(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[w("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),w("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:w("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Ze(new Wn(88,"definitionLinkOpensInPeek",!1,{description:w("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ze(new eit),quickSuggestionsDelay:Ze(new bi(90,"quickSuggestionsDelay",10,0,1073741824,{description:w("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ze(new Wn(91,"readOnly",!1)),readOnlyMessage:Ze(new iit),renameOnType:Ze(new Wn(93,"renameOnType",!1,{description:w("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:w("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ze(new Wn(94,"renderControlCharacters",!0,{description:w("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ze(new fr(95,"renderFinalNewline",ka?"dimmed":"on",["off","on","dimmed"],{description:w("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Ze(new fr(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",w("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:w("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Ze(new Wn(97,"renderLineHighlightOnlyWhenFocus",!1,{description:w("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ze(new fr(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ze(new fr(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",w("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),w("renderWhitespace.selection","Render whitespace characters only on selected text."),w("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:w("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Ze(new bi(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ze(new Wn(101,"roundedSelection",!0,{description:w("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Ze(new nit),scrollbar:Ze(new rit),scrollBeyondLastColumn:Ze(new bi(104,"scrollBeyondLastColumn",4,0,1073741824,{description:w("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ze(new Wn(105,"scrollBeyondLastLine",!0,{description:w("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ze(new Wn(106,"scrollPredominantAxis",!0,{description:w("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:Ze(new Wn(107,"selectionClipboard",!0,{description:w("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:ka})),selectionHighlight:Ze(new Wn(108,"selectionHighlight",!0,{description:w("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ze(new Wn(109,"selectOnLineNumbers",!0)),showFoldingControls:Ze(new fr(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[w("showFoldingControls.always","Always show the folding controls."),w("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),w("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:w("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Ze(new Wn(111,"showUnused",!0,{description:w("showUnused","Controls fading out of unused code.")})),showDeprecated:Ze(new Wn(139,"showDeprecated",!0,{description:w("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Ze(new Knt),snippetSuggestions:Ze(new fr(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[w("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),w("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),w("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),w("snippetSuggestions.none","Do not show snippet suggestions.")],description:w("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Ze(new dit),smoothScrolling:Ze(new Wn(114,"smoothScrolling",!1,{description:w("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ze(new bi(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Ze(new uit),inlineSuggest:Ze(new sit),inlineEdit:Ze(new ait),inlineCompletionsAccessibilityVerbose:Ze(new Wn(148,"inlineCompletionsAccessibilityVerbose",!1,{description:w("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Ze(new bi(119,"suggestFontSize",0,0,1e3,{markdownDescription:w("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Ze(new bi(120,"suggestLineHeight",0,0,1e3,{markdownDescription:w("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:Ze(new Wn(121,"suggestOnTriggerCharacters",!0,{description:w("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ze(new fr(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[w("suggestSelection.first","Always select the first suggestion."),w("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),w("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:w("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Ze(new fr(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[w("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),w("tabCompletion.off","Disable tab completions."),w("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:w("tabCompletion","Enables tab completions.")})),tabIndex:Ze(new bi(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:Ze(new oit),unusualLineTerminators:Ze(new fr(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[w("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),w("unusualLineTerminators.off","Unusual line terminators are ignored."),w("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:w("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Ze(new Wn(127,"useShadowDOM",!0)),useTabStops:Ze(new Wn(128,"useTabStops",!0,{description:w("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Ze(new fr(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[w("wordBreak.normal","Use the default line break rule."),w("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:w("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Ze(new ga(130,"wordSeparators",$Ce,{description:w("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ze(new fr(131,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),w({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:w({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:Ze(new ga(132,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ze(new ga(133,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ze(new bi(134,"wordWrapColumn",80,1,1073741824,{markdownDescription:w({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:Ze(new fr(135,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ze(new fr(136,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ze(new Ont),defaultColorDecorators:Ze(new Wn(146,"defaultColorDecorators",!1,{markdownDescription:w("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ze(new Jnt),tabFocusMode:Ze(new Wn(143,"tabFocusMode",!1,{markdownDescription:w("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ze(new Gy),wrappingInfo:Ze(new fit),wrappingIndent:Ze(new hit),wrappingStrategy:Ze(new znt)};class bit{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Hw.isErrorNoTelemetry(e)?new Hw(e.message+` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class Xnt extends rr{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:w("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:w("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[w("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),w("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),w("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:w("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:w("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:w("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:w("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:w("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:w("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Tt(t.enabled,this.defaultValue.enabled),autohide:Tt(t.autohide,this.defaultValue.autohide),size:yr(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:yr(t.side,this.defaultValue.side,["right","left"]),showSlider:yr(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Tt(t.renderCharacters,this.defaultValue.renderCharacters),scale:bi.clampedInt(t.scale,1,1,3),maxColumn:bi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Ynt(i){return i==="ctrlCmd"?Dn?"metaKey":"ctrlKey":"altKey"}class Znt extends rr{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:w("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:w("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:bi.clampedInt(t.top,0,0,1e3),bottom:bi.clampedInt(t.bottom,0,0,1e3)}}}class Qnt extends rr{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),cycle:Tt(t.cycle,this.defaultValue.cycle)}}}class Jnt extends lT{constructor(){super(142)}compute(e,t,n){return e.pixelRatio}}class eit extends rr{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[w("on","Quick suggestions show inside the suggest widget"),w("inline","Quick suggestions show as ghost text"),w("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:w("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:w("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:w("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:w("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:n,strings:r}=e,o=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=yr(t,this.defaultValue.other,o),typeof n=="boolean"?a=n?"on":"off":a=yr(n,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=yr(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class tit extends rr{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[w("lineNumbers.off","Line numbers are not rendered."),w("lineNumbers.on","Line numbers are rendered as absolute number."),w("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),w("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:w("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function IA(i){const e=i.get(98);return e==="editable"?i.get(91):e!=="on"}class nit extends rr{constructor(){const e=[],t={type:"number",description:w("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:w("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:w("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 n of e)if(typeof n=="number")t.push({column:bi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const r=n;t.push({column:bi.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((n,r)=>n.column-r.column),t}return this.defaultValue}}class iit extends rr{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Ase(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}let rit=class extends rr{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(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),w("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),w("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),w("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),w("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:w("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:w("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:w("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:w("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,n=bi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=bi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:bi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Ase(t.vertical,this.defaultValue.vertical),horizontal:Ase(t.horizontal,this.defaultValue.horizontal),useShadows:Tt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Tt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Tt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Tt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Tt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:bi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:bi.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Tt(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Tt(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Yl="inUntrustedWorkspace",Za={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 oit extends rr{constructor(){const e={nonBasicASCII:Yl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Yl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[Za.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.nonBasicASCII,description:w("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.")},[Za.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:w("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Za.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:w("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.")},[Za.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.includeComments,description:w("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Za.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Yl],default:e.includeStrings,description:w("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Za.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:w("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Za.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:w("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(pc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(pc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));const r=super.applyUpdate(e,t);return n?new PE(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:qy(t.nonBasicASCII,Yl,[!0,!1,Yl]),invisibleCharacters:Tt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Tt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:qy(t.includeComments,Yl,[!0,!1,Yl]),includeStrings:qy(t.includeStrings,Yl,[!0,!1,Yl]),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 n={};for(const[r,o]of Object.entries(e))o===!0&&(n[r]=!0);return n}}class sit extends rr{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:w("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:[w("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),w("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),w("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:w("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),mode:yr(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:yr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Tt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Tt(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily)}}}class ait extends rr{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:w("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[w("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),w("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),w("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:w("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:w("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Tt(t.enabled,this.defaultValue.enabled),showToolbar:yr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:ga.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:Tt(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:Tt(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class lit extends rr{constructor(){const e={enabled:Ts.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ts.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("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:w("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:Tt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Tt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class cit extends rr{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:[w("editor.guides.bracketPairs.true","Enables bracket pair guides."),w("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),w("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:w("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[w("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),w("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),w("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:w("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:w("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:w("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[w("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),w("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),w("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:w("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:qy(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:qy(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Tt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Tt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:qy(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function qy(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class uit extends rr{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(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[w("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),w("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:w("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:w("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:w("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:w("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:[w("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),w("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:w("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:w("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:w("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:w("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:w("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:w("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:w("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:w("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:w("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:w("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:w("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:yr(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Tt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Tt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Tt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Tt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:yr(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Tt(t.showIcons,this.defaultValue.showIcons),showStatusBar:Tt(t.showStatusBar,this.defaultValue.showStatusBar),preview:Tt(t.preview,this.defaultValue.preview),previewMode:yr(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Tt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Tt(t.showMethods,this.defaultValue.showMethods),showFunctions:Tt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Tt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Tt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Tt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Tt(t.showFields,this.defaultValue.showFields),showVariables:Tt(t.showVariables,this.defaultValue.showVariables),showClasses:Tt(t.showClasses,this.defaultValue.showClasses),showStructs:Tt(t.showStructs,this.defaultValue.showStructs),showInterfaces:Tt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Tt(t.showModules,this.defaultValue.showModules),showProperties:Tt(t.showProperties,this.defaultValue.showProperties),showEvents:Tt(t.showEvents,this.defaultValue.showEvents),showOperators:Tt(t.showOperators,this.defaultValue.showOperators),showUnits:Tt(t.showUnits,this.defaultValue.showUnits),showValues:Tt(t.showValues,this.defaultValue.showValues),showConstants:Tt(t.showConstants,this.defaultValue.showConstants),showEnums:Tt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Tt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Tt(t.showKeywords,this.defaultValue.showKeywords),showWords:Tt(t.showWords,this.defaultValue.showWords),showColors:Tt(t.showColors,this.defaultValue.showColors),showFiles:Tt(t.showFiles,this.defaultValue.showFiles),showReferences:Tt(t.showReferences,this.defaultValue.showReferences),showFolders:Tt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Tt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Tt(t.showSnippets,this.defaultValue.showSnippets),showUsers:Tt(t.showUsers,this.defaultValue.showUsers),showIssues:Tt(t.showIssues,this.defaultValue.showIssues)}}}class dit extends rr{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:w("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:w("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:Tt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Tt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class hit extends rr{constructor(){super(137,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[w("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),w("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),w("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),w("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:w("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,n){return t.get(2)===2?0:n}}class fit extends lT{constructor(){super(145)}compute(e,t,n){const r=t.get(144);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class git extends rr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("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:w("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:[w("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),w("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:Tt(t.enabled,this.defaultValue.enabled),showDropSelector:yr(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class pit extends rr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:w("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:[w("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),w("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:Tt(t.enabled,this.defaultValue.enabled),showPasteSelector:yr(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const mit="Consolas, 'Courier New', monospace",vit="Menlo, Monaco, 'Courier New', monospace",_it="'Droid Sans Mono', 'monospace', monospace",il={fontFamily:Dn?vit:ka?_it:mit,fontWeight:"normal",fontSize:Dn?12:14,lineHeight:0,letterSpacing:0},uy=[];function Ze(i){return uy[i.id]=i,i}const kh={acceptSuggestionOnCommitCharacter:Ze(new Wn(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:w("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:Ze(new fr(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",w("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:w("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:Ze(new Rnt),accessibilityPageSize:Ze(new bi(3,"accessibilityPageSize",10,1,1073741824,{description:w("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:Ze(new ga(4,"ariaLabel",w("editorViewAccessibleLabel","Editor content"))),ariaRequired:Ze(new Wn(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ze(new Wn(8,"screenReaderAnnounceInlineSuggestion",!0,{description:w("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ze(new fr(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),w("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:w("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Ze(new fr(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),w("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:w("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Ze(new fr(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Ze(new fr(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Ze(new fr(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),w("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:w("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Ze(new FR(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Nnt,{enumDescriptions:[w("editor.autoIndent.none","The editor will not insert indentation automatically."),w("editor.autoIndent.keep","The editor will keep the current line's indentation."),w("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),w("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),w("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:w("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Ze(new Wn(13,"automaticLayout",!1)),autoSurround:Ze(new fr(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[w("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),w("editor.autoSurround.quotes","Surround with quotes but not brackets."),w("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:w("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Ze(new lit),bracketPairGuides:Ze(new cit),stickyTabStops:Ze(new Wn(116,"stickyTabStops",!1,{description:w("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Ze(new Wn(17,"codeLens",!0,{description:w("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ze(new ga(18,"codeLensFontFamily","",{description:w("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Ze(new bi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:w("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Ze(new Wn(20,"colorDecorators",!0,{description:w("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ze(new fr(147,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[w("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),w("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),w("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:w("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Ze(new bi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:w("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Ze(new Wn(22,"columnSelection",!1,{description:w("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ze(new Mnt),contextmenu:Ze(new Wn(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Ze(new Wn(25,"copyWithSyntaxHighlighting",!0,{description:w("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ze(new FR(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Pnt,{description:w("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ze(new fr(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[w("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),w("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),w("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:w("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Ze(new FR(28,"cursorStyle",Jo.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Ant,{description:w("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Ze(new bi(29,"cursorSurroundingLines",0,0,1073741824,{description:w("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:Ze(new fr(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[w("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),w("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:w("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Ze(new bi(31,"cursorWidth",0,0,1073741824,{markdownDescription:w("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ze(new Wn(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ze(new Wn(33,"disableMonospaceOptimizations",!1)),domReadOnly:Ze(new Wn(34,"domReadOnly",!1)),dragAndDrop:Ze(new Wn(35,"dragAndDrop",!0,{description:w("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ze(new Fnt),dropIntoEditor:Ze(new git),stickyScroll:Ze(new jnt),experimentalWhitespaceRendering:Ze(new fr(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[w("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),w("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),w("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:w("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Ze(new ga(39,"extraEditorClassName","")),fastScrollSensitivity:Ze(new Ku(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:w("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Ze(new Bnt),fixedOverflowWidgets:Ze(new Wn(42,"fixedOverflowWidgets",!1)),folding:Ze(new Wn(43,"folding",!0,{description:w("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Ze(new fr(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[w("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),w("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:w("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Ze(new Wn(45,"foldingHighlight",!0,{description:w("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ze(new Wn(46,"foldingImportsByDefault",!1,{description:w("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ze(new bi(47,"foldingMaximumRegions",5e3,10,65e3,{description:w("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:Ze(new Wn(48,"unfoldOnClickAfterEndOfLine",!1,{description:w("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ze(new ga(49,"fontFamily",il.fontFamily,{description:w("fontFamily","Controls the font family.")})),fontInfo:Ze(new Wnt),fontLigatures2:Ze(new ac),fontSize:Ze(new $nt),fontWeight:Ze(new ff),fontVariations:Ze(new Gd),formatOnPaste:Ze(new Wn(55,"formatOnPaste",!1,{description:w("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:Ze(new Wn(56,"formatOnType",!1,{description:w("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ze(new Wn(57,"glyphMargin",!0,{description:w("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Ze(new Hnt),hideCursorInOverviewRuler:Ze(new Wn(59,"hideCursorInOverviewRuler",!1,{description:w("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ze(new Vnt),inDiffEditor:Ze(new Wn(61,"inDiffEditor",!1)),letterSpacing:Ze(new Ku(64,"letterSpacing",il.letterSpacing,i=>Ku.clamp(i,-5,20),{description:w("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Ze(new Unt),lineDecorationsWidth:Ze(new Gnt),lineHeight:Ze(new qnt),lineNumbers:Ze(new tit),lineNumbersMinChars:Ze(new bi(69,"lineNumbersMinChars",5,1,300)),linkedEditing:Ze(new Wn(70,"linkedEditing",!1,{description:w("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Ze(new Wn(71,"links",!0,{description:w("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ze(new fr(72,"matchBrackets","always",["always","near","never"],{description:w("matchBrackets","Highlight matching brackets.")})),minimap:Ze(new Xnt),mouseStyle:Ze(new fr(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ze(new Ku(75,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:w("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Ze(new Wn(76,"mouseWheelZoom",!1,{markdownDescription:Dn?w("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):w("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Ze(new Wn(77,"multiCursorMergeOverlapping",!0,{description:w("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ze(new FR(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Ynt,{markdownEnumDescriptions:[w("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:w({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:Ze(new fr(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[w("multiCursorPaste.spread","Each cursor pastes a single line of the text."),w("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:w("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Ze(new bi(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:w("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Ze(new fr(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[w("occurrencesHighlight.off","Does not highlight occurrences."),w("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),w("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:w("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Ze(new Wn(82,"overviewRulerBorder",!0,{description:w("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ze(new bi(83,"overviewRulerLanes",3,0,3)),padding:Ze(new Znt),pasteAs:Ze(new pit),parameterHints:Ze(new Qnt),peekWidgetDefaultFocus:Ze(new fr(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[w("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),w("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:w("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Ze(new Wn(88,"definitionLinkOpensInPeek",!1,{description:w("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ze(new eit),quickSuggestionsDelay:Ze(new bi(90,"quickSuggestionsDelay",10,0,1073741824,{description:w("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ze(new Wn(91,"readOnly",!1)),readOnlyMessage:Ze(new iit),renameOnType:Ze(new Wn(93,"renameOnType",!1,{description:w("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:w("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ze(new Wn(94,"renderControlCharacters",!0,{description:w("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ze(new fr(95,"renderFinalNewline",ka?"dimmed":"on",["off","on","dimmed"],{description:w("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Ze(new fr(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",w("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:w("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Ze(new Wn(97,"renderLineHighlightOnlyWhenFocus",!1,{description:w("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ze(new fr(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ze(new fr(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",w("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),w("renderWhitespace.selection","Render whitespace characters only on selected text."),w("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:w("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Ze(new bi(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ze(new Wn(101,"roundedSelection",!0,{description:w("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Ze(new nit),scrollbar:Ze(new rit),scrollBeyondLastColumn:Ze(new bi(104,"scrollBeyondLastColumn",4,0,1073741824,{description:w("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ze(new Wn(105,"scrollBeyondLastLine",!0,{description:w("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ze(new Wn(106,"scrollPredominantAxis",!0,{description:w("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:Ze(new Wn(107,"selectionClipboard",!0,{description:w("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:ka})),selectionHighlight:Ze(new Wn(108,"selectionHighlight",!0,{description:w("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ze(new Wn(109,"selectOnLineNumbers",!0)),showFoldingControls:Ze(new fr(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[w("showFoldingControls.always","Always show the folding controls."),w("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),w("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:w("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Ze(new Wn(111,"showUnused",!0,{description:w("showUnused","Controls fading out of unused code.")})),showDeprecated:Ze(new Wn(139,"showDeprecated",!0,{description:w("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Ze(new Knt),snippetSuggestions:Ze(new fr(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[w("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),w("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),w("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),w("snippetSuggestions.none","Do not show snippet suggestions.")],description:w("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Ze(new dit),smoothScrolling:Ze(new Wn(114,"smoothScrolling",!1,{description:w("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ze(new bi(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Ze(new uit),inlineSuggest:Ze(new sit),inlineEdit:Ze(new ait),inlineCompletionsAccessibilityVerbose:Ze(new Wn(148,"inlineCompletionsAccessibilityVerbose",!1,{description:w("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Ze(new bi(119,"suggestFontSize",0,0,1e3,{markdownDescription:w("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Ze(new bi(120,"suggestLineHeight",0,0,1e3,{markdownDescription:w("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:Ze(new Wn(121,"suggestOnTriggerCharacters",!0,{description:w("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ze(new fr(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[w("suggestSelection.first","Always select the first suggestion."),w("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),w("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:w("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Ze(new fr(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[w("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),w("tabCompletion.off","Disable tab completions."),w("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:w("tabCompletion","Enables tab completions.")})),tabIndex:Ze(new bi(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:Ze(new oit),unusualLineTerminators:Ze(new fr(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[w("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),w("unusualLineTerminators.off","Unusual line terminators are ignored."),w("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:w("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Ze(new Wn(127,"useShadowDOM",!0)),useTabStops:Ze(new Wn(128,"useTabStops",!0,{description:w("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Ze(new fr(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[w("wordBreak.normal","Use the default line break rule."),w("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:w("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Ze(new ga(130,"wordSeparators",$Ce,{description:w("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ze(new fr(131,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),w({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:w({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:Ze(new ga(132,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ze(new ga(133,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ze(new bi(134,"wordWrapColumn",80,1,1073741824,{markdownDescription:w({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:Ze(new fr(135,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ze(new fr(136,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ze(new Ont),defaultColorDecorators:Ze(new Wn(146,"defaultColorDecorators",!1,{markdownDescription:w("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ze(new Jnt),tabFocusMode:Ze(new Wn(143,"tabFocusMode",!1,{markdownDescription:w("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ze(new Gy),wrappingInfo:Ze(new fit),wrappingIndent:Ze(new hit),wrappingStrategy:Ze(new znt)};class bit{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Hw.isErrorNoTelemetry(e)?new Hw(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 UCe=new bit;function nn(i){Th(i)||UCe.onUnexpectedError(i)}function eo(i){Th(i)||UCe.onUnexpectedExternalError(i)}function Ose(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:Hw.isErrorNoTelemetry(i)}}return i}const kA="Canceled";function Th(i){return i instanceof k_?!0:i instanceof Error&&i.name===kA&&i.message===kA}class k_ extends Error{constructor(){super(kA),this.name=this.message}}function Cit(){const i=new Error(kA);return i.name=i.message,i}function iu(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function eY(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class yit extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Hw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Hw)return e;const t=new Hw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Zi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Zi.prototype)}}function Gv(i,e){const t=this;let n=!1,r;return function(){if(n)return r;if(n=!0,e)try{r=i.apply(t,arguments)}finally{e()}else r=i.apply(t,arguments);return r}}function tY(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(In.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function td(...i){return Ot(()=>si(i))}function Ot(i){return{dispose:Gv(()=>{i()})}}class Fe{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{si(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?Fe.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)}}Fe.DISABLE_DISPOSED_WARNING=!1;class me{constructor(){this._store=new Fe,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)}}me.None=Object.freeze({dispose(){}});class Vo{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class wit{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class Sit{constructor(e){this.object=e}dispose(){}}class nY{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!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),n||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const xit=globalThis.performance&&typeof globalThis.performance.now=="function";class Fs{static create(e){return new Fs(e)}constructor(e){this._now=xit&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ot;(function(i){i.None=()=>me.None;function e(P,N){return d(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,R=null,O)=>{let B=!1,$;return $=P(G=>{if(!B)return $?$.dispose():B=!0,N.call(R,G)},null,O),B&&$.dispose(),$}}i.once=t;function n(P,N,R){return c((O,B=null,$)=>P(G=>O.call(B,N(G)),null,$),R)}i.map=n;function r(P,N,R){return c((O,B=null,$)=>P(G=>{N(G),O.call(B,G)},null,$),R)}i.forEach=r;function o(P,N,R){return c((O,B=null,$)=>P(G=>N(G)&&O.call(B,G),null,$),R)}i.filter=o;function s(P){return P}i.signal=s;function a(...P){return(N,R=null,O)=>{const B=td(...P.map($=>$(G=>N.call(R,G))));return u(B,O)}}i.any=a;function l(P,N,R,O){let B=R;return n(P,$=>(B=N(B,$),B),O)}i.reduce=l;function c(P,N){let R;const O={onWillAddFirstListener(){R=P(B.fire,B)},onDidRemoveLastListener(){R==null||R.dispose()}},B=new ae(O);return N==null||N.add(B),B.event}function u(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function d(P,N,R=100,O=!1,B=!1,$,G){let U,j,ie,Y=0,J;const Q={leakWarningThreshold:$,onWillAddFirstListener(){U=P(ge=>{Y++,j=N(j,ge),O&&!ie&&(he.fire(j),j=void 0),J=()=>{const ye=j;j=void 0,ie=void 0,(!O||Y>1)&&he.fire(ye),Y=0},typeof R=="number"?(clearTimeout(ie),ie=setTimeout(J,R)):ie===void 0&&(ie=0,queueMicrotask(J))})},onWillRemoveListener(){B&&Y>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,U.dispose()}},he=new ae(Q);return G==null||G.add(he),he.event}i.debounce=d;function h(P,N=0,R){return i.debounce(P,(O,B)=>O?(O.push(B),O):[B],N,void 0,!0,void 0,R)}i.accumulate=h;function f(P,N=(O,B)=>O===B,R){let O=!0,B;return o(P,$=>{const G=O||!N($,B);return O=!1,B=$,G},R)}i.latch=f;function g(P,N,R){return[i.filter(P,N,R),i.filter(P,O=>!N(O),R)]}i.split=g;function p(P,N=!1,R=[],O){let B=R.slice(),$=P(j=>{B?B.push(j):U.fire(j)});O&&O.add($);const G=()=>{B==null||B.forEach(j=>U.fire(j)),B=null},U=new ae({onWillAddFirstListener(){$||($=P(j=>U.fire(j)),O&&O.add($))},onDidAddFirstListener(){B&&(N?setTimeout(G):G())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return O&&O.add(U),U.event}i.buffer=p;function m(P,N){return(O,B,$)=>{const G=N(new _);return P(function(U){const j=G.evaluate(U);j!==v&&O.call(B,j)},void 0,$)}}i.chain=m;const v=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(R=>(N(R),R)),this}filter(N){return this.steps.push(R=>N(R)?R:v),this}reduce(N,R){let O=R;return this.steps.push(B=>(O=N(O,B),O)),this}latch(N=(R,O)=>R===O){let R=!0,O;return this.steps.push(B=>{const $=R||!N(B,O);return R=!1,O=B,$?B:v}),this}evaluate(N){for(const R of this.steps)if(N=R(N),N===v)break;return N}}function y(P,N,R=O=>O){const O=(...U)=>G.fire(R(...U)),B=()=>P.on(N,O),$=()=>P.removeListener(N,O),G=new ae({onWillAddFirstListener:B,onDidRemoveLastListener:$});return G.event}i.fromNodeEventEmitter=y;function S(P,N,R=O=>O){const O=(...U)=>G.fire(R(...U)),B=()=>P.addEventListener(N,O),$=()=>P.removeEventListener(N,O),G=new ae({onWillAddFirstListener:B,onDidRemoveLastListener:$});return G.event}i.fromDOMEventEmitter=S;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function E(P){const N=new ae;return P.then(R=>{N.fire(R)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=E;function D(P,N,R){return N(R),P(O=>N(O))}i.runAndSubscribe=D;class k{constructor(N,R){this._observable=N,this._counter=0,this._hasChanged=!1;const O={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new ae(O),R&&R.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,R){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(P,N){return new k(P,N).emitter.event}i.fromObservable=T;function M(P){return(N,R,O)=>{let B=0,$=!1;const G={beginUpdate(){B++},endUpdate(){B--,B===0&&(P.reportChanges(),$&&($=!1,N.call(R)))},handlePossibleChange(){},handleChange(){$=!0}};P.addObserver(G),P.reportChanges();const U={dispose(){P.removeObserver(G)}};return O instanceof Fe?O.add(U):Array.isArray(O)&&O.push(U),U}}i.fromObservableLight=M})(ot||(ot={}));class Vw{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Vw._idPool++}`,Vw.all.add(this)}start(e){this._stopWatch=new Fs,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}}}Vw.all=new Set;Vw._idPool=0;let Lit=-1;class Eit{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class iY{static create(){var e;return new iY((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+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 UCe=new bit;function nn(i){Th(i)||UCe.onUnexpectedError(i)}function eo(i){Th(i)||UCe.onUnexpectedExternalError(i)}function Ose(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:Hw.isErrorNoTelemetry(i)}}return i}const kA="Canceled";function Th(i){return i instanceof T_?!0:i instanceof Error&&i.name===kA&&i.message===kA}class T_ extends Error{constructor(){super(kA),this.name=this.message}}function Cit(){const i=new Error(kA);return i.name=i.message,i}function iu(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function eY(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class yit extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Hw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Hw)return e;const t=new Hw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Qi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Qi.prototype)}}function qv(i,e){const t=this;let n=!1,r;return function(){if(n)return r;if(n=!0,e)try{r=i.apply(t,arguments)}finally{e()}else r=i.apply(t,arguments);return r}}function tY(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(In.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function td(...i){return Ot(()=>si(i))}function Ot(i){return{dispose:qv(()=>{i()})}}class Fe{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{si(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?Fe.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)}}Fe.DISABLE_DISPOSED_WARNING=!1;class me{constructor(){this._store=new Fe,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)}}me.None=Object.freeze({dispose(){}});class Vo{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class wit{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class Sit{constructor(e){this.object=e}dispose(){}}class nY{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!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),n||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const xit=globalThis.performance&&typeof globalThis.performance.now=="function";class Fs{static create(e){return new Fs(e)}constructor(e){this._now=xit&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ot;(function(i){i.None=()=>me.None;function e(P,N){return d(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,R=null,O)=>{let B=!1,$;return $=P(G=>{if(!B)return $?$.dispose():B=!0,N.call(R,G)},null,O),B&&$.dispose(),$}}i.once=t;function n(P,N,R){return c((O,B=null,$)=>P(G=>O.call(B,N(G)),null,$),R)}i.map=n;function r(P,N,R){return c((O,B=null,$)=>P(G=>{N(G),O.call(B,G)},null,$),R)}i.forEach=r;function o(P,N,R){return c((O,B=null,$)=>P(G=>N(G)&&O.call(B,G),null,$),R)}i.filter=o;function s(P){return P}i.signal=s;function a(...P){return(N,R=null,O)=>{const B=td(...P.map($=>$(G=>N.call(R,G))));return u(B,O)}}i.any=a;function l(P,N,R,O){let B=R;return n(P,$=>(B=N(B,$),B),O)}i.reduce=l;function c(P,N){let R;const O={onWillAddFirstListener(){R=P(B.fire,B)},onDidRemoveLastListener(){R==null||R.dispose()}},B=new ae(O);return N==null||N.add(B),B.event}function u(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function d(P,N,R=100,O=!1,B=!1,$,G){let U,j,ie,Y=0,J;const Q={leakWarningThreshold:$,onWillAddFirstListener(){U=P(ge=>{Y++,j=N(j,ge),O&&!ie&&(he.fire(j),j=void 0),J=()=>{const ye=j;j=void 0,ie=void 0,(!O||Y>1)&&he.fire(ye),Y=0},typeof R=="number"?(clearTimeout(ie),ie=setTimeout(J,R)):ie===void 0&&(ie=0,queueMicrotask(J))})},onWillRemoveListener(){B&&Y>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,U.dispose()}},he=new ae(Q);return G==null||G.add(he),he.event}i.debounce=d;function h(P,N=0,R){return i.debounce(P,(O,B)=>O?(O.push(B),O):[B],N,void 0,!0,void 0,R)}i.accumulate=h;function f(P,N=(O,B)=>O===B,R){let O=!0,B;return o(P,$=>{const G=O||!N($,B);return O=!1,B=$,G},R)}i.latch=f;function g(P,N,R){return[i.filter(P,N,R),i.filter(P,O=>!N(O),R)]}i.split=g;function p(P,N=!1,R=[],O){let B=R.slice(),$=P(j=>{B?B.push(j):U.fire(j)});O&&O.add($);const G=()=>{B==null||B.forEach(j=>U.fire(j)),B=null},U=new ae({onWillAddFirstListener(){$||($=P(j=>U.fire(j)),O&&O.add($))},onDidAddFirstListener(){B&&(N?setTimeout(G):G())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return O&&O.add(U),U.event}i.buffer=p;function m(P,N){return(O,B,$)=>{const G=N(new _);return P(function(U){const j=G.evaluate(U);j!==v&&O.call(B,j)},void 0,$)}}i.chain=m;const v=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(R=>(N(R),R)),this}filter(N){return this.steps.push(R=>N(R)?R:v),this}reduce(N,R){let O=R;return this.steps.push(B=>(O=N(O,B),O)),this}latch(N=(R,O)=>R===O){let R=!0,O;return this.steps.push(B=>{const $=R||!N(B,O);return R=!1,O=B,$?B:v}),this}evaluate(N){for(const R of this.steps)if(N=R(N),N===v)break;return N}}function y(P,N,R=O=>O){const O=(...U)=>G.fire(R(...U)),B=()=>P.on(N,O),$=()=>P.removeListener(N,O),G=new ae({onWillAddFirstListener:B,onDidRemoveLastListener:$});return G.event}i.fromNodeEventEmitter=y;function S(P,N,R=O=>O){const O=(...U)=>G.fire(R(...U)),B=()=>P.addEventListener(N,O),$=()=>P.removeEventListener(N,O),G=new ae({onWillAddFirstListener:B,onDidRemoveLastListener:$});return G.event}i.fromDOMEventEmitter=S;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function E(P){const N=new ae;return P.then(R=>{N.fire(R)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=E;function D(P,N,R){return N(R),P(O=>N(O))}i.runAndSubscribe=D;class k{constructor(N,R){this._observable=N,this._counter=0,this._hasChanged=!1;const O={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new ae(O),R&&R.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,R){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(P,N){return new k(P,N).emitter.event}i.fromObservable=T;function M(P){return(N,R,O)=>{let B=0,$=!1;const G={beginUpdate(){B++},endUpdate(){B--,B===0&&(P.reportChanges(),$&&($=!1,N.call(R)))},handlePossibleChange(){},handleChange(){$=!0}};P.addObserver(G),P.reportChanges();const U={dispose(){P.removeObserver(G)}};return O instanceof Fe?O.add(U):Array.isArray(O)&&O.push(U),U}}i.fromObservableLight=M})(ot||(ot={}));class Vw{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Vw._idPool++}`,Vw.all.add(this)}start(e){this._stopWatch=new Fs,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}}}Vw.all=new Set;Vw._idPool=0;let Lit=-1;class Eit{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class iY{static create(){var e;return new iY((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class d9{constructor(e){this.value=e}}const Dit=2;let ae=class{constructor(e){var t,n,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new Eit((r=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&r!==void 0?r:Lit):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new Vw(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),me.None;if(this._disposed)return me.None;n&&(t=t.bind(n));const u=new d9(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=iY.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof d9?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new jCe),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ot(()=>{d==null||d(),this._removeListener(u)});return r instanceof Fe?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,n,r,o;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*Dit<=s.length){let c=0;for(let u=0;u0}};const Iit=()=>new jCe;class jCe{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Ab extends ae{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ca,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 KCe extends Ab{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class kit extends ae{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 Tit{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new ae({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),Ot(Gv(()=>{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===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class rY{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,o)):t.call(n,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(r=>r()),n}}class Fse{constructor(){this.listening=!1,this.inputEvent=ot.None,this.inputEventListener=me.None,this.emitter=new ae({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 GCe=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var wn;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof AM?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ot.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:GCe})})(wn||(wn={}));class AM{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?GCe:(this._emitter||(this._emitter=new ae),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let xr=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 AM),this._token}cancel(){this._token?this._token instanceof AM&&this._token.cancel():this._token=wn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof AM&&this._token.dispose():this._token=wn.None}};class oY{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 OM=new oY,tV=new oY,nV=new oY,qCe=new Array(230),Nit=Object.create(null),Rit=Object.create(null),sY=[];for(let i=0;i<=193;i++)sY[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[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,i,0,i,i,i],[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",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const r of e){const[o,s,a,l,c,u,d,h,f]=r;if(n[s]||(n[s]=!0,Nit[a]=s,Rit[a.toLowerCase()]=s,o&&(sY[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);OM.define(l,c),tV.define(l,h||c),nV.define(l,f||h||c)}u&&(qCe[u]=l)}})();var Vg;(function(i){function e(a){return OM.keyCodeToStr(a)}i.toString=e;function t(a){return OM.strToKeyCode(a)}i.fromString=t;function n(a){return tV.keyCodeToStr(a)}i.toUserSettingsUS=n;function r(a){return nV.keyCodeToStr(a)}i.toUserSettingsGeneral=r;function o(a){return tV.strToKeyCode(a)||nV.strToKeyCode(a)}i.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return OM.keyCodeToStr(a)}i.toElectronAccelerator=s})(Vg||(Vg={}));function fo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let Xy;const h9=globalThis.vscode;if(typeof h9<"u"&&typeof h9.process<"u"){const i=h9.process;Xy={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"?Xy={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Xy={get platform(){return Os?"win32":Dn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const TA=Xy.cwd,iV=Xy.env,Mit=Xy.platform,Pit=65,Ait=97,Oit=90,Fit=122,xv=46,Ks=47,Xl=92,hm=58,Bit=63;class XCe extends Error{constructor(e,t,n){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function Wit(i,e){if(i===null||typeof i!="object")throw new XCe(e,"Object",i)}function Fo(i,e){if(typeof i!="string")throw new XCe(e,"string",i)}const T_=Mit==="win32";function li(i){return i===Ks||i===Xl}function rV(i){return i===Ks}function fm(i){return i>=Pit&&i<=Oit||i>=Ait&&i<=Fit}function NA(i,e,t,n){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${i.slice(s+1,c)}`:r=i.slice(s+1,c),o=c-s-1;s=c,a=0}else l===xv&&a!==-1?++a:a=-1}return r}function YCe(i,e){Wit(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const El={resolve(...i){let e="",t="",n=!1;for(let r=i.length-1;r>=-1;r--){let o;if(r>=0){if(o=i[r],Fo(o,"path"),o.length===0)continue}else e.length===0?o=TA():(o=iV[`=${e}`]||TA(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Xl)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(o.charCodeAt(1))){let d=2,h=d;for(;d2&&li(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=NA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){Fo(i,"path");const e=i.length;if(e===0)return".";let t=0,n,r=!1;const o=i.charCodeAt(0);if(e===1)return rV(o)?"\\":i;if(li(o))if(r=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(r=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?r?`\\${s}`:s:r?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){Fo(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&fm(t)&&i.charCodeAt(1)===hm&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,r=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++r;const o=t.length;o>1&&li(t.charCodeAt(1))&&(++r,o>2&&(li(t.charCodeAt(2))?++r:n=!1))}if(n){for(;r=2&&(e=`\\${e.slice(r)}`)}return El.normalize(e)},relative(i,e){if(Fo(i,"from"),Fo(e,"to"),i===e)return"";const t=El.resolve(i),n=El.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let r=0;for(;rr&&i.charCodeAt(o-1)===Xl;)o--;const s=o-r;let a=0;for(;aa&&e.charCodeAt(l-1)===Xl;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===Xl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(r+h)===Xl?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||i.charCodeAt(h)===Xl)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Xl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=El.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Xl){if(e.charCodeAt(1)===Xl){const t=e.charCodeAt(2);if(t!==Bit&&t!==xv)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fm(e.charCodeAt(0))&&e.charCodeAt(1)===hm&&e.charCodeAt(2)===Xl)return`\\\\?\\${e}`;return i},dirname(i){Fo(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const r=i.charCodeAt(0);if(e===1)return li(r)?i:".";if(li(r)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let o=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return i.slice(0,o)},basename(i,e){e!==void 0&&Fo(e,"ext"),Fo(i,"path");let t=0,n=-1,r=!0,o;if(i.length>=2&&fm(i.charCodeAt(0))&&i.charCodeAt(1)===hm&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=t;--o){const l=i.charCodeAt(o);if(li(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=t;--o)if(li(i.charCodeAt(o))){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Fo(i,"path");let e=0,t=-1,n=0,r=-1,o=!0,s=0;i.length>=2&&i.charCodeAt(1)===hm&&fm(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!o){n=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===xv?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===n+1?"":i.slice(t,r)},format:YCe.bind(null,"\\"),parse(i){Fo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,r=i.charCodeAt(0);if(t===1)return li(r)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(r)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let o=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(r=i.charCodeAt(c),li(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===xv?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,o),e.base=i.slice(s,a),e.ext=i.slice(o,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},$it=(()=>{if(T_){const i=/\\/g;return()=>{const e=TA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>TA()})(),lo={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const r=n>=0?i[n]:$it();Fo(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Ks)}return e=NA(e,!t,"/",rV),t?`/${e}`:e.length>0?e:"."},normalize(i){if(Fo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ks,t=i.charCodeAt(i.length-1)===Ks;return i=NA(i,!e,"/",rV),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return Fo(i,"path"),i.length>0&&i.charCodeAt(0)===Ks},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":lo.normalize(e)},relative(i,e){if(Fo(i,"from"),Fo(e,"to"),i===e||(i=lo.resolve(i),e=lo.resolve(e),i===e))return"";const t=1,n=i.length,r=n-t,o=1,s=e.length-o,a=ra){if(e.charCodeAt(o+c)===Ks)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(i.charCodeAt(t+c)===Ks?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Ks)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(i){return i},dirname(i){if(Fo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ks;let t=-1,n=!0;for(let r=i.length-1;r>=1;--r)if(i.charCodeAt(r)===Ks){if(!n){t=r;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&Fo(e,"ext"),Fo(i,"path");let t=0,n=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=0;--o){const l=i.charCodeAt(o);if(l===Ks){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=0;--o)if(i.charCodeAt(o)===Ks){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Fo(i,"path");let e=-1,t=0,n=-1,r=!0,o=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===Ks){if(!r){t=s+1;break}continue}n===-1&&(r=!1,n=s+1),a===xv?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||n===-1||o===0||o===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:YCe.bind(null,"/"),parse(i){Fo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Ks;let n;t?(e.root="/",n=1):n=0;let r=-1,o=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===Ks){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===xv?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,r),e.base=i.slice(u,s),e.ext=i.slice(r,s))}return o>0?e.dir=i.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};lo.win32=El.win32=El;lo.posix=El.posix=lo;const ZCe=T_?El.normalize:lo.normalize,Hit=T_?El.resolve:lo.resolve,Vit=T_?El.relative:lo.relative,QCe=T_?El.dirname:lo.dirname,Lv=T_?El.basename:lo.basename,zit=T_?El.extname:lo.extname,ih=T_?El.sep:lo.sep,Uit=/^\w[\w\d+.-]*$/,jit=/^\//,Kit=/^\/\//;function Git(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!Uit.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!jit.test(i.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(Kit.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function qit(i,e){return!i&&!e?"file":i}function Xit(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Vd&&(e=Vd+e):e=Vd;break}return e}const Wr="",Vd="/",Yit=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Ft{static isUri(e){return e instanceof Ft?!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,n,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||Wr,this.authority=e.authority||Wr,this.path=e.path||Wr,this.query=e.query||Wr,this.fragment=e.fragment||Wr):(this.scheme=qit(e,s),this.authority=t||Wr,this.path=Xit(this.scheme,n||Wr),this.query=r||Wr,this.fragment=o||Wr,Git(this,s))}get fsPath(){return RA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Wr),n===void 0?n=this.authority:n===null&&(n=Wr),r===void 0?r=this.path:r===null&&(r=Wr),o===void 0?o=this.query:o===null&&(o=Wr),s===void 0?s=this.fragment:s===null&&(s=Wr),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new h1(t,n,r,o,s)}static parse(e,t=!1){const n=Yit.exec(e);return n?new h1(n[2]||Wr,BR(n[4]||Wr),BR(n[5]||Wr),BR(n[7]||Wr),BR(n[9]||Wr),t):new h1(Wr,Wr,Wr,Wr,Wr)}static file(e){let t=Wr;if(Os&&(e=e.replace(/\\/g,Vd)),e[0]===Vd&&e[1]===Vd){const n=e.indexOf(Vd,2);n===-1?(t=e.substring(2),e=Vd):(t=e.substring(2,n),e=e.substring(n)||Vd)}return new h1("file",t,e,Wr,Wr)}static from(e,t){return new h1(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 n;return Os&&e.scheme==="file"?n=Ft.file(El.join(RA(e,!0),...t)).path:n=lo.join(e.path,...t),e.with({path:n})}toString(e=!1){return oV(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Ft)return e;{const r=new h1(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===JCe&&(n=e.fsPath)!==null&&n!==void 0?n:null,r}}else return e}}const JCe=Os?1:void 0;let h1=class extends Ft{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=RA(this,!1)),this._fsPath}toString(e=!1){return e?oV(this,!0):(this._formatted||(this._formatted=oV(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=JCe),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 e1e={[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 Bse(i,e,t){let n,r=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n!==void 0&&(n+=i.charAt(o));else{n===void 0&&(n=i.substr(0,o));const a=e1e[s];a!==void 0?(r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n+=a):r===-1&&(r=o)}}return r!==-1&&(n+=encodeURIComponent(i.substring(r))),n!==void 0?n:i}function Zit(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,Os&&(t=t.replace(/\//g,"\\")),t}function oV(i,e){const t=e?Zit:Bse;let n="",{scheme:r,authority:o,path:s,query:a,fragment:l}=i;if(r&&(n+=r,n+=":"),(o||r==="file")&&(n+=Vd,n+=Vd),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?n+=t(o,!1,!0):(n+=t(o.substr(0,c),!1,!0),n+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:Bse(l,!1,!1)),n}function t1e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+t1e(i.substr(3)):i}}const Wse=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BR(i){return i.match(Wse)?i.replace(Wse,e=>t1e(e)):i}let le=class _0{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 _0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return _0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return _0.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return Go.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Go.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Go.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return Go.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Go.plusRange(this,e)}static plusRange(e,t){let n,r,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Go(n,r,o,s)}intersectRanges(e){return Go.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(o=c,s=u):o===c&&(s=Math.min(s,u)),n>o||n===o&&r>s?null:new Go(n,r,o,s)}equalsRange(e){return Go.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 Go.getEndPosition(this)}static getEndPosition(e){return new le(e.endLineNumber,e.endColumn)}getStartPosition(){return Go.getStartPosition(this)}static getStartPosition(e){return new le(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Go(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Go(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Go.collapseToStart(this)}static collapseToStart(e){return new Go(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Go.collapseToEnd(this)}static collapseToEnd(e){return new Go(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Go(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Go(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Go(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.endLineNumbere.startLineNumber}toJSON(){return this}},Et=class Au extends W{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Au.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 Au(this.startLineNumber,this.startColumn,e,t):new Au(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new le(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new le(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Au(e,t,this.endLineNumber,this.endColumn):new Au(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Au(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Au(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Au(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Au(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const r=new Jit(this,e,t);return this._factories.set(e,r),Ot(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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 Jit extends me{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,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 iI=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class aY{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class o3{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var rI;(function(i){const e=new Map;e.set(0,tt.symbolMethod),e.set(1,tt.symbolFunction),e.set(2,tt.symbolConstructor),e.set(3,tt.symbolField),e.set(4,tt.symbolVariable),e.set(5,tt.symbolClass),e.set(6,tt.symbolStruct),e.set(7,tt.symbolInterface),e.set(8,tt.symbolModule),e.set(9,tt.symbolProperty),e.set(10,tt.symbolEvent),e.set(11,tt.symbolOperator),e.set(12,tt.symbolUnit),e.set(13,tt.symbolValue),e.set(15,tt.symbolEnum),e.set(14,tt.symbolConstant),e.set(15,tt.symbolEnum),e.set(16,tt.symbolEnumMember),e.set(17,tt.symbolKeyword),e.set(27,tt.symbolSnippet),e.set(18,tt.symbolText),e.set(19,tt.symbolColor),e.set(20,tt.symbolFile),e.set(21,tt.symbolReference),e.set(22,tt.symbolCustomColor),e.set(23,tt.symbolFolder),e.set(24,tt.symbolTypeParameter),e.set(25,tt.account),e.set(26,tt.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=tt.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function r(o,s){let a=n.get(o);return typeof a>"u"&&!s&&(a=9),a}i.fromString=r})(rI||(rI={}));var _p;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(_p||(_p={}));class i1e{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return W.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Af;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(Af||(Af={}));var oI;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(oI||(oI={}));function ert(i){return i&&Ft.isUri(i.uri)&&W.isIRange(i.range)&&(W.isIRange(i.originSelectionRange)||W.isIRange(i.targetSelectionRange))}const trt={[17]:w("Array","array"),[16]:w("Boolean","boolean"),[4]:w("Class","class"),[13]:w("Constant","constant"),[8]:w("Constructor","constructor"),[9]:w("Enum","enumeration"),[21]:w("EnumMember","enumeration member"),[23]:w("Event","event"),[7]:w("Field","field"),[0]:w("File","file"),[11]:w("Function","function"),[10]:w("Interface","interface"),[19]:w("Key","key"),[5]:w("Method","method"),[1]:w("Module","module"),[2]:w("Namespace","namespace"),[20]:w("Null","null"),[15]:w("Number","number"),[18]:w("Object","object"),[24]:w("Operator","operator"),[3]:w("Package","package"),[6]:w("Property","property"),[14]:w("String","string"),[22]:w("Struct","struct"),[25]:w("TypeParameter","type parameter"),[12]:w("Variable","variable")};function nrt(i,e){return w("symbolAriaLabel","{0} ({1})",i,trt[e])}var MA;(function(i){const e=new Map;e.set(0,tt.symbolFile),e.set(1,tt.symbolModule),e.set(2,tt.symbolNamespace),e.set(3,tt.symbolPackage),e.set(4,tt.symbolClass),e.set(5,tt.symbolMethod),e.set(6,tt.symbolProperty),e.set(7,tt.symbolField),e.set(8,tt.symbolConstructor),e.set(9,tt.symbolEnum),e.set(10,tt.symbolInterface),e.set(11,tt.symbolFunction),e.set(12,tt.symbolVariable),e.set(13,tt.symbolConstant),e.set(14,tt.symbolString),e.set(15,tt.symbolNumber),e.set(16,tt.symbolBoolean),e.set(17,tt.symbolArray),e.set(18,tt.symbolObject),e.set(19,tt.symbolKey),e.set(20,tt.symbolNull),e.set(21,tt.symbolEnumMember),e.set(22,tt.symbolStruct),e.set(23,tt.symbolEvent),e.set(24,tt.symbolOperator),e.set(25,tt.symbolTypeParameter);function t(n){let r=e.get(n);return r||(console.info("No codicon found for SymbolKind "+n),r=tt.symbolProperty),r}i.toIcon=t})(MA||(MA={}));class ya{static fromValue(e){switch(e){case"comment":return ya.Comment;case"imports":return ya.Imports;case"region":return ya.Region}return new ya(e)}constructor(e){this.value=e}}ya.Comment=new ya("comment");ya.Imports=new ya("imports");ya.Region=new ya("region");var $se;(function(i){i[i.AIGenerated=1]="AIGenerated"})($se||($se={}));var aV;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(aV||(aV={}));var PA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(PA||(PA={}));class irt{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 gr=new Qit;var AA;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(AA||(AA={}));var lV;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(lV||(lV={}));var cV;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(cV||(cV={}));var uV;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(uV||(uV={}));var dV;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(dV||(dV={}));var hV;(function(i){i[i.Deprecated=1]="Deprecated"})(hV||(hV={}));var fV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(fV||(fV={}));var gV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(gV||(gV={}));var pV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(pV||(pV={}));var mV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(mV||(mV={}));var vV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(vV||(vV={}));var _V;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(_V||(_V={}));var bV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.inlineEdit=63]="inlineEdit",i[i.letterSpacing=64]="letterSpacing",i[i.lightbulb=65]="lightbulb",i[i.lineDecorationsWidth=66]="lineDecorationsWidth",i[i.lineHeight=67]="lineHeight",i[i.lineNumbers=68]="lineNumbers",i[i.lineNumbersMinChars=69]="lineNumbersMinChars",i[i.linkedEditing=70]="linkedEditing",i[i.links=71]="links",i[i.matchBrackets=72]="matchBrackets",i[i.minimap=73]="minimap",i[i.mouseStyle=74]="mouseStyle",i[i.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=76]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",i[i.multiCursorModifier=78]="multiCursorModifier",i[i.multiCursorPaste=79]="multiCursorPaste",i[i.multiCursorLimit=80]="multiCursorLimit",i[i.occurrencesHighlight=81]="occurrencesHighlight",i[i.overviewRulerBorder=82]="overviewRulerBorder",i[i.overviewRulerLanes=83]="overviewRulerLanes",i[i.padding=84]="padding",i[i.pasteAs=85]="pasteAs",i[i.parameterHints=86]="parameterHints",i[i.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",i[i.quickSuggestions=89]="quickSuggestions",i[i.quickSuggestionsDelay=90]="quickSuggestionsDelay",i[i.readOnly=91]="readOnly",i[i.readOnlyMessage=92]="readOnlyMessage",i[i.renameOnType=93]="renameOnType",i[i.renderControlCharacters=94]="renderControlCharacters",i[i.renderFinalNewline=95]="renderFinalNewline",i[i.renderLineHighlight=96]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=98]="renderValidationDecorations",i[i.renderWhitespace=99]="renderWhitespace",i[i.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",i[i.roundedSelection=101]="roundedSelection",i[i.rulers=102]="rulers",i[i.scrollbar=103]="scrollbar",i[i.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=105]="scrollBeyondLastLine",i[i.scrollPredominantAxis=106]="scrollPredominantAxis",i[i.selectionClipboard=107]="selectionClipboard",i[i.selectionHighlight=108]="selectionHighlight",i[i.selectOnLineNumbers=109]="selectOnLineNumbers",i[i.showFoldingControls=110]="showFoldingControls",i[i.showUnused=111]="showUnused",i[i.snippetSuggestions=112]="snippetSuggestions",i[i.smartSelect=113]="smartSelect",i[i.smoothScrolling=114]="smoothScrolling",i[i.stickyScroll=115]="stickyScroll",i[i.stickyTabStops=116]="stickyTabStops",i[i.stopRenderingLineAfter=117]="stopRenderingLineAfter",i[i.suggest=118]="suggest",i[i.suggestFontSize=119]="suggestFontSize",i[i.suggestLineHeight=120]="suggestLineHeight",i[i.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",i[i.suggestSelection=122]="suggestSelection",i[i.tabCompletion=123]="tabCompletion",i[i.tabIndex=124]="tabIndex",i[i.unicodeHighlighting=125]="unicodeHighlighting",i[i.unusualLineTerminators=126]="unusualLineTerminators",i[i.useShadowDOM=127]="useShadowDOM",i[i.useTabStops=128]="useTabStops",i[i.wordBreak=129]="wordBreak",i[i.wordSeparators=130]="wordSeparators",i[i.wordWrap=131]="wordWrap",i[i.wordWrapBreakAfterCharacters=132]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=133]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=134]="wordWrapColumn",i[i.wordWrapOverride1=135]="wordWrapOverride1",i[i.wordWrapOverride2=136]="wordWrapOverride2",i[i.wrappingIndent=137]="wrappingIndent",i[i.wrappingStrategy=138]="wrappingStrategy",i[i.showDeprecated=139]="showDeprecated",i[i.inlayHints=140]="inlayHints",i[i.editorClassName=141]="editorClassName",i[i.pixelRatio=142]="pixelRatio",i[i.tabFocusMode=143]="tabFocusMode",i[i.layoutInfo=144]="layoutInfo",i[i.wrappingInfo=145]="wrappingInfo",i[i.defaultColorDecorators=146]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=147]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=148]="inlineCompletionsAccessibilityVerbose"})(bV||(bV={}));var CV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(CV||(CV={}));var yV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(yV||(yV={}));var wV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(wV||(wV={}));var SV;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(SV||(SV={}));var xV;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(xV||(xV={}));var LV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(LV||(LV={}));var EV;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(EV||(EV={}));var DV;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(DV||(DV={}));var IV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(IV||(IV={}));var kV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(kV||(kV={}));var TV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(TV||(TV={}));var NV;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(NV||(NV={}));var RV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(RV||(RV={}));var MV;(function(i){i[i.AIGenerated=1]="AIGenerated"})(MV||(MV={}));var PV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(PV||(PV={}));var AV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(AV||(AV={}));var OV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(OV||(OV={}));var FV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(FV||(FV={}));var BV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(BV||(BV={}));var WV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(WV||(WV={}));var $V;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})($V||($V={}));var HV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(HV||(HV={}));var VV;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(VV||(VV={}));var zV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(zV||(zV={}));var UV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(UV||(UV={}));var jV;(function(i){i[i.Deprecated=1]="Deprecated"})(jV||(jV={}));var KV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(KV||(KV={}));var GV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(GV||(GV={}));var qV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(qV||(qV={}));var XV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(XV||(XV={}));let cT=class{static chord(e,t){return fo(e,t)}};cT.CtrlCmd=2048;cT.Shift=1024;cT.Alt=512;cT.WinCtrl=256;function r1e(){return{editor:void 0,languages:void 0,CancellationTokenSource:xr,Emitter:ae,KeyCode:IV,KeyMod:cT,Position:le,Range:W,Selection:Et,SelectionDirection:HV,MarkerSeverity:kV,MarkerTag:TV,Uri:Ft,Token:iI}}function rrt(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const hi=window,ort=hi;class srt{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class Hse{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class tg{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var zw;function o1e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const art=/{(\d+)}/g;function Ob(i,...e){return e.length===0?i:i.replace(art,function(t,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function lrt(i){return i.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function OA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function vc(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function crt(i,e=" "){const t=uT(i,e);return s1e(t,e)}function uT(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function s1e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let r=n,o=-1;for(;o=i.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return i.substring(0,r)}function urt(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function drt(i){return i.replace(/\*/g,"")}function a1e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=vc(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function hrt(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function ng(i){return i.split(/\r\n|\r|\n/)}function frt(i){var e;const t=[],n=i.split(/(\r\n|\r|\n)/);for(let r=0;r=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function sI(i,e){return ie?1:0}function lY(i,e,t=0,n=i.length,r=0,o=e.length){for(;tc)return 1}const s=n-t,a=o-r;return sa?1:0}function YV(i,e){return dT(i,e,0,i.length,0,e.length)}function dT(i,e,t=0,n=i.length,r=0,o=e.length){for(;t=128||c>=128)return lY(i.toLowerCase(),e.toLowerCase(),t,n,r,o);Zm(l)&&(l-=32),Zm(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=o-r;return sa?1:0}function WR(i){return i>=48&&i<=57}function Zm(i){return i>=97&&i<=122}function af(i){return i>=65&&i<=90}function dy(i,e){return i.length===e.length&&dT(i,e)===0}function cY(i,e){const t=e.length;return e.length>i.length?!1:dT(i,e,0,t)===0}function qv(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(Do(n))return uY(n,t)}return t}class dY{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=grt(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=BA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class WA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new dY(e,t)}nextGraphemeLength(){const e=Qm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Vse(r,s)){t.setOffset(o);break}r=s}return t.offset-n}prevGraphemeLength(){const e=Qm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Vse(s,r)){t.setOffset(o);break}r=s}return n-t.offset}eol(){return this._iterator.eol()}}function hY(i,e){return new WA(i,e).nextGraphemeLength()}function l1e(i,e){return new WA(i,e).prevGraphemeLength()}function prt(i,e){e>0&&Fb(i.charCodeAt(e))&&e--;const t=e+hY(i,e);return[t-l1e(i,t),t]}let f9;function mrt(){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 Uw(i){return f9||(f9=mrt()),f9.test(i)}const vrt=/^[\t\n\r\x20-\x7E]*$/;function hT(i){return vrt.test(i)}const c1e=/[\u2028\u2029]/;function u1e(i){return c1e.test(i)}function Xv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function fY(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const _rt=String.fromCharCode(65279);function gY(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function brt(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function d1e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Vse(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class Qm{static getInstance(){return Qm._INSTANCE||(Qm._INSTANCE=new Qm),Qm._INSTANCE}constructor(){this._data=Crt()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}Qm._INSTANCE=null;function Crt(){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 yrt(i,e){if(i===0)return 0;const t=wrt(i,e);if(t!==void 0)return t;const n=new dY(e,i);return n.prevCodePoint(),n.offset}function wrt(i,e){const t=new dY(e,i);let n=t.prevCodePoint();for(;Srt(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!fY(n))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function Srt(i){return 127995<=i&&i<=127999}const h1e=" ";class Bb{static getInstance(e){return zw.cache.get(Array.from(e))}static getLocales(){return zw._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())}}zw=Bb;Bb.ambiguousCharacterData=new tg(()=>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]}'));Bb.cache=new srt(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=n(s,u)}const a=e(r._common),l=t(a,s);return new zw(l)});Bb._locales=new tg(()=>Object.keys(zw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class Of{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(Of.getRawData())),this._data}static isInvisibleCharacter(e){return Of.getData().has(e)}static get codePoints(){return Of.getData()}}Of._data=void 0;class ZV{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}ZV.INSTANCE=new ZV;function f1e(i,e,t){typeof e=="string"&&(e=i.matchMedia(e)),e.addEventListener("change",t)}function xrt(i){return ZV.INSTANCE.getZoomFactor(i)}const VS=navigator.userAgent,lu=VS.indexOf("Firefox")>=0,db=VS.indexOf("AppleWebKit")>=0,fT=VS.indexOf("Chrome")>=0,Fp=!fT&&VS.indexOf("Safari")>=0,g1e=!fT&&!Fp&&db;VS.indexOf("Electron/")>=0;const zse=VS.indexOf("Android")>=0;let FM=!1;if(typeof hi.matchMedia=="function"){const i=hi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=hi.matchMedia("(display-mode: fullscreen)");FM=i.matches,f1e(hi,i,({matches:t})=>{FM&&e.matches||(FM=t)})}function Lrt(){return FM}const pY={clipboard:{writeText:nh||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:nh||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>nh||Lrt()?0:navigator.keyboard||Fp?1:2)(),touch:"ontouchstart"in hi||navigator.maxTouchPoints>0,pointerEvents:hi.PointerEvent&&("ontouchstart"in hi||navigator.maxTouchPoints>0)};function QV(i,e){if(typeof i=="number"){if(i===0)return null;const t=(i&65535)>>>0,n=(i&4294901760)>>>16;return n!==0?new g9([$R(t,e),$R(n,e)]):new g9([$R(t,e)])}else{const t=[];for(let n=0;n{const s=e.token.onCancellationRequested(()=>{s.dispose(),o(new k_)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return n.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return n.finally(r)}}}function gT(i,e,t){return new Promise((n,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),n(t)});i.then(n,r).finally(()=>o.dispose())})}class Art{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,n(r)})})}dispose(){this.isDisposed=!0}}const Ort=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},Frt=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class ad{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const n=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===p1e?Frt(n):Ort(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new k_),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class m1e{constructor(e){this.delayer=new ad(e),this.throttler=new Art}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Yv(i,e){return e?new Promise((t,n)=>{const r=setTimeout(()=>{o.dispose(),t()},i),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),n(new k_)})}):No(t=>Yv(i,t))}function Zv(i,e=0,t){const n=setTimeout(()=>{i(),t&&r.dispose()},e),r=Ot(()=>{clearTimeout(n),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function mY(i,e=n=>!!n,t=null){let n=0;const r=i.length,o=()=>{if(n>=r)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class gd{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class vY{constructor(){this.disposable=void 0}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){this.cancel();const r=n.setInterval(()=>{e()},t);this.disposable=Ot(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel()}}class mi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let v1e,AE;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?AE=(i,e)=>{FCe(()=>{if(t)return;const n=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:AE=(i,e,t)=>{const n=i.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let r=!1;return{dispose(){r||(r=!0,i.cancelIdleCallback(n))}}},v1e=i=>AE(globalThis,i)})();class _1e{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=AE(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 Brt extends _1e{constructor(e){super(globalThis,e)}}class s3{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new k_)}}var ez;(function(i){async function e(n){let r;const o=await Promise.all(n.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o}i.settled=e;function t(n){return new Promise(async(r,o)=>{try{await n(r,o)}catch(s){o(s)}})}i.withAsyncBody=t})(ez||(ez={}));class Xr{static fromArray(e){return new Xr(t=>{t.emitMany(e)})}static fromPromise(e){return new Xr(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Xr(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new Xr(async t=>{await Promise.all(e.map(async n=>{for await(const r of n)t.emitOne(r)}))})}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new ae,queueMicrotask(async()=>{const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{for await(const r of e)n.emitOne(t(r))})}map(e){return Xr.map(this,e)}static filter(e,t){return new Xr(async n=>{for await(const r of e)t(r)&&n.emitOne(r)})}filter(e){return Xr.filter(this,e)}static coalesce(e){return Xr.filter(e,t=>!!t)}coalesce(){return Xr.coalesce(this)}static async toPromise(e){const t=[];for await(const n of e)t.push(n);return t}toPromise(){return Xr.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())}}Xr.EMPTY=Xr.fromArray([]);class Wrt extends Xr{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function $rt(i){const e=new xr,t=i(e.token);return new Wrt(e,async n=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),n.reject(new k_)});try{for await(const o of t){if(e.token.isCancellationRequested)return;n.emitOne(o)}r.dispose(),e.dispose()}catch(o){r.dispose(),e.dispose(),n.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:b1e,setPrototypeOf:jse,isFrozen:Hrt,getPrototypeOf:Vrt,getOwnPropertyDescriptor:zrt}=Object;let{freeze:Rl,seal:gh,create:Urt}=Object,{apply:tz,construct:nz}=typeof Reflect<"u"&&Reflect;tz||(tz=function(e,t,n){return e.apply(t,n)});Rl||(Rl=function(e){return e});gh||(gh=function(e){return e});nz||(nz=function(e,t){return new e(...t)});const jrt=ld(Array.prototype.forEach),Kse=ld(Array.prototype.pop),Jx=ld(Array.prototype.push),BM=ld(String.prototype.toLowerCase),p9=ld(String.prototype.toString),Krt=ld(String.prototype.match),Sd=ld(String.prototype.replace),Grt=ld(String.prototype.indexOf),qrt=ld(String.prototype.trim),$c=ld(RegExp.prototype.test),eL=Xrt(TypeError);function ld(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r/gm),eot=gh(/\${[\w\W]*}/gm),tot=gh(/^data-[\-\w.\u00B7-\uFFFF]/),not=gh(/^aria-[\-\w]+$/),C1e=gh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iot=gh(/^(?:\w+script|data):/i),rot=gh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y1e=gh(/^html$/i);var Zse=Object.freeze({__proto__:null,MUSTACHE_EXPR:Qrt,ERB_EXPR:Jrt,TMPLIT_EXPR:eot,DATA_ATTR:tot,ARIA_ATTR:not,IS_ALLOWED_URI:C1e,IS_SCRIPT_OR_DATA:iot,ATTR_WHITESPACE:rot,DOCTYPE_NAME:y1e});const oot=()=>typeof window>"u"?null:window,sot=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function w1e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oot();const e=Ut=>w1e(Ut);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:r}=i;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=HR(g,"cloneNode"),m=HR(g,"nextSibling"),v=HR(g,"childNodes"),_=HR(g,"parentNode");if(typeof s=="function"){const Ut=r.createElement("template");Ut.content&&Ut.content.ownerDocument&&(r=Ut.content.ownerDocument)}let y,S="";const{implementation:L,createNodeIterator:E,createDocumentFragment:D,getElementsByTagName:k}=r,{importNode:T}=t;let M={};e.isSupported=typeof b1e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:N,TMPLIT_EXPR:R,DATA_ATTR:O,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:G}=Zse;let{IS_ALLOWED_URI:U}=Zse,j=null;const ie=di({},[...Gse,...m9,...v9,..._9,...qse]);let Y=null;const J=di({},[...Xse,...b9,...Yse,...VR]);let Q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,ge=null,ye=!0,be=!0,Ge=!1,nt=!0,je=!1,_e=!1,Ve=!1,Le=!1,Pe=!1,Be=!1,Qe=!1,Ye=!0,We=!1;const dt="user-content-";let re=!0,ue=!1,de={},z=null;const q=di({},["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 se=null;const ne=di({},["audio","video","img","source","image","track"]);let pe=null;const ke=di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ce="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ie=fe,Te=!1,He=null;const Me=di({},[oe,ce,fe],p9);let bt;const rt=["application/xhtml+xml","text/html"],Ht="text/html";let Ue,Ct=null;const Dt=r.createElement("form"),St=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},Kt=function(Ee){if(!(Ct&&Ct===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=f1(Ee),bt=rt.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?bt=Ht:bt=Ee.PARSER_MEDIA_TYPE,Ue=bt==="application/xhtml+xml"?p9:BM,j="ALLOWED_TAGS"in Ee?di({},Ee.ALLOWED_TAGS,Ue):ie,Y="ALLOWED_ATTR"in Ee?di({},Ee.ALLOWED_ATTR,Ue):J,He="ALLOWED_NAMESPACES"in Ee?di({},Ee.ALLOWED_NAMESPACES,p9):Me,pe="ADD_URI_SAFE_ATTR"in Ee?di(f1(ke),Ee.ADD_URI_SAFE_ATTR,Ue):ke,se="ADD_DATA_URI_TAGS"in Ee?di(f1(ne),Ee.ADD_DATA_URI_TAGS,Ue):ne,z="FORBID_CONTENTS"in Ee?di({},Ee.FORBID_CONTENTS,Ue):q,he="FORBID_TAGS"in Ee?di({},Ee.FORBID_TAGS,Ue):{},ge="FORBID_ATTR"in Ee?di({},Ee.FORBID_ATTR,Ue):{},de="USE_PROFILES"in Ee?Ee.USE_PROFILES:!1,ye=Ee.ALLOW_ARIA_ATTR!==!1,be=Ee.ALLOW_DATA_ATTR!==!1,Ge=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=Ee.SAFE_FOR_TEMPLATES||!1,_e=Ee.WHOLE_DOCUMENT||!1,Pe=Ee.RETURN_DOM||!1,Be=Ee.RETURN_DOM_FRAGMENT||!1,Qe=Ee.RETURN_TRUSTED_TYPE||!1,Le=Ee.FORCE_BODY||!1,Ye=Ee.SANITIZE_DOM!==!1,We=Ee.SANITIZE_NAMED_PROPS||!1,re=Ee.KEEP_CONTENT!==!1,ue=Ee.IN_PLACE||!1,U=Ee.ALLOWED_URI_REGEXP||C1e,Ie=Ee.NAMESPACE||fe,Q=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&St(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&St(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(be=!1),Be&&(Pe=!0),de&&(j=di({},[...qse]),Y=[],de.html===!0&&(di(j,Gse),di(Y,Xse)),de.svg===!0&&(di(j,m9),di(Y,b9),di(Y,VR)),de.svgFilters===!0&&(di(j,v9),di(Y,b9),di(Y,VR)),de.mathMl===!0&&(di(j,_9),di(Y,Yse),di(Y,VR))),Ee.ADD_TAGS&&(j===ie&&(j=f1(j)),di(j,Ee.ADD_TAGS,Ue)),Ee.ADD_ATTR&&(Y===J&&(Y=f1(Y)),di(Y,Ee.ADD_ATTR,Ue)),Ee.ADD_URI_SAFE_ATTR&&di(pe,Ee.ADD_URI_SAFE_ATTR,Ue),Ee.FORBID_CONTENTS&&(z===q&&(z=f1(z)),di(z,Ee.FORBID_CONTENTS,Ue)),re&&(j["#text"]=!0),_e&&di(j,["html","head","body"]),j.table&&(di(j,["tbody"]),delete he.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw eL('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw eL('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Ee.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=sot(f,n)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));Rl&&Rl(Ee),Ct=Ee}},_n=di({},["mi","mo","mn","ms","mtext"]),zt=di({},["foreignobject","desc","title","annotation-xml"]),Yt=di({},["title","style","font","a","script"]),at=di({},m9);di(at,v9),di(at,Yrt);const ut=di({},_9);di(ut,Zrt);const ht=function(Ee){let wt=_(Ee);(!wt||!wt.tagName)&&(wt={namespaceURI:Ie,tagName:"template"});const kt=BM(Ee.tagName),qn=BM(wt.tagName);return He[Ee.namespaceURI]?Ee.namespaceURI===ce?wt.namespaceURI===fe?kt==="svg":wt.namespaceURI===oe?kt==="svg"&&(qn==="annotation-xml"||_n[qn]):!!at[kt]:Ee.namespaceURI===oe?wt.namespaceURI===fe?kt==="math":wt.namespaceURI===ce?kt==="math"&&zt[qn]:!!ut[kt]:Ee.namespaceURI===fe?wt.namespaceURI===ce&&!zt[qn]||wt.namespaceURI===oe&&!_n[qn]?!1:!ut[kt]&&(Yt[kt]||!at[kt]):!!(bt==="application/xhtml+xml"&&He[Ee.namespaceURI]):!1},Lt=function(Ee){Jx(e.removed,{element:Ee});try{Ee.parentNode.removeChild(Ee)}catch{Ee.remove()}},At=function(Ee,wt){try{Jx(e.removed,{attribute:wt.getAttributeNode(Ee),from:wt})}catch{Jx(e.removed,{attribute:null,from:wt})}if(wt.removeAttribute(Ee),Ee==="is"&&!Y[Ee])if(Pe||Be)try{Lt(wt)}catch{}else try{wt.setAttribute(Ee,"")}catch{}},ln=function(Ee){let wt,kt;if(Le)Ee=""+Ee;else{const jr=Krt(Ee,/^[\r\n\t ]+/);kt=jr&&jr[0]}bt==="application/xhtml+xml"&&Ie===fe&&(Ee=''+Ee+"");const qn=y?y.createHTML(Ee):Ee;if(Ie===fe)try{wt=new h().parseFromString(qn,bt)}catch{}if(!wt||!wt.documentElement){wt=L.createDocument(Ie,"template",null);try{wt.documentElement.innerHTML=Te?S:qn}catch{}}const dr=wt.body||wt.documentElement;return Ee&&kt&&dr.insertBefore(r.createTextNode(kt),dr.childNodes[0]||null),Ie===fe?k.call(wt,_e?"html":"body")[0]:_e?wt.documentElement:dr},Si=function(Ee){return E.call(Ee.ownerDocument||Ee,Ee,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Xi=function(Ee){return Ee instanceof d&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof u)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},Ir=function(Ee){return typeof a=="object"?Ee instanceof a:Ee&&typeof Ee=="object"&&typeof Ee.nodeType=="number"&&typeof Ee.nodeName=="string"},En=function(Ee,wt,kt){M[Ee]&&jrt(M[Ee],qn=>{qn.call(e,wt,kt,Ct)})},fi=function(Ee){let wt;if(En("beforeSanitizeElements",Ee,null),Xi(Ee))return Lt(Ee),!0;const kt=Ue(Ee.nodeName);if(En("uponSanitizeElement",Ee,{tagName:kt,allowedTags:j}),Ee.hasChildNodes()&&!Ir(Ee.firstElementChild)&&(!Ir(Ee.content)||!Ir(Ee.content.firstElementChild))&&$c(/<[/\w]/g,Ee.innerHTML)&&$c(/<[/\w]/g,Ee.textContent))return Lt(Ee),!0;if(!j[kt]||he[kt]){if(!he[kt]&&go(kt)&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,kt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(kt)))return!1;if(re&&!z[kt]){const qn=_(Ee)||Ee.parentNode,dr=v(Ee)||Ee.childNodes;if(dr&&qn){const jr=dr.length;for(let ei=jr-1;ei>=0;--ei)qn.insertBefore(p(dr[ei],!0),m(Ee))}}return Lt(Ee),!0}return Ee instanceof l&&!ht(Ee)||(kt==="noscript"||kt==="noembed"||kt==="noframes")&&$c(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(Lt(Ee),!0):(je&&Ee.nodeType===3&&(wt=Ee.textContent,wt=Sd(wt,P," "),wt=Sd(wt,N," "),wt=Sd(wt,R," "),Ee.textContent!==wt&&(Jx(e.removed,{element:Ee.cloneNode()}),Ee.textContent=wt)),En("afterSanitizeElements",Ee,null),!1)},Ur=function(Ee,wt,kt){if(Ye&&(wt==="id"||wt==="name")&&(kt in r||kt in Dt))return!1;if(!(be&&!ge[wt]&&$c(O,wt))){if(!(ye&&$c(B,wt))){if(!Y[wt]||ge[wt]){if(!(go(Ee)&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,Ee)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Ee))&&(Q.attributeNameCheck instanceof RegExp&&$c(Q.attributeNameCheck,wt)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(wt))||wt==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,kt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(kt))))return!1}else if(!pe[wt]){if(!$c(U,Sd(kt,G,""))){if(!((wt==="src"||wt==="xlink:href"||wt==="href")&&Ee!=="script"&&Grt(kt,"data:")===0&&se[Ee])){if(!(Ge&&!$c($,Sd(kt,G,"")))){if(kt)return!1}}}}}}return!0},go=function(Ee){return Ee.indexOf("-")>0},ys=function(Ee){let wt,kt,qn,dr;En("beforeSanitizeAttributes",Ee,null);const{attributes:jr}=Ee;if(!jr)return;const ei={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(dr=jr.length;dr--;){wt=jr[dr];const{name:to,namespaceURI:$s}=wt;if(kt=to==="value"?wt.value:qrt(wt.value),qn=Ue(to),ei.attrName=qn,ei.attrValue=kt,ei.keepAttr=!0,ei.forceKeepAttr=void 0,En("uponSanitizeAttribute",Ee,ei),kt=ei.attrValue,ei.forceKeepAttr||(At(to,Ee),!ei.keepAttr))continue;if(!nt&&$c(/\/>/i,kt)){At(to,Ee);continue}je&&(kt=Sd(kt,P," "),kt=Sd(kt,N," "),kt=Sd(kt,R," "));const Hl=Ue(Ee.nodeName);if(Ur(Hl,qn,kt)){if(We&&(qn==="id"||qn==="name")&&(At(to,Ee),kt=dt+kt),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!$s)switch(f.getAttributeType(Hl,qn)){case"TrustedHTML":{kt=y.createHTML(kt);break}case"TrustedScriptURL":{kt=y.createScriptURL(kt);break}}try{$s?Ee.setAttributeNS($s,to,kt):Ee.setAttribute(to,kt),Kse(e.removed)}catch{}}}En("afterSanitizeAttributes",Ee,null)},ws=function Ut(Ee){let wt;const kt=Si(Ee);for(En("beforeSanitizeShadowDOM",Ee,null);wt=kt.nextNode();)En("uponSanitizeShadowNode",wt,null),!fi(wt)&&(wt.content instanceof o&&Ut(wt.content),ys(wt));En("afterSanitizeShadowDOM",Ee,null)};return e.sanitize=function(Ut){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt,kt,qn,dr;if(Te=!Ut,Te&&(Ut=""),typeof Ut!="string"&&!Ir(Ut))if(typeof Ut.toString=="function"){if(Ut=Ut.toString(),typeof Ut!="string")throw eL("dirty is not a string, aborting")}else throw eL("toString is not a function");if(!e.isSupported)return Ut;if(Ve||Kt(Ee),e.removed=[],typeof Ut=="string"&&(ue=!1),ue){if(Ut.nodeName){const to=Ue(Ut.nodeName);if(!j[to]||he[to])throw eL("root node is forbidden and cannot be sanitized in-place")}}else if(Ut instanceof a)wt=ln(""),kt=wt.ownerDocument.importNode(Ut,!0),kt.nodeType===1&&kt.nodeName==="BODY"||kt.nodeName==="HTML"?wt=kt:wt.appendChild(kt);else{if(!Pe&&!je&&!_e&&Ut.indexOf("<")===-1)return y&&Qe?y.createHTML(Ut):Ut;if(wt=ln(Ut),!wt)return Pe?null:Qe?S:""}wt&&Le&&Lt(wt.firstChild);const jr=Si(ue?Ut:wt);for(;qn=jr.nextNode();)fi(qn)||(qn.content instanceof o&&ws(qn.content),ys(qn));if(ue)return Ut;if(Pe){if(Be)for(dr=D.call(wt.ownerDocument);wt.firstChild;)dr.appendChild(wt.firstChild);else dr=wt;return(Y.shadowroot||Y.shadowrootmode)&&(dr=T.call(t,dr,!0)),dr}let ei=_e?wt.outerHTML:wt.innerHTML;return _e&&j["!doctype"]&&wt.ownerDocument&&wt.ownerDocument.doctype&&wt.ownerDocument.doctype.name&&$c(y1e,wt.ownerDocument.doctype.name)&&(ei=" -`+ei),je&&(ei=Sd(ei,P," "),ei=Sd(ei,N," "),ei=Sd(ei,R," ")),y&&Qe?y.createHTML(ei):ei},e.setConfig=function(Ut){Kt(Ut),Ve=!0},e.clearConfig=function(){Ct=null,Ve=!1},e.isValidAttribute=function(Ut,Ee,wt){Ct||Kt({});const kt=Ue(Ut),qn=Ue(Ee);return Ur(kt,qn,wt)},e.addHook=function(Ut,Ee){typeof Ee=="function"&&(M[Ut]=M[Ut]||[],Jx(M[Ut],Ee))},e.removeHook=function(Ut){if(M[Ut])return Kse(M[Ut])},e.removeHooks=function(Ut){M[Ut]&&(M[Ut]=[])},e.removeAllHooks=function(){M={}},e}var ig=w1e();ig.version;ig.isSupported;const S1e=ig.sanitize;ig.setConfig;ig.clearConfig;ig.isValidAttribute;const iz=ig.addHook,x1e=ig.removeHook;ig.removeHooks;ig.removeAllHooks;var cn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatCodeBlock="vscode-chat-code-block",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm",i.codeSetting="code-setting",i.codeFeature="code-feature"})(cn||(cn={}));function _Y(i,e){return Ft.isUri(i)?dy(i.scheme,e):cY(i,e+":")}function Qse(i,...e){return e.some(t=>_Y(i,t))}const aot="tkn";class lot{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${cn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return nn(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${aot}=${encodeURIComponent(o)}`),Ft.from({scheme:I_?this._preferredWebSchema:cn.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:s})}}const L1e=new lot,cot="vscode-app";class aI{uriToBrowserUri(e){return e.scheme===cn.vscodeRemote?L1e.rewrite(e):e.scheme===cn.file&&(nh||ynt===`${cn.vscodeFileResource}://${aI.FALLBACK_AUTHORITY}`)?e.with({scheme:cn.vscodeFileResource,authority:e.authority||aI.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}aI.FALLBACK_AUTHORITY=cot;const E1e=new aI;var Jse;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:Ft.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}i.getHeadersFromQuery=n;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}i.addSearchParam=r})(Jse||(Jse={}));function a3(i){return l3(i,0)}function l3(i,e){switch(typeof i){case"object":return i===null?Jg(349,e):Array.isArray(i)?dot(i,e):hot(i,e);case"string":return bY(i,e);case"boolean":return uot(i,e);case"number":return Jg(i,e);case"undefined":return Jg(937,e);default:return Jg(617,e)}}function Jg(i,e){return(e<<5)-e+i|0}function uot(i,e){return Jg(i?433:863,e)}function bY(i,e){e=Jg(149417,e);for(let t=0,n=i.length;tl3(n,t),e)}function hot(i,e){return e=Jg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=bY(n,t),l3(i[n],t)),e)}function C9(i,e,t=32){const n=t-e,r=~((1<>>n)>>>0}function eae(i,e=0,t=i.byteLength,n=0){for(let r=0;rt.toString(16).padStart(2,"0")).join(""):fot((i>>>0).toString(16),e/4)}class c3{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(Do(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),tL(this._h0)+tL(this._h1)+tL(this._h2)+tL(this._h3)+tL(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,eae(this._buff,this._buffLen),this._buffLen>56&&(this._step(),eae(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=c3._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,C9(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=C9(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=C9(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}c3._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:tMt,getWindow:Bt,getDocument:nMt,getWindows:D1e,getWindowsCount:got,getWindowId:$A,getWindowById:tae,hasWindow:iMt,onDidRegisterWindow:u3,onWillUnregisterWindow:pot,onDidUnregisterWindow:mot}=function(){const i=new Map;rrt(hi,1);const e={window:hi,disposables:new Fe};i.set(hi.vscodeWindowId,e);const t=new ae,n=new ae,r=new ae;function o(s,a){const l=typeof s=="number"?i.get(s):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(s){if(i.has(s.vscodeWindowId))return me.None;const a=new Fe,l={window:s,disposables:a.add(new Fe)};return i.set(s.vscodeWindowId,l),a.add(Ot(()=>{i.delete(s.vscodeWindowId),n.fire(s)})),a.add(xe(s,Je.BEFORE_UNLOAD,()=>{r.fire(s)})),t.fire(l),a},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(s){return s.vscodeWindowId},hasWindow(s){return i.has(s)},getWindowById:o,getWindow(s){var a;const l=s;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const c=s;return c!=null&&c.view?c.view.window:hi},getDocument(s){return Bt(s).document}}}();function Ps(i){for(;i.firstChild;)i.firstChild.remove()}class vot{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,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 xe(i,e,t,n){return new vot(i,e,t,n)}function I1e(i,e){return function(t){return e(new Gu(i,t))}}function _ot(i){return function(e){return i(new Oi(e))}}const Lr=function(e,t,n,r){let o=n;return t==="click"||t==="mousedown"?o=I1e(Bt(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=_ot(n)),xe(e,t,o,r)},bot=function(e,t,n){const r=I1e(Bt(e),t);return Cot(e,r,n)};function Cot(i,e,t){return xe(i,fh&&pY.pointerEvents?Je.POINTER_DOWN:Je.MOUSE_DOWN,e,t)}function HL(i,e,t){return AE(i,e,t)}class y9 extends _1e{constructor(e,t){super(e,t)}}let HA,Ml;class CY extends vY{constructor(e){super(),this.defaultTarget=e&&Bt(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class w9{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){nn(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const i=new Map,e=new Map,t=new Map,n=new Map,r=o=>{var s;t.set(o,!1);const a=(s=i.get(o))!==null&&s!==void 0?s:[];for(e.set(o,a),i.set(o,[]),n.set(o,!0);a.length>0;)a.sort(w9.sort),a.shift().execute();n.set(o,!1)};Ml=(o,s,a=0)=>{const l=$A(o),c=new w9(s,a);let u=i.get(l);return u||(u=[],i.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>r(l))),c},HA=(o,s,a)=>{const l=$A(o);if(n.get(l)){const c=new w9(s,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return Ml(o,s,a)}})();function d3(i){return Bt(i).getComputedStyle(i,null)}function Wp(i,e){const t=Bt(i),n=t.document;if(i!==n.body)return new Gn(i.clientWidth,i.clientHeight);if(fh&&(t!=null&&t.visualViewport))return new Gn(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Gn(t.innerWidth,t.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new Gn(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new Gn(n.documentElement.clientWidth,n.documentElement.clientHeight);if(e)return Wp(e);throw new Error("Unable to figure out browser width and height")}class Nr{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const r=d3(e),o=r?r.getPropertyValue(t):"0";return Nr.convertToPixels(e,o)}static getBorderLeftWidth(e){return Nr.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Nr.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Nr.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Nr.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Nr.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Nr.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Nr.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Nr.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Nr.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Nr.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Nr.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Nr.getDimension(e,"margin-bottom","marginBottom")}}class Gn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Gn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Gn?e:new Gn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Gn.None=new Gn(0,0);function k1e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const r=N1e(i)?null:d3(i);r&&(n-=r.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=Nr.getBorderLeftWidth(i),t+=Nr.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function yot(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Hr(i){const e=i.getBoundingClientRect(),t=Bt(i);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function T1e(i){let e=i,t=1;do{const n=d3(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ha(i){const e=Nr.getMarginLeft(i)+Nr.getMarginRight(i);return i.offsetWidth+e}function S9(i){const e=Nr.getBorderLeftWidth(i)+Nr.getBorderRightWidth(i),t=Nr.getPaddingLeft(i)+Nr.getPaddingRight(i);return i.offsetWidth-e-t}function wot(i){const e=Nr.getBorderTopWidth(i)+Nr.getBorderBottomWidth(i),t=Nr.getPaddingTop(i)+Nr.getPaddingBottom(i);return i.offsetHeight-e-t}function ep(i){const e=Nr.getMarginTop(i)+Nr.getMarginBottom(i);return i.offsetHeight+e}function ts(i,e){return!!(e!=null&&e.contains(i))}function Sot(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function x9(i,e,t){return!!Sot(i,e,t)}function N1e(i){return i&&!!i.host&&!!i.mode}function VA(i){return!!$b(i)}function $b(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return N1e(i)?i:null}function ps(){let i=zS().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function pT(i){return ps()===i}function R1e(i){return ts(ps(),i)}function zS(){var i;return got()<=1?hi.document:(i=Array.from(D1e()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&i!==void 0?i:hi.document}function xot(){var i,e;return(e=(i=zS().defaultView)===null||i===void 0?void 0:i.window)!==null&&e!==void 0?e:hi}const yY=new Map;function M1e(){return new Lot}class Lot{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=_c(hi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function _c(i=hi.document.head,e,t){const n=document.createElement("style");if(n.type="text/css",n.media="screen",e==null||e(n),i.appendChild(n),t&&t.add(Ot(()=>i.removeChild(n))),i===hi.document.head){const r=new Set;yY.set(n,r);for(const{window:o,disposables:s}of D1e()){if(o===hi)continue;const a=s.add(Eot(n,r,o));t==null||t.add(a)}}return n}function Eot(i,e,t){var n,r;const o=new Fe,s=i.cloneNode(!0);t.document.head.appendChild(s),o.add(Ot(()=>t.document.head.removeChild(s)));for(const a of A1e(i))(n=s.sheet)===null||n===void 0||n.insertRule(a.cssText,(r=s.sheet)===null||r===void 0?void 0:r.cssRules.length);return o.add(Dot.observe(i,o,{childList:!0})(()=>{s.textContent=i.textContent})),e.add(s),o.add(Ot(()=>e.delete(s))),o}const Dot=new class{constructor(){this.mutationObservers=new Map}observe(i,e,t){let n=this.mutationObservers.get(i);n||(n=new Map,this.mutationObservers.set(i,n));const r=a3(t);let o=n.get(r);if(o)o.users+=1;else{const s=new ae,a=new MutationObserver(c=>s.fire(c));a.observe(i,t);const l=o={users:1,observer:a,onDidMutate:s.event};e.add(Ot(()=>{l.users-=1,l.users===0&&(s.dispose(),a.disconnect(),n==null||n.delete(r),(n==null?void 0:n.size)===0&&this.mutationObservers.delete(i))})),n.set(r,o)}return o.onDidMutate}};let L9=null;function P1e(){return L9||(L9=_c()),L9}function A1e(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function zA(i,e,t=P1e()){var n,r;if(!(!t||!e)){(n=t.sheet)===null||n===void 0||n.insertRule(`${i} {${e}}`,0);for(const o of(r=yY.get(t))!==null&&r!==void 0?r:[])zA(i,e,o)}}function rz(i,e=P1e()){var t,n;if(!e)return;const r=A1e(e),o=[];for(let s=0;s=0;s--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[s]);for(const s of(n=yY.get(e))!==null&&n!==void 0?n:[])rz(i,s)}function Iot(i){return typeof i.selectorText=="string"}function wY(i){return i instanceof MouseEvent||i instanceof Bt(i).MouseEvent}function SY(i){return i instanceof KeyboardEvent||i instanceof Bt(i).KeyboardEvent}const Je={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:db?"webkitAnimationStart":"animationstart",ANIMATION_END:db?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:db?"webkitAnimationIteration":"animationiteration"};function kot(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const gn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function Tot(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function Not(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class UA extends me{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=$b(e),n=t?t.activeElement:e.ownerDocument.activeElement;return ts(n,e)}else{const t=e;return ts(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new ae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event;let t=UA.hasFocusWithin(e),n=!1;const r=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(n=!0,(e instanceof HTMLElement?Bt(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{UA.hasFocusWithin(e)!==t&&(t?o():r())},this._register(xe(e,Je.FOCUS,r,!0)),this._register(xe(e,Je.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(xe(e,Je.FOCUS_IN,()=>this._refreshStateHandler())),this._register(xe(e,Je.FOCUS_OUT,()=>this._refreshStateHandler())))}}function ph(i){return new UA(i)}function Rot(i,e){return i.after(e),e}function Oe(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function xY(i,e){return i.insertBefore(e,i.firstChild),e}function ms(i,...e){i.innerText="",Oe(i,...e)}const Mot=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var lI;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(lI||(lI={}));function O1e(i,e,t,...n){const r=Mot.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return i!==lI.HTML?s=document.createElementNS(i,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function Xe(i,e,...t){return O1e(lI.HTML,i,e,...t)}Xe.SVG=function(i,e,...t){return O1e(lI.SVG,i,e,...t)};function Pot(i,...e){i?Sl(...e):pa(...e)}function Sl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function pa(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function nae(i,e){const t=i.devicePixelRatio*e;return Math.max(1,Math.floor(t))/i.devicePixelRatio}function F1e(i){hi.open(i,"_blank","noopener")}function Aot(i,e){const t=()=>{e(),n=Ml(i,t)};let n=Ml(i,t);return Ot(()=>n.dispose())}L1e.setPreferredWebSchema(/^https:/.test(hi.location.href)?"https":"http");function Qv(i){return i?`url('${E1e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function iae(i){return`'${i.replace(/'/g,"%27")}'`}function bp(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=bp(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function Oot(i,e=!1){const t=document.createElement("a");return iz("afterSanitizeAttributes",n=>{for(const r of["href","src"])if(n.hasAttribute(r)){const o=n.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!i.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(r)}}}),Ot(()=>{x1e("afterSanitizeAttributes")})}const Fot=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 tp extends ae{constructor(){super(),this._subscriptions=new Fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ot.runAndSubscribe(u3,({window:e,disposables:t})=>this.registerListeners(e,t),{window:hi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(xe(e,"keydown",n=>{if(n.defaultPrevented)return;const r=new Oi(n);if(!(r.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(r.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(xe(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.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=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(xe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(xe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(xe(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(xe(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 tp.instance||(tp.instance=new tp),tp.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Bot extends me{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(xe(this.element,Je.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)===null||n===void 0||n.call(t,e)})),this.callbacks.onDrag&&this._register(xe(this.element,Je.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(xe(this.element,Je.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)===null||n===void 0||n.call(t,e))})),this._register(xe(this.element,Je.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)===null||n===void 0||n.call(t,e)}))}}const Wot=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function pi(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const r=Wot.exec(i);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(rae(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(rae(c),u.toString());return l.root=s,l}function rae(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class $ot extends me{constructor(e){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var n;(n=this._mediaQueryList)===null||n===void 0||n.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class Hot extends me{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new $ot(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),n=e.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}}class Vot{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=$A(e);let n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=new Hot(e),this.mapWindowIdToPixelRatioMonitor.set(t,n),ot.once(mot)(({vscodeWindowId:r})=>{r===t&&(n==null||n.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const cI=new Vot;class B1e{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=xd(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=xd(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=xd(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=xd(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=xd(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=xd(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=xd(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=xd(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=xd(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=xd(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=xd(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 xd(i){return typeof i=="number"?`${i}px`:i}function Jn(i){return new B1e(i)}function vs(i,e){i instanceof B1e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class zot{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class LY{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");vs(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");vs(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const r=document.createElement("div");vs(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");LY._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let n=" ";for(let r=0;r<8;r++)n+=n;e.innerText=n}else{let n=t.chr;for(let r=0;r<8;r++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),n=t.getValues();let r=!1;for(const o of n)o.isTrusted||(r=!0,t.remove(o));r&&this._onDidChange.fire()}readFontInfo(e,t){const n=this._ensureCache(e);if(!n.has(t)){let r=this._actualReadFontInfo(e,t);(r.typicalHalfwidthCharacterWidth<=2||r.typicalFullwidthCharacterWidth<=2||r.spaceWidth<=2||r.maxDigitWidth<=2)&&(r=new oz({pixelRatio:cI.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 n.get(t)}_createRequest(e,t,n,r){const o=new zot(e,t);return n.push(o),r==null||r.push(o),o}_actualReadFontInfo(e,t){const n=[],r=[],o=this._createRequest("n",0,n,r),s=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,r),l=this._createRequest("0",0,n,r),c=this._createRequest("1",0,n,r),u=this._createRequest("2",0,n,r),d=this._createRequest("3",0,n,r),h=this._createRequest("4",0,n,r),f=this._createRequest("5",0,n,r),g=this._createRequest("6",0,n,r),p=this._createRequest("7",0,n,r),m=this._createRequest("8",0,n,r),v=this._createRequest("9",0,n,r),_=this._createRequest("→",0,n,r),y=this._createRequest("→",0,n,null),S=this._createRequest("·",0,n,r),L=this._createRequest(String.fromCharCode(11825),0,n,null),E="|/-_ilm%";for(let P=0,N=E.length;P.001){k=!1;break}}let M=!0;return k&&y.width!==T&&(M=!1),y.width>_.width&&(M=!1),new oz({pixelRatio:cI.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:k,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:S.width,wsmiddotWidth:L.width,maxDigitWidth:D},!0)}}class qot{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const sz=new Got;var Zd;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Zd||(Zd={}));const Wt=Sn("instantiationService");function Xot(i,e,t){e[Zd.DI_TARGET]===e?e[Zd.DI_DEPENDENCIES].push({id:i,index:t}):(e[Zd.DI_DEPENDENCIES]=[{id:i,index:t}],e[Zd.DI_TARGET]=e)}function Sn(i){if(Zd.serviceIds.has(i))return Zd.serviceIds.get(i);const e=function(t,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Xot(e,t,r)};return e.toString=()=>i,Zd.serviceIds.set(i,e),e}const jn=Sn("codeEditorService"),rr=Sn("modelService"),ul=Sn("textModelService");class Il extends me{constructor(e,t="",n="",r=!0,o){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Hb extends me{constructor(){super(...arguments),this._onWillRun=this._register(new ae),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new ae),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(r){n=r}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}}class ho{constructor(){this.id=ho.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new ho,...n]:t=n);return t}async run(){}}ho.ID="vs.actions.separator";class jw{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}}class h3 extends Il{constructor(){super(h3.ID,w("submenu.empty","(empty)"),void 0,!1)}}h3.ID="vs.actions.empty";function Yy(i){var e;return{id:i.id,label:i.label,class:i.class,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:i.checked,run:async(...t)=>i.run(...t),tooltip:i.label}}var az;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(az||(az={}));var Vt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(tt.error);const[,g,p]=f,m=["codicon","codicon-"+g];return p&&m.push("codicon-modifier-"+p.substring(1)),m}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function r(h){return"."+t(h).join(".")}i.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||az.isThemeColor(h.color))}i.isThemeIcon=o;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Vt||(Vt={}));const cr=Sn("commandService"),kn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ae,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.metadata&&Array.isArray(i.metadata.args)){const s=[];for(const l of i.metadata.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return dnt(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new Ca,this._commands.set(t,n));const r=n.unshift(i),o=Ot(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(i,e){return kn.registerCommand(i,(t,...n)=>t.get(cr).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return In.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};kn.registerCommand("noop",()=>{});function D9(...i){switch(i.length){case 1:return w("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return w("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return w("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const Yot=w("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Zot=w("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let E0=class lz{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 eY(`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(D9("==","=~"));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(D9("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(D9("||"));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,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,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),n=lz._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Yot);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,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Zot);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!n){e++;break}else o===91?n=!0:o===92?t=!0:o===93&&(n=!1);e++}for(;e=this._input.length}};E0._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));E0._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Bs=new Map;Bs.set("false",!1);Bs.set("true",!0);Bs.set("isMac",Dn);Bs.set("isLinux",ka);Bs.set("isWindows",Os);Bs.set("isWeb",I_);Bs.set("isMacNative",Dn&&!I_);Bs.set("isEdge",Ent);Bs.set("isFirefox",xnt);Bs.set("isChrome",WCe);Bs.set("isSafari",Lnt);const Qot=Object.prototype.hasOwnProperty,Jot={regexParsingWithErrorRecovery:!0},est=w("contextkey.parser.error.emptyString","Empty context key expression"),tst=w("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."),nst=w("contextkey.parser.error.noInAfterNot","'in' after 'not'."),oae=w("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ist=w("contextkey.parser.error.unexpectedToken","Unexpected token"),rst=w("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),ost=w("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),sst=w("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let W1e=class VL{constructor(e=Jot){this._config=e,this._scanner=new E0,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:est,offset:0,lexeme:"",additionalInfo:tst});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),r=n.type===17?rst:void 0;throw this._parsingErrors.push({message:ist,offset:n.offset,lexeme:E0.getLexeme(n),additionalInfo:r}),VL._parseError}return t}catch(t){if(t!==VL._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]:Re.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Re.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Ta.INSTANCE;case 12:return this._advance(),ol.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,oae),t==null?void 0:t.negate()}case 17:return this._advance(),bC.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(),Re.true();case 12:return this._advance(),Re.false();case 0:{this._advance();const t=this._expr();return this._consume(1,oae),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return uI.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return uI.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,nst);const r=this._value();return Re.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return Re.equals(t,r);switch(r){case"true":return Re.has(t);case"false":return Re.not(t);default:return Re.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return Re.notEquals(t,r);switch(r){case"true":return Re.not(t);case"false":return Re.has(t);default:return Re.notEquals(t,r)}}case 5:return this._advance(),b3.create(t,this._value());case 6:return this._advance(),C3.create(t,this._value());case 7:return this._advance(),v3.create(t,this._value());case 8:return this._advance(),_3.create(t,this._value());case 13:return this._advance(),Re.in(t,this._value());default:return Re.has(t)}}case 20:throw this._parsingErrors.push({message:ost,offset:e.offset,lexeme:"",additionalInfo:sst}),VL._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class d9{constructor(e){this.value=e}}const Dit=2;let ae=class{constructor(e){var t,n,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new Eit((r=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&r!==void 0?r:Lit):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new Vw(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),me.None;if(this._disposed)return me.None;n&&(t=t.bind(n));const u=new d9(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=iY.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof d9?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new jCe),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ot(()=>{d==null||d(),this._removeListener(u)});return r instanceof Fe?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,n,r,o;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*Dit<=s.length){let c=0;for(let u=0;u0}};const Iit=()=>new jCe;class jCe{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Ob extends ae{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ca,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 KCe extends Ob{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class kit extends ae{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 Tit{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new ae({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),Ot(qv(()=>{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===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class rY{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,o)):t.call(n,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(r=>r()),n}}class Fse{constructor(){this.listening=!1,this.inputEvent=ot.None,this.inputEventListener=me.None,this.emitter=new ae({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 GCe=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var wn;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof AM?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ot.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:GCe})})(wn||(wn={}));class AM{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?GCe:(this._emitter||(this._emitter=new ae),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let xr=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 AM),this._token}cancel(){this._token?this._token instanceof AM&&this._token.cancel():this._token=wn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof AM&&this._token.dispose():this._token=wn.None}};class oY{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 OM=new oY,tV=new oY,nV=new oY,qCe=new Array(230),Nit=Object.create(null),Rit=Object.create(null),sY=[];for(let i=0;i<=193;i++)sY[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[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,i,0,i,i,i],[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",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const r of e){const[o,s,a,l,c,u,d,h,f]=r;if(n[s]||(n[s]=!0,Nit[a]=s,Rit[a.toLowerCase()]=s,o&&(sY[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);OM.define(l,c),tV.define(l,h||c),nV.define(l,f||h||c)}u&&(qCe[u]=l)}})();var Vg;(function(i){function e(a){return OM.keyCodeToStr(a)}i.toString=e;function t(a){return OM.strToKeyCode(a)}i.fromString=t;function n(a){return tV.keyCodeToStr(a)}i.toUserSettingsUS=n;function r(a){return nV.keyCodeToStr(a)}i.toUserSettingsGeneral=r;function o(a){return tV.strToKeyCode(a)||nV.strToKeyCode(a)}i.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return OM.keyCodeToStr(a)}i.toElectronAccelerator=s})(Vg||(Vg={}));function fo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let Xy;const h9=globalThis.vscode;if(typeof h9<"u"&&typeof h9.process<"u"){const i=h9.process;Xy={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"?Xy={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Xy={get platform(){return Os?"win32":Dn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const TA=Xy.cwd,iV=Xy.env,Mit=Xy.platform,Pit=65,Ait=97,Oit=90,Fit=122,xv=46,Ks=47,Xl=92,hm=58,Bit=63;class XCe extends Error{constructor(e,t,n){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function Wit(i,e){if(i===null||typeof i!="object")throw new XCe(e,"Object",i)}function Fo(i,e){if(typeof i!="string")throw new XCe(e,"string",i)}const N_=Mit==="win32";function li(i){return i===Ks||i===Xl}function rV(i){return i===Ks}function fm(i){return i>=Pit&&i<=Oit||i>=Ait&&i<=Fit}function NA(i,e,t,n){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${i.slice(s+1,c)}`:r=i.slice(s+1,c),o=c-s-1;s=c,a=0}else l===xv&&a!==-1?++a:a=-1}return r}function YCe(i,e){Wit(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const El={resolve(...i){let e="",t="",n=!1;for(let r=i.length-1;r>=-1;r--){let o;if(r>=0){if(o=i[r],Fo(o,"path"),o.length===0)continue}else e.length===0?o=TA():(o=iV[`=${e}`]||TA(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Xl)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(o.charCodeAt(1))){let d=2,h=d;for(;d2&&li(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=NA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){Fo(i,"path");const e=i.length;if(e===0)return".";let t=0,n,r=!1;const o=i.charCodeAt(0);if(e===1)return rV(o)?"\\":i;if(li(o))if(r=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(r=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?r?`\\${s}`:s:r?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){Fo(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&fm(t)&&i.charCodeAt(1)===hm&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,r=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++r;const o=t.length;o>1&&li(t.charCodeAt(1))&&(++r,o>2&&(li(t.charCodeAt(2))?++r:n=!1))}if(n){for(;r=2&&(e=`\\${e.slice(r)}`)}return El.normalize(e)},relative(i,e){if(Fo(i,"from"),Fo(e,"to"),i===e)return"";const t=El.resolve(i),n=El.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let r=0;for(;rr&&i.charCodeAt(o-1)===Xl;)o--;const s=o-r;let a=0;for(;aa&&e.charCodeAt(l-1)===Xl;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===Xl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(r+h)===Xl?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||i.charCodeAt(h)===Xl)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Xl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=El.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Xl){if(e.charCodeAt(1)===Xl){const t=e.charCodeAt(2);if(t!==Bit&&t!==xv)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fm(e.charCodeAt(0))&&e.charCodeAt(1)===hm&&e.charCodeAt(2)===Xl)return`\\\\?\\${e}`;return i},dirname(i){Fo(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const r=i.charCodeAt(0);if(e===1)return li(r)?i:".";if(li(r)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let o=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return i.slice(0,o)},basename(i,e){e!==void 0&&Fo(e,"ext"),Fo(i,"path");let t=0,n=-1,r=!0,o;if(i.length>=2&&fm(i.charCodeAt(0))&&i.charCodeAt(1)===hm&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=t;--o){const l=i.charCodeAt(o);if(li(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=t;--o)if(li(i.charCodeAt(o))){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Fo(i,"path");let e=0,t=-1,n=0,r=-1,o=!0,s=0;i.length>=2&&i.charCodeAt(1)===hm&&fm(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!o){n=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===xv?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===n+1?"":i.slice(t,r)},format:YCe.bind(null,"\\"),parse(i){Fo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,r=i.charCodeAt(0);if(t===1)return li(r)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(r)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let o=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(r=i.charCodeAt(c),li(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===xv?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,o),e.base=i.slice(s,a),e.ext=i.slice(o,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},$it=(()=>{if(N_){const i=/\\/g;return()=>{const e=TA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>TA()})(),lo={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const r=n>=0?i[n]:$it();Fo(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Ks)}return e=NA(e,!t,"/",rV),t?`/${e}`:e.length>0?e:"."},normalize(i){if(Fo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ks,t=i.charCodeAt(i.length-1)===Ks;return i=NA(i,!e,"/",rV),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return Fo(i,"path"),i.length>0&&i.charCodeAt(0)===Ks},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":lo.normalize(e)},relative(i,e){if(Fo(i,"from"),Fo(e,"to"),i===e||(i=lo.resolve(i),e=lo.resolve(e),i===e))return"";const t=1,n=i.length,r=n-t,o=1,s=e.length-o,a=ra){if(e.charCodeAt(o+c)===Ks)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(i.charCodeAt(t+c)===Ks?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Ks)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(i){return i},dirname(i){if(Fo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ks;let t=-1,n=!0;for(let r=i.length-1;r>=1;--r)if(i.charCodeAt(r)===Ks){if(!n){t=r;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&Fo(e,"ext"),Fo(i,"path");let t=0,n=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=0;--o){const l=i.charCodeAt(o);if(l===Ks){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=0;--o)if(i.charCodeAt(o)===Ks){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Fo(i,"path");let e=-1,t=0,n=-1,r=!0,o=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===Ks){if(!r){t=s+1;break}continue}n===-1&&(r=!1,n=s+1),a===xv?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||n===-1||o===0||o===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:YCe.bind(null,"/"),parse(i){Fo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Ks;let n;t?(e.root="/",n=1):n=0;let r=-1,o=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===Ks){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===xv?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,r),e.base=i.slice(u,s),e.ext=i.slice(r,s))}return o>0?e.dir=i.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};lo.win32=El.win32=El;lo.posix=El.posix=lo;const ZCe=N_?El.normalize:lo.normalize,Hit=N_?El.resolve:lo.resolve,Vit=N_?El.relative:lo.relative,QCe=N_?El.dirname:lo.dirname,Lv=N_?El.basename:lo.basename,zit=N_?El.extname:lo.extname,ih=N_?El.sep:lo.sep,Uit=/^\w[\w\d+.-]*$/,jit=/^\//,Kit=/^\/\//;function Git(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!Uit.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!jit.test(i.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(Kit.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function qit(i,e){return!i&&!e?"file":i}function Xit(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Vd&&(e=Vd+e):e=Vd;break}return e}const Wr="",Vd="/",Yit=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Ft{static isUri(e){return e instanceof Ft?!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,n,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||Wr,this.authority=e.authority||Wr,this.path=e.path||Wr,this.query=e.query||Wr,this.fragment=e.fragment||Wr):(this.scheme=qit(e,s),this.authority=t||Wr,this.path=Xit(this.scheme,n||Wr),this.query=r||Wr,this.fragment=o||Wr,Git(this,s))}get fsPath(){return RA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Wr),n===void 0?n=this.authority:n===null&&(n=Wr),r===void 0?r=this.path:r===null&&(r=Wr),o===void 0?o=this.query:o===null&&(o=Wr),s===void 0?s=this.fragment:s===null&&(s=Wr),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new h1(t,n,r,o,s)}static parse(e,t=!1){const n=Yit.exec(e);return n?new h1(n[2]||Wr,BR(n[4]||Wr),BR(n[5]||Wr),BR(n[7]||Wr),BR(n[9]||Wr),t):new h1(Wr,Wr,Wr,Wr,Wr)}static file(e){let t=Wr;if(Os&&(e=e.replace(/\\/g,Vd)),e[0]===Vd&&e[1]===Vd){const n=e.indexOf(Vd,2);n===-1?(t=e.substring(2),e=Vd):(t=e.substring(2,n),e=e.substring(n)||Vd)}return new h1("file",t,e,Wr,Wr)}static from(e,t){return new h1(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 n;return Os&&e.scheme==="file"?n=Ft.file(El.join(RA(e,!0),...t)).path:n=lo.join(e.path,...t),e.with({path:n})}toString(e=!1){return oV(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Ft)return e;{const r=new h1(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===JCe&&(n=e.fsPath)!==null&&n!==void 0?n:null,r}}else return e}}const JCe=Os?1:void 0;let h1=class extends Ft{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=RA(this,!1)),this._fsPath}toString(e=!1){return e?oV(this,!0):(this._formatted||(this._formatted=oV(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=JCe),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 e1e={[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 Bse(i,e,t){let n,r=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n!==void 0&&(n+=i.charAt(o));else{n===void 0&&(n=i.substr(0,o));const a=e1e[s];a!==void 0?(r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n+=a):r===-1&&(r=o)}}return r!==-1&&(n+=encodeURIComponent(i.substring(r))),n!==void 0?n:i}function Zit(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,Os&&(t=t.replace(/\//g,"\\")),t}function oV(i,e){const t=e?Zit:Bse;let n="",{scheme:r,authority:o,path:s,query:a,fragment:l}=i;if(r&&(n+=r,n+=":"),(o||r==="file")&&(n+=Vd,n+=Vd),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?n+=t(o,!1,!0):(n+=t(o.substr(0,c),!1,!0),n+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:Bse(l,!1,!1)),n}function t1e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+t1e(i.substr(3)):i}}const Wse=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BR(i){return i.match(Wse)?i.replace(Wse,e=>t1e(e)):i}let le=class b0{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 b0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return b0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return b0.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return Go.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Go.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Go.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return Go.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Go.plusRange(this,e)}static plusRange(e,t){let n,r,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Go(n,r,o,s)}intersectRanges(e){return Go.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(o=c,s=u):o===c&&(s=Math.min(s,u)),n>o||n===o&&r>s?null:new Go(n,r,o,s)}equalsRange(e){return Go.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 Go.getEndPosition(this)}static getEndPosition(e){return new le(e.endLineNumber,e.endColumn)}getStartPosition(){return Go.getStartPosition(this)}static getStartPosition(e){return new le(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Go(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Go(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Go.collapseToStart(this)}static collapseToStart(e){return new Go(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Go.collapseToEnd(this)}static collapseToEnd(e){return new Go(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Go(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Go(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Go(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.endLineNumbere.startLineNumber}toJSON(){return this}},Et=class Au extends W{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Au.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 Au(this.startLineNumber,this.startColumn,e,t):new Au(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new le(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new le(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Au(e,t,this.endLineNumber,this.endColumn):new Au(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Au(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Au(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Au(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Au(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const r=new Jit(this,e,t);return this._factories.set(e,r),Ot(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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 Jit extends me{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,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 iI=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class aY{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class o3{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var rI;(function(i){const e=new Map;e.set(0,tt.symbolMethod),e.set(1,tt.symbolFunction),e.set(2,tt.symbolConstructor),e.set(3,tt.symbolField),e.set(4,tt.symbolVariable),e.set(5,tt.symbolClass),e.set(6,tt.symbolStruct),e.set(7,tt.symbolInterface),e.set(8,tt.symbolModule),e.set(9,tt.symbolProperty),e.set(10,tt.symbolEvent),e.set(11,tt.symbolOperator),e.set(12,tt.symbolUnit),e.set(13,tt.symbolValue),e.set(15,tt.symbolEnum),e.set(14,tt.symbolConstant),e.set(15,tt.symbolEnum),e.set(16,tt.symbolEnumMember),e.set(17,tt.symbolKeyword),e.set(27,tt.symbolSnippet),e.set(18,tt.symbolText),e.set(19,tt.symbolColor),e.set(20,tt.symbolFile),e.set(21,tt.symbolReference),e.set(22,tt.symbolCustomColor),e.set(23,tt.symbolFolder),e.set(24,tt.symbolTypeParameter),e.set(25,tt.account),e.set(26,tt.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=tt.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function r(o,s){let a=n.get(o);return typeof a>"u"&&!s&&(a=9),a}i.fromString=r})(rI||(rI={}));var _p;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(_p||(_p={}));class i1e{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return W.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Af;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(Af||(Af={}));var oI;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(oI||(oI={}));function ert(i){return i&&Ft.isUri(i.uri)&&W.isIRange(i.range)&&(W.isIRange(i.originSelectionRange)||W.isIRange(i.targetSelectionRange))}const trt={[17]:w("Array","array"),[16]:w("Boolean","boolean"),[4]:w("Class","class"),[13]:w("Constant","constant"),[8]:w("Constructor","constructor"),[9]:w("Enum","enumeration"),[21]:w("EnumMember","enumeration member"),[23]:w("Event","event"),[7]:w("Field","field"),[0]:w("File","file"),[11]:w("Function","function"),[10]:w("Interface","interface"),[19]:w("Key","key"),[5]:w("Method","method"),[1]:w("Module","module"),[2]:w("Namespace","namespace"),[20]:w("Null","null"),[15]:w("Number","number"),[18]:w("Object","object"),[24]:w("Operator","operator"),[3]:w("Package","package"),[6]:w("Property","property"),[14]:w("String","string"),[22]:w("Struct","struct"),[25]:w("TypeParameter","type parameter"),[12]:w("Variable","variable")};function nrt(i,e){return w("symbolAriaLabel","{0} ({1})",i,trt[e])}var MA;(function(i){const e=new Map;e.set(0,tt.symbolFile),e.set(1,tt.symbolModule),e.set(2,tt.symbolNamespace),e.set(3,tt.symbolPackage),e.set(4,tt.symbolClass),e.set(5,tt.symbolMethod),e.set(6,tt.symbolProperty),e.set(7,tt.symbolField),e.set(8,tt.symbolConstructor),e.set(9,tt.symbolEnum),e.set(10,tt.symbolInterface),e.set(11,tt.symbolFunction),e.set(12,tt.symbolVariable),e.set(13,tt.symbolConstant),e.set(14,tt.symbolString),e.set(15,tt.symbolNumber),e.set(16,tt.symbolBoolean),e.set(17,tt.symbolArray),e.set(18,tt.symbolObject),e.set(19,tt.symbolKey),e.set(20,tt.symbolNull),e.set(21,tt.symbolEnumMember),e.set(22,tt.symbolStruct),e.set(23,tt.symbolEvent),e.set(24,tt.symbolOperator),e.set(25,tt.symbolTypeParameter);function t(n){let r=e.get(n);return r||(console.info("No codicon found for SymbolKind "+n),r=tt.symbolProperty),r}i.toIcon=t})(MA||(MA={}));class ya{static fromValue(e){switch(e){case"comment":return ya.Comment;case"imports":return ya.Imports;case"region":return ya.Region}return new ya(e)}constructor(e){this.value=e}}ya.Comment=new ya("comment");ya.Imports=new ya("imports");ya.Region=new ya("region");var $se;(function(i){i[i.AIGenerated=1]="AIGenerated"})($se||($se={}));var aV;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(aV||(aV={}));var PA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(PA||(PA={}));class irt{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 gr=new Qit;var AA;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(AA||(AA={}));var lV;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(lV||(lV={}));var cV;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(cV||(cV={}));var uV;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(uV||(uV={}));var dV;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(dV||(dV={}));var hV;(function(i){i[i.Deprecated=1]="Deprecated"})(hV||(hV={}));var fV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(fV||(fV={}));var gV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(gV||(gV={}));var pV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(pV||(pV={}));var mV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(mV||(mV={}));var vV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(vV||(vV={}));var _V;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(_V||(_V={}));var bV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.inlineEdit=63]="inlineEdit",i[i.letterSpacing=64]="letterSpacing",i[i.lightbulb=65]="lightbulb",i[i.lineDecorationsWidth=66]="lineDecorationsWidth",i[i.lineHeight=67]="lineHeight",i[i.lineNumbers=68]="lineNumbers",i[i.lineNumbersMinChars=69]="lineNumbersMinChars",i[i.linkedEditing=70]="linkedEditing",i[i.links=71]="links",i[i.matchBrackets=72]="matchBrackets",i[i.minimap=73]="minimap",i[i.mouseStyle=74]="mouseStyle",i[i.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=76]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",i[i.multiCursorModifier=78]="multiCursorModifier",i[i.multiCursorPaste=79]="multiCursorPaste",i[i.multiCursorLimit=80]="multiCursorLimit",i[i.occurrencesHighlight=81]="occurrencesHighlight",i[i.overviewRulerBorder=82]="overviewRulerBorder",i[i.overviewRulerLanes=83]="overviewRulerLanes",i[i.padding=84]="padding",i[i.pasteAs=85]="pasteAs",i[i.parameterHints=86]="parameterHints",i[i.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",i[i.quickSuggestions=89]="quickSuggestions",i[i.quickSuggestionsDelay=90]="quickSuggestionsDelay",i[i.readOnly=91]="readOnly",i[i.readOnlyMessage=92]="readOnlyMessage",i[i.renameOnType=93]="renameOnType",i[i.renderControlCharacters=94]="renderControlCharacters",i[i.renderFinalNewline=95]="renderFinalNewline",i[i.renderLineHighlight=96]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=98]="renderValidationDecorations",i[i.renderWhitespace=99]="renderWhitespace",i[i.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",i[i.roundedSelection=101]="roundedSelection",i[i.rulers=102]="rulers",i[i.scrollbar=103]="scrollbar",i[i.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=105]="scrollBeyondLastLine",i[i.scrollPredominantAxis=106]="scrollPredominantAxis",i[i.selectionClipboard=107]="selectionClipboard",i[i.selectionHighlight=108]="selectionHighlight",i[i.selectOnLineNumbers=109]="selectOnLineNumbers",i[i.showFoldingControls=110]="showFoldingControls",i[i.showUnused=111]="showUnused",i[i.snippetSuggestions=112]="snippetSuggestions",i[i.smartSelect=113]="smartSelect",i[i.smoothScrolling=114]="smoothScrolling",i[i.stickyScroll=115]="stickyScroll",i[i.stickyTabStops=116]="stickyTabStops",i[i.stopRenderingLineAfter=117]="stopRenderingLineAfter",i[i.suggest=118]="suggest",i[i.suggestFontSize=119]="suggestFontSize",i[i.suggestLineHeight=120]="suggestLineHeight",i[i.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",i[i.suggestSelection=122]="suggestSelection",i[i.tabCompletion=123]="tabCompletion",i[i.tabIndex=124]="tabIndex",i[i.unicodeHighlighting=125]="unicodeHighlighting",i[i.unusualLineTerminators=126]="unusualLineTerminators",i[i.useShadowDOM=127]="useShadowDOM",i[i.useTabStops=128]="useTabStops",i[i.wordBreak=129]="wordBreak",i[i.wordSeparators=130]="wordSeparators",i[i.wordWrap=131]="wordWrap",i[i.wordWrapBreakAfterCharacters=132]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=133]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=134]="wordWrapColumn",i[i.wordWrapOverride1=135]="wordWrapOverride1",i[i.wordWrapOverride2=136]="wordWrapOverride2",i[i.wrappingIndent=137]="wrappingIndent",i[i.wrappingStrategy=138]="wrappingStrategy",i[i.showDeprecated=139]="showDeprecated",i[i.inlayHints=140]="inlayHints",i[i.editorClassName=141]="editorClassName",i[i.pixelRatio=142]="pixelRatio",i[i.tabFocusMode=143]="tabFocusMode",i[i.layoutInfo=144]="layoutInfo",i[i.wrappingInfo=145]="wrappingInfo",i[i.defaultColorDecorators=146]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=147]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=148]="inlineCompletionsAccessibilityVerbose"})(bV||(bV={}));var CV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(CV||(CV={}));var yV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(yV||(yV={}));var wV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(wV||(wV={}));var SV;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(SV||(SV={}));var xV;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(xV||(xV={}));var LV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(LV||(LV={}));var EV;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(EV||(EV={}));var DV;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(DV||(DV={}));var IV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(IV||(IV={}));var kV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(kV||(kV={}));var TV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(TV||(TV={}));var NV;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(NV||(NV={}));var RV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(RV||(RV={}));var MV;(function(i){i[i.AIGenerated=1]="AIGenerated"})(MV||(MV={}));var PV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(PV||(PV={}));var AV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(AV||(AV={}));var OV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(OV||(OV={}));var FV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(FV||(FV={}));var BV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(BV||(BV={}));var WV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(WV||(WV={}));var $V;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})($V||($V={}));var HV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(HV||(HV={}));var VV;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(VV||(VV={}));var zV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(zV||(zV={}));var UV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(UV||(UV={}));var jV;(function(i){i[i.Deprecated=1]="Deprecated"})(jV||(jV={}));var KV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(KV||(KV={}));var GV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(GV||(GV={}));var qV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(qV||(qV={}));var XV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(XV||(XV={}));let cT=class{static chord(e,t){return fo(e,t)}};cT.CtrlCmd=2048;cT.Shift=1024;cT.Alt=512;cT.WinCtrl=256;function r1e(){return{editor:void 0,languages:void 0,CancellationTokenSource:xr,Emitter:ae,KeyCode:IV,KeyMod:cT,Position:le,Range:W,Selection:Et,SelectionDirection:HV,MarkerSeverity:kV,MarkerTag:TV,Uri:Ft,Token:iI}}function rrt(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const hi=window,ort=hi;class srt{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class Hse{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class tg{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var zw;function o1e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const art=/{(\d+)}/g;function Fb(i,...e){return e.length===0?i:i.replace(art,function(t,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function lrt(i){return i.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function OA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function vc(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function crt(i,e=" "){const t=uT(i,e);return s1e(t,e)}function uT(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function s1e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let r=n,o=-1;for(;o=i.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return i.substring(0,r)}function urt(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function drt(i){return i.replace(/\*/g,"")}function a1e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=vc(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function hrt(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function ng(i){return i.split(/\r\n|\r|\n/)}function frt(i){var e;const t=[],n=i.split(/(\r\n|\r|\n)/);for(let r=0;r=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function sI(i,e){return ie?1:0}function lY(i,e,t=0,n=i.length,r=0,o=e.length){for(;tc)return 1}const s=n-t,a=o-r;return sa?1:0}function YV(i,e){return dT(i,e,0,i.length,0,e.length)}function dT(i,e,t=0,n=i.length,r=0,o=e.length){for(;t=128||c>=128)return lY(i.toLowerCase(),e.toLowerCase(),t,n,r,o);Zm(l)&&(l-=32),Zm(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=o-r;return sa?1:0}function WR(i){return i>=48&&i<=57}function Zm(i){return i>=97&&i<=122}function af(i){return i>=65&&i<=90}function dy(i,e){return i.length===e.length&&dT(i,e)===0}function cY(i,e){const t=e.length;return e.length>i.length?!1:dT(i,e,0,t)===0}function Xv(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(Do(n))return uY(n,t)}return t}class dY{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=grt(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=BA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class WA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new dY(e,t)}nextGraphemeLength(){const e=Qm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Vse(r,s)){t.setOffset(o);break}r=s}return t.offset-n}prevGraphemeLength(){const e=Qm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Vse(s,r)){t.setOffset(o);break}r=s}return n-t.offset}eol(){return this._iterator.eol()}}function hY(i,e){return new WA(i,e).nextGraphemeLength()}function l1e(i,e){return new WA(i,e).prevGraphemeLength()}function prt(i,e){e>0&&Bb(i.charCodeAt(e))&&e--;const t=e+hY(i,e);return[t-l1e(i,t),t]}let f9;function mrt(){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 Uw(i){return f9||(f9=mrt()),f9.test(i)}const vrt=/^[\t\n\r\x20-\x7E]*$/;function hT(i){return vrt.test(i)}const c1e=/[\u2028\u2029]/;function u1e(i){return c1e.test(i)}function Yv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function fY(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const _rt=String.fromCharCode(65279);function gY(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function brt(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function d1e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Vse(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class Qm{static getInstance(){return Qm._INSTANCE||(Qm._INSTANCE=new Qm),Qm._INSTANCE}constructor(){this._data=Crt()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}Qm._INSTANCE=null;function Crt(){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 yrt(i,e){if(i===0)return 0;const t=wrt(i,e);if(t!==void 0)return t;const n=new dY(e,i);return n.prevCodePoint(),n.offset}function wrt(i,e){const t=new dY(e,i);let n=t.prevCodePoint();for(;Srt(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!fY(n))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function Srt(i){return 127995<=i&&i<=127999}const h1e=" ";class Wb{static getInstance(e){return zw.cache.get(Array.from(e))}static getLocales(){return zw._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())}}zw=Wb;Wb.ambiguousCharacterData=new tg(()=>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]}'));Wb.cache=new srt(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=n(s,u)}const a=e(r._common),l=t(a,s);return new zw(l)});Wb._locales=new tg(()=>Object.keys(zw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class Of{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(Of.getRawData())),this._data}static isInvisibleCharacter(e){return Of.getData().has(e)}static get codePoints(){return Of.getData()}}Of._data=void 0;class ZV{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}ZV.INSTANCE=new ZV;function f1e(i,e,t){typeof e=="string"&&(e=i.matchMedia(e)),e.addEventListener("change",t)}function xrt(i){return ZV.INSTANCE.getZoomFactor(i)}const VS=navigator.userAgent,lu=VS.indexOf("Firefox")>=0,hb=VS.indexOf("AppleWebKit")>=0,fT=VS.indexOf("Chrome")>=0,Fp=!fT&&VS.indexOf("Safari")>=0,g1e=!fT&&!Fp&&hb;VS.indexOf("Electron/")>=0;const zse=VS.indexOf("Android")>=0;let FM=!1;if(typeof hi.matchMedia=="function"){const i=hi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=hi.matchMedia("(display-mode: fullscreen)");FM=i.matches,f1e(hi,i,({matches:t})=>{FM&&e.matches||(FM=t)})}function Lrt(){return FM}const pY={clipboard:{writeText:nh||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:nh||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>nh||Lrt()?0:navigator.keyboard||Fp?1:2)(),touch:"ontouchstart"in hi||navigator.maxTouchPoints>0,pointerEvents:hi.PointerEvent&&("ontouchstart"in hi||navigator.maxTouchPoints>0)};function QV(i,e){if(typeof i=="number"){if(i===0)return null;const t=(i&65535)>>>0,n=(i&4294901760)>>>16;return n!==0?new g9([$R(t,e),$R(n,e)]):new g9([$R(t,e)])}else{const t=[];for(let n=0;n{const s=e.token.onCancellationRequested(()=>{s.dispose(),o(new T_)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return n.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return n.finally(r)}}}function gT(i,e,t){return new Promise((n,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),n(t)});i.then(n,r).finally(()=>o.dispose())})}class Art{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,n(r)})})}dispose(){this.isDisposed=!0}}const Ort=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},Frt=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class ad{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const n=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===p1e?Frt(n):Ort(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new T_),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class m1e{constructor(e){this.delayer=new ad(e),this.throttler=new Art}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Zv(i,e){return e?new Promise((t,n)=>{const r=setTimeout(()=>{o.dispose(),t()},i),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),n(new T_)})}):No(t=>Zv(i,t))}function Qv(i,e=0,t){const n=setTimeout(()=>{i(),t&&r.dispose()},e),r=Ot(()=>{clearTimeout(n),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function mY(i,e=n=>!!n,t=null){let n=0;const r=i.length,o=()=>{if(n>=r)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class gd{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class vY{constructor(){this.disposable=void 0}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){this.cancel();const r=n.setInterval(()=>{e()},t);this.disposable=Ot(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel()}}class mi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let v1e,AE;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?AE=(i,e)=>{FCe(()=>{if(t)return;const n=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:AE=(i,e,t)=>{const n=i.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let r=!1;return{dispose(){r||(r=!0,i.cancelIdleCallback(n))}}},v1e=i=>AE(globalThis,i)})();class _1e{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=AE(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 Brt extends _1e{constructor(e){super(globalThis,e)}}class s3{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new T_)}}var ez;(function(i){async function e(n){let r;const o=await Promise.all(n.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o}i.settled=e;function t(n){return new Promise(async(r,o)=>{try{await n(r,o)}catch(s){o(s)}})}i.withAsyncBody=t})(ez||(ez={}));class Xr{static fromArray(e){return new Xr(t=>{t.emitMany(e)})}static fromPromise(e){return new Xr(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Xr(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new Xr(async t=>{await Promise.all(e.map(async n=>{for await(const r of n)t.emitOne(r)}))})}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new ae,queueMicrotask(async()=>{const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{for await(const r of e)n.emitOne(t(r))})}map(e){return Xr.map(this,e)}static filter(e,t){return new Xr(async n=>{for await(const r of e)t(r)&&n.emitOne(r)})}filter(e){return Xr.filter(this,e)}static coalesce(e){return Xr.filter(e,t=>!!t)}coalesce(){return Xr.coalesce(this)}static async toPromise(e){const t=[];for await(const n of e)t.push(n);return t}toPromise(){return Xr.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())}}Xr.EMPTY=Xr.fromArray([]);class Wrt extends Xr{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function $rt(i){const e=new xr,t=i(e.token);return new Wrt(e,async n=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),n.reject(new T_)});try{for await(const o of t){if(e.token.isCancellationRequested)return;n.emitOne(o)}r.dispose(),e.dispose()}catch(o){r.dispose(),e.dispose(),n.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:b1e,setPrototypeOf:jse,isFrozen:Hrt,getPrototypeOf:Vrt,getOwnPropertyDescriptor:zrt}=Object;let{freeze:Rl,seal:gh,create:Urt}=Object,{apply:tz,construct:nz}=typeof Reflect<"u"&&Reflect;tz||(tz=function(e,t,n){return e.apply(t,n)});Rl||(Rl=function(e){return e});gh||(gh=function(e){return e});nz||(nz=function(e,t){return new e(...t)});const jrt=ld(Array.prototype.forEach),Kse=ld(Array.prototype.pop),Jx=ld(Array.prototype.push),BM=ld(String.prototype.toLowerCase),p9=ld(String.prototype.toString),Krt=ld(String.prototype.match),Sd=ld(String.prototype.replace),Grt=ld(String.prototype.indexOf),qrt=ld(String.prototype.trim),$c=ld(RegExp.prototype.test),eL=Xrt(TypeError);function ld(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r/gm),eot=gh(/\${[\w\W]*}/gm),tot=gh(/^data-[\-\w.\u00B7-\uFFFF]/),not=gh(/^aria-[\-\w]+$/),C1e=gh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iot=gh(/^(?:\w+script|data):/i),rot=gh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y1e=gh(/^html$/i);var Zse=Object.freeze({__proto__:null,MUSTACHE_EXPR:Qrt,ERB_EXPR:Jrt,TMPLIT_EXPR:eot,DATA_ATTR:tot,ARIA_ATTR:not,IS_ALLOWED_URI:C1e,IS_SCRIPT_OR_DATA:iot,ATTR_WHITESPACE:rot,DOCTYPE_NAME:y1e});const oot=()=>typeof window>"u"?null:window,sot=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function w1e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oot();const e=Ut=>w1e(Ut);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:r}=i;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=HR(g,"cloneNode"),m=HR(g,"nextSibling"),v=HR(g,"childNodes"),_=HR(g,"parentNode");if(typeof s=="function"){const Ut=r.createElement("template");Ut.content&&Ut.content.ownerDocument&&(r=Ut.content.ownerDocument)}let y,S="";const{implementation:L,createNodeIterator:E,createDocumentFragment:D,getElementsByTagName:k}=r,{importNode:T}=t;let M={};e.isSupported=typeof b1e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:N,TMPLIT_EXPR:R,DATA_ATTR:O,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:G}=Zse;let{IS_ALLOWED_URI:U}=Zse,j=null;const ie=di({},[...Gse,...m9,...v9,..._9,...qse]);let Y=null;const J=di({},[...Xse,...b9,...Yse,...VR]);let Q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,ge=null,ye=!0,be=!0,Ge=!1,nt=!0,je=!1,_e=!1,Ve=!1,Le=!1,Pe=!1,Be=!1,Qe=!1,Ye=!0,We=!1;const dt="user-content-";let re=!0,ue=!1,de={},z=null;const q=di({},["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 se=null;const ne=di({},["audio","video","img","source","image","track"]);let pe=null;const ke=di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ce="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ie=fe,Te=!1,He=null;const Me=di({},[oe,ce,fe],p9);let bt;const rt=["application/xhtml+xml","text/html"],Ht="text/html";let Ue,Ct=null;const Dt=r.createElement("form"),St=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},Kt=function(Ee){if(!(Ct&&Ct===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=f1(Ee),bt=rt.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?bt=Ht:bt=Ee.PARSER_MEDIA_TYPE,Ue=bt==="application/xhtml+xml"?p9:BM,j="ALLOWED_TAGS"in Ee?di({},Ee.ALLOWED_TAGS,Ue):ie,Y="ALLOWED_ATTR"in Ee?di({},Ee.ALLOWED_ATTR,Ue):J,He="ALLOWED_NAMESPACES"in Ee?di({},Ee.ALLOWED_NAMESPACES,p9):Me,pe="ADD_URI_SAFE_ATTR"in Ee?di(f1(ke),Ee.ADD_URI_SAFE_ATTR,Ue):ke,se="ADD_DATA_URI_TAGS"in Ee?di(f1(ne),Ee.ADD_DATA_URI_TAGS,Ue):ne,z="FORBID_CONTENTS"in Ee?di({},Ee.FORBID_CONTENTS,Ue):q,he="FORBID_TAGS"in Ee?di({},Ee.FORBID_TAGS,Ue):{},ge="FORBID_ATTR"in Ee?di({},Ee.FORBID_ATTR,Ue):{},de="USE_PROFILES"in Ee?Ee.USE_PROFILES:!1,ye=Ee.ALLOW_ARIA_ATTR!==!1,be=Ee.ALLOW_DATA_ATTR!==!1,Ge=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=Ee.SAFE_FOR_TEMPLATES||!1,_e=Ee.WHOLE_DOCUMENT||!1,Pe=Ee.RETURN_DOM||!1,Be=Ee.RETURN_DOM_FRAGMENT||!1,Qe=Ee.RETURN_TRUSTED_TYPE||!1,Le=Ee.FORCE_BODY||!1,Ye=Ee.SANITIZE_DOM!==!1,We=Ee.SANITIZE_NAMED_PROPS||!1,re=Ee.KEEP_CONTENT!==!1,ue=Ee.IN_PLACE||!1,U=Ee.ALLOWED_URI_REGEXP||C1e,Ie=Ee.NAMESPACE||fe,Q=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&St(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&St(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(be=!1),Be&&(Pe=!0),de&&(j=di({},[...qse]),Y=[],de.html===!0&&(di(j,Gse),di(Y,Xse)),de.svg===!0&&(di(j,m9),di(Y,b9),di(Y,VR)),de.svgFilters===!0&&(di(j,v9),di(Y,b9),di(Y,VR)),de.mathMl===!0&&(di(j,_9),di(Y,Yse),di(Y,VR))),Ee.ADD_TAGS&&(j===ie&&(j=f1(j)),di(j,Ee.ADD_TAGS,Ue)),Ee.ADD_ATTR&&(Y===J&&(Y=f1(Y)),di(Y,Ee.ADD_ATTR,Ue)),Ee.ADD_URI_SAFE_ATTR&&di(pe,Ee.ADD_URI_SAFE_ATTR,Ue),Ee.FORBID_CONTENTS&&(z===q&&(z=f1(z)),di(z,Ee.FORBID_CONTENTS,Ue)),re&&(j["#text"]=!0),_e&&di(j,["html","head","body"]),j.table&&(di(j,["tbody"]),delete he.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw eL('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw eL('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Ee.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=sot(f,n)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));Rl&&Rl(Ee),Ct=Ee}},_n=di({},["mi","mo","mn","ms","mtext"]),zt=di({},["foreignobject","desc","title","annotation-xml"]),Yt=di({},["title","style","font","a","script"]),at=di({},m9);di(at,v9),di(at,Yrt);const ut=di({},_9);di(ut,Zrt);const ht=function(Ee){let wt=_(Ee);(!wt||!wt.tagName)&&(wt={namespaceURI:Ie,tagName:"template"});const kt=BM(Ee.tagName),qn=BM(wt.tagName);return He[Ee.namespaceURI]?Ee.namespaceURI===ce?wt.namespaceURI===fe?kt==="svg":wt.namespaceURI===oe?kt==="svg"&&(qn==="annotation-xml"||_n[qn]):!!at[kt]:Ee.namespaceURI===oe?wt.namespaceURI===fe?kt==="math":wt.namespaceURI===ce?kt==="math"&&zt[qn]:!!ut[kt]:Ee.namespaceURI===fe?wt.namespaceURI===ce&&!zt[qn]||wt.namespaceURI===oe&&!_n[qn]?!1:!ut[kt]&&(Yt[kt]||!at[kt]):!!(bt==="application/xhtml+xml"&&He[Ee.namespaceURI]):!1},Lt=function(Ee){Jx(e.removed,{element:Ee});try{Ee.parentNode.removeChild(Ee)}catch{Ee.remove()}},At=function(Ee,wt){try{Jx(e.removed,{attribute:wt.getAttributeNode(Ee),from:wt})}catch{Jx(e.removed,{attribute:null,from:wt})}if(wt.removeAttribute(Ee),Ee==="is"&&!Y[Ee])if(Pe||Be)try{Lt(wt)}catch{}else try{wt.setAttribute(Ee,"")}catch{}},ln=function(Ee){let wt,kt;if(Le)Ee=""+Ee;else{const jr=Krt(Ee,/^[\r\n\t ]+/);kt=jr&&jr[0]}bt==="application/xhtml+xml"&&Ie===fe&&(Ee=''+Ee+"");const qn=y?y.createHTML(Ee):Ee;if(Ie===fe)try{wt=new h().parseFromString(qn,bt)}catch{}if(!wt||!wt.documentElement){wt=L.createDocument(Ie,"template",null);try{wt.documentElement.innerHTML=Te?S:qn}catch{}}const dr=wt.body||wt.documentElement;return Ee&&kt&&dr.insertBefore(r.createTextNode(kt),dr.childNodes[0]||null),Ie===fe?k.call(wt,_e?"html":"body")[0]:_e?wt.documentElement:dr},Si=function(Ee){return E.call(Ee.ownerDocument||Ee,Ee,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Xi=function(Ee){return Ee instanceof d&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof u)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},Ir=function(Ee){return typeof a=="object"?Ee instanceof a:Ee&&typeof Ee=="object"&&typeof Ee.nodeType=="number"&&typeof Ee.nodeName=="string"},En=function(Ee,wt,kt){M[Ee]&&jrt(M[Ee],qn=>{qn.call(e,wt,kt,Ct)})},fi=function(Ee){let wt;if(En("beforeSanitizeElements",Ee,null),Xi(Ee))return Lt(Ee),!0;const kt=Ue(Ee.nodeName);if(En("uponSanitizeElement",Ee,{tagName:kt,allowedTags:j}),Ee.hasChildNodes()&&!Ir(Ee.firstElementChild)&&(!Ir(Ee.content)||!Ir(Ee.content.firstElementChild))&&$c(/<[/\w]/g,Ee.innerHTML)&&$c(/<[/\w]/g,Ee.textContent))return Lt(Ee),!0;if(!j[kt]||he[kt]){if(!he[kt]&&go(kt)&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,kt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(kt)))return!1;if(re&&!z[kt]){const qn=_(Ee)||Ee.parentNode,dr=v(Ee)||Ee.childNodes;if(dr&&qn){const jr=dr.length;for(let ei=jr-1;ei>=0;--ei)qn.insertBefore(p(dr[ei],!0),m(Ee))}}return Lt(Ee),!0}return Ee instanceof l&&!ht(Ee)||(kt==="noscript"||kt==="noembed"||kt==="noframes")&&$c(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(Lt(Ee),!0):(je&&Ee.nodeType===3&&(wt=Ee.textContent,wt=Sd(wt,P," "),wt=Sd(wt,N," "),wt=Sd(wt,R," "),Ee.textContent!==wt&&(Jx(e.removed,{element:Ee.cloneNode()}),Ee.textContent=wt)),En("afterSanitizeElements",Ee,null),!1)},Ur=function(Ee,wt,kt){if(Ye&&(wt==="id"||wt==="name")&&(kt in r||kt in Dt))return!1;if(!(be&&!ge[wt]&&$c(O,wt))){if(!(ye&&$c(B,wt))){if(!Y[wt]||ge[wt]){if(!(go(Ee)&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,Ee)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Ee))&&(Q.attributeNameCheck instanceof RegExp&&$c(Q.attributeNameCheck,wt)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(wt))||wt==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&$c(Q.tagNameCheck,kt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(kt))))return!1}else if(!pe[wt]){if(!$c(U,Sd(kt,G,""))){if(!((wt==="src"||wt==="xlink:href"||wt==="href")&&Ee!=="script"&&Grt(kt,"data:")===0&&se[Ee])){if(!(Ge&&!$c($,Sd(kt,G,"")))){if(kt)return!1}}}}}}return!0},go=function(Ee){return Ee.indexOf("-")>0},ys=function(Ee){let wt,kt,qn,dr;En("beforeSanitizeAttributes",Ee,null);const{attributes:jr}=Ee;if(!jr)return;const ei={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(dr=jr.length;dr--;){wt=jr[dr];const{name:to,namespaceURI:$s}=wt;if(kt=to==="value"?wt.value:qrt(wt.value),qn=Ue(to),ei.attrName=qn,ei.attrValue=kt,ei.keepAttr=!0,ei.forceKeepAttr=void 0,En("uponSanitizeAttribute",Ee,ei),kt=ei.attrValue,ei.forceKeepAttr||(At(to,Ee),!ei.keepAttr))continue;if(!nt&&$c(/\/>/i,kt)){At(to,Ee);continue}je&&(kt=Sd(kt,P," "),kt=Sd(kt,N," "),kt=Sd(kt,R," "));const Hl=Ue(Ee.nodeName);if(Ur(Hl,qn,kt)){if(We&&(qn==="id"||qn==="name")&&(At(to,Ee),kt=dt+kt),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!$s)switch(f.getAttributeType(Hl,qn)){case"TrustedHTML":{kt=y.createHTML(kt);break}case"TrustedScriptURL":{kt=y.createScriptURL(kt);break}}try{$s?Ee.setAttributeNS($s,to,kt):Ee.setAttribute(to,kt),Kse(e.removed)}catch{}}}En("afterSanitizeAttributes",Ee,null)},ws=function Ut(Ee){let wt;const kt=Si(Ee);for(En("beforeSanitizeShadowDOM",Ee,null);wt=kt.nextNode();)En("uponSanitizeShadowNode",wt,null),!fi(wt)&&(wt.content instanceof o&&Ut(wt.content),ys(wt));En("afterSanitizeShadowDOM",Ee,null)};return e.sanitize=function(Ut){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt,kt,qn,dr;if(Te=!Ut,Te&&(Ut=""),typeof Ut!="string"&&!Ir(Ut))if(typeof Ut.toString=="function"){if(Ut=Ut.toString(),typeof Ut!="string")throw eL("dirty is not a string, aborting")}else throw eL("toString is not a function");if(!e.isSupported)return Ut;if(Ve||Kt(Ee),e.removed=[],typeof Ut=="string"&&(ue=!1),ue){if(Ut.nodeName){const to=Ue(Ut.nodeName);if(!j[to]||he[to])throw eL("root node is forbidden and cannot be sanitized in-place")}}else if(Ut instanceof a)wt=ln(""),kt=wt.ownerDocument.importNode(Ut,!0),kt.nodeType===1&&kt.nodeName==="BODY"||kt.nodeName==="HTML"?wt=kt:wt.appendChild(kt);else{if(!Pe&&!je&&!_e&&Ut.indexOf("<")===-1)return y&&Qe?y.createHTML(Ut):Ut;if(wt=ln(Ut),!wt)return Pe?null:Qe?S:""}wt&&Le&&Lt(wt.firstChild);const jr=Si(ue?Ut:wt);for(;qn=jr.nextNode();)fi(qn)||(qn.content instanceof o&&ws(qn.content),ys(qn));if(ue)return Ut;if(Pe){if(Be)for(dr=D.call(wt.ownerDocument);wt.firstChild;)dr.appendChild(wt.firstChild);else dr=wt;return(Y.shadowroot||Y.shadowrootmode)&&(dr=T.call(t,dr,!0)),dr}let ei=_e?wt.outerHTML:wt.innerHTML;return _e&&j["!doctype"]&&wt.ownerDocument&&wt.ownerDocument.doctype&&wt.ownerDocument.doctype.name&&$c(y1e,wt.ownerDocument.doctype.name)&&(ei=" +`+ei),je&&(ei=Sd(ei,P," "),ei=Sd(ei,N," "),ei=Sd(ei,R," ")),y&&Qe?y.createHTML(ei):ei},e.setConfig=function(Ut){Kt(Ut),Ve=!0},e.clearConfig=function(){Ct=null,Ve=!1},e.isValidAttribute=function(Ut,Ee,wt){Ct||Kt({});const kt=Ue(Ut),qn=Ue(Ee);return Ur(kt,qn,wt)},e.addHook=function(Ut,Ee){typeof Ee=="function"&&(M[Ut]=M[Ut]||[],Jx(M[Ut],Ee))},e.removeHook=function(Ut){if(M[Ut])return Kse(M[Ut])},e.removeHooks=function(Ut){M[Ut]&&(M[Ut]=[])},e.removeAllHooks=function(){M={}},e}var ig=w1e();ig.version;ig.isSupported;const S1e=ig.sanitize;ig.setConfig;ig.clearConfig;ig.isValidAttribute;const iz=ig.addHook,x1e=ig.removeHook;ig.removeHooks;ig.removeAllHooks;var cn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatCodeBlock="vscode-chat-code-block",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm",i.codeSetting="code-setting",i.codeFeature="code-feature"})(cn||(cn={}));function _Y(i,e){return Ft.isUri(i)?dy(i.scheme,e):cY(i,e+":")}function Qse(i,...e){return e.some(t=>_Y(i,t))}const aot="tkn";class lot{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${cn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return nn(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${aot}=${encodeURIComponent(o)}`),Ft.from({scheme:k_?this._preferredWebSchema:cn.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:s})}}const L1e=new lot,cot="vscode-app";class aI{uriToBrowserUri(e){return e.scheme===cn.vscodeRemote?L1e.rewrite(e):e.scheme===cn.file&&(nh||ynt===`${cn.vscodeFileResource}://${aI.FALLBACK_AUTHORITY}`)?e.with({scheme:cn.vscodeFileResource,authority:e.authority||aI.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}aI.FALLBACK_AUTHORITY=cot;const E1e=new aI;var Jse;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:Ft.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}i.getHeadersFromQuery=n;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}i.addSearchParam=r})(Jse||(Jse={}));function a3(i){return l3(i,0)}function l3(i,e){switch(typeof i){case"object":return i===null?Jg(349,e):Array.isArray(i)?dot(i,e):hot(i,e);case"string":return bY(i,e);case"boolean":return uot(i,e);case"number":return Jg(i,e);case"undefined":return Jg(937,e);default:return Jg(617,e)}}function Jg(i,e){return(e<<5)-e+i|0}function uot(i,e){return Jg(i?433:863,e)}function bY(i,e){e=Jg(149417,e);for(let t=0,n=i.length;tl3(n,t),e)}function hot(i,e){return e=Jg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=bY(n,t),l3(i[n],t)),e)}function C9(i,e,t=32){const n=t-e,r=~((1<>>n)>>>0}function eae(i,e=0,t=i.byteLength,n=0){for(let r=0;rt.toString(16).padStart(2,"0")).join(""):fot((i>>>0).toString(16),e/4)}class c3{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(Do(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),tL(this._h0)+tL(this._h1)+tL(this._h2)+tL(this._h3)+tL(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,eae(this._buff,this._buffLen),this._buffLen>56&&(this._step(),eae(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=c3._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,C9(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=C9(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=C9(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}c3._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:tMt,getWindow:Bt,getDocument:nMt,getWindows:D1e,getWindowsCount:got,getWindowId:$A,getWindowById:tae,hasWindow:iMt,onDidRegisterWindow:u3,onWillUnregisterWindow:pot,onDidUnregisterWindow:mot}=function(){const i=new Map;rrt(hi,1);const e={window:hi,disposables:new Fe};i.set(hi.vscodeWindowId,e);const t=new ae,n=new ae,r=new ae;function o(s,a){const l=typeof s=="number"?i.get(s):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(s){if(i.has(s.vscodeWindowId))return me.None;const a=new Fe,l={window:s,disposables:a.add(new Fe)};return i.set(s.vscodeWindowId,l),a.add(Ot(()=>{i.delete(s.vscodeWindowId),n.fire(s)})),a.add(xe(s,Je.BEFORE_UNLOAD,()=>{r.fire(s)})),t.fire(l),a},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(s){return s.vscodeWindowId},hasWindow(s){return i.has(s)},getWindowById:o,getWindow(s){var a;const l=s;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const c=s;return c!=null&&c.view?c.view.window:hi},getDocument(s){return Bt(s).document}}}();function Ps(i){for(;i.firstChild;)i.firstChild.remove()}class vot{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,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 xe(i,e,t,n){return new vot(i,e,t,n)}function I1e(i,e){return function(t){return e(new Gu(i,t))}}function _ot(i){return function(e){return i(new Oi(e))}}const Lr=function(e,t,n,r){let o=n;return t==="click"||t==="mousedown"?o=I1e(Bt(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=_ot(n)),xe(e,t,o,r)},bot=function(e,t,n){const r=I1e(Bt(e),t);return Cot(e,r,n)};function Cot(i,e,t){return xe(i,fh&&pY.pointerEvents?Je.POINTER_DOWN:Je.MOUSE_DOWN,e,t)}function HL(i,e,t){return AE(i,e,t)}class y9 extends _1e{constructor(e,t){super(e,t)}}let HA,Ml;class CY extends vY{constructor(e){super(),this.defaultTarget=e&&Bt(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class w9{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){nn(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const i=new Map,e=new Map,t=new Map,n=new Map,r=o=>{var s;t.set(o,!1);const a=(s=i.get(o))!==null&&s!==void 0?s:[];for(e.set(o,a),i.set(o,[]),n.set(o,!0);a.length>0;)a.sort(w9.sort),a.shift().execute();n.set(o,!1)};Ml=(o,s,a=0)=>{const l=$A(o),c=new w9(s,a);let u=i.get(l);return u||(u=[],i.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>r(l))),c},HA=(o,s,a)=>{const l=$A(o);if(n.get(l)){const c=new w9(s,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return Ml(o,s,a)}})();function d3(i){return Bt(i).getComputedStyle(i,null)}function Wp(i,e){const t=Bt(i),n=t.document;if(i!==n.body)return new Gn(i.clientWidth,i.clientHeight);if(fh&&(t!=null&&t.visualViewport))return new Gn(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Gn(t.innerWidth,t.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new Gn(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new Gn(n.documentElement.clientWidth,n.documentElement.clientHeight);if(e)return Wp(e);throw new Error("Unable to figure out browser width and height")}class Nr{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const r=d3(e),o=r?r.getPropertyValue(t):"0";return Nr.convertToPixels(e,o)}static getBorderLeftWidth(e){return Nr.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Nr.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Nr.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Nr.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Nr.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Nr.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Nr.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Nr.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Nr.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Nr.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Nr.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Nr.getDimension(e,"margin-bottom","marginBottom")}}class Gn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Gn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Gn?e:new Gn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Gn.None=new Gn(0,0);function k1e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const r=N1e(i)?null:d3(i);r&&(n-=r.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=Nr.getBorderLeftWidth(i),t+=Nr.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function yot(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Hr(i){const e=i.getBoundingClientRect(),t=Bt(i);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function T1e(i){let e=i,t=1;do{const n=d3(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ha(i){const e=Nr.getMarginLeft(i)+Nr.getMarginRight(i);return i.offsetWidth+e}function S9(i){const e=Nr.getBorderLeftWidth(i)+Nr.getBorderRightWidth(i),t=Nr.getPaddingLeft(i)+Nr.getPaddingRight(i);return i.offsetWidth-e-t}function wot(i){const e=Nr.getBorderTopWidth(i)+Nr.getBorderBottomWidth(i),t=Nr.getPaddingTop(i)+Nr.getPaddingBottom(i);return i.offsetHeight-e-t}function ep(i){const e=Nr.getMarginTop(i)+Nr.getMarginBottom(i);return i.offsetHeight+e}function ts(i,e){return!!(e!=null&&e.contains(i))}function Sot(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function x9(i,e,t){return!!Sot(i,e,t)}function N1e(i){return i&&!!i.host&&!!i.mode}function VA(i){return!!Hb(i)}function Hb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return N1e(i)?i:null}function ps(){let i=zS().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function pT(i){return ps()===i}function R1e(i){return ts(ps(),i)}function zS(){var i;return got()<=1?hi.document:(i=Array.from(D1e()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&i!==void 0?i:hi.document}function xot(){var i,e;return(e=(i=zS().defaultView)===null||i===void 0?void 0:i.window)!==null&&e!==void 0?e:hi}const yY=new Map;function M1e(){return new Lot}class Lot{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=_c(hi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function _c(i=hi.document.head,e,t){const n=document.createElement("style");if(n.type="text/css",n.media="screen",e==null||e(n),i.appendChild(n),t&&t.add(Ot(()=>i.removeChild(n))),i===hi.document.head){const r=new Set;yY.set(n,r);for(const{window:o,disposables:s}of D1e()){if(o===hi)continue;const a=s.add(Eot(n,r,o));t==null||t.add(a)}}return n}function Eot(i,e,t){var n,r;const o=new Fe,s=i.cloneNode(!0);t.document.head.appendChild(s),o.add(Ot(()=>t.document.head.removeChild(s)));for(const a of A1e(i))(n=s.sheet)===null||n===void 0||n.insertRule(a.cssText,(r=s.sheet)===null||r===void 0?void 0:r.cssRules.length);return o.add(Dot.observe(i,o,{childList:!0})(()=>{s.textContent=i.textContent})),e.add(s),o.add(Ot(()=>e.delete(s))),o}const Dot=new class{constructor(){this.mutationObservers=new Map}observe(i,e,t){let n=this.mutationObservers.get(i);n||(n=new Map,this.mutationObservers.set(i,n));const r=a3(t);let o=n.get(r);if(o)o.users+=1;else{const s=new ae,a=new MutationObserver(c=>s.fire(c));a.observe(i,t);const l=o={users:1,observer:a,onDidMutate:s.event};e.add(Ot(()=>{l.users-=1,l.users===0&&(s.dispose(),a.disconnect(),n==null||n.delete(r),(n==null?void 0:n.size)===0&&this.mutationObservers.delete(i))})),n.set(r,o)}return o.onDidMutate}};let L9=null;function P1e(){return L9||(L9=_c()),L9}function A1e(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function zA(i,e,t=P1e()){var n,r;if(!(!t||!e)){(n=t.sheet)===null||n===void 0||n.insertRule(`${i} {${e}}`,0);for(const o of(r=yY.get(t))!==null&&r!==void 0?r:[])zA(i,e,o)}}function rz(i,e=P1e()){var t,n;if(!e)return;const r=A1e(e),o=[];for(let s=0;s=0;s--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[s]);for(const s of(n=yY.get(e))!==null&&n!==void 0?n:[])rz(i,s)}function Iot(i){return typeof i.selectorText=="string"}function wY(i){return i instanceof MouseEvent||i instanceof Bt(i).MouseEvent}function SY(i){return i instanceof KeyboardEvent||i instanceof Bt(i).KeyboardEvent}const Je={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:hb?"webkitAnimationStart":"animationstart",ANIMATION_END:hb?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:hb?"webkitAnimationIteration":"animationiteration"};function kot(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const gn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function Tot(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function Not(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class UA extends me{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=Hb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return ts(n,e)}else{const t=e;return ts(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new ae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event;let t=UA.hasFocusWithin(e),n=!1;const r=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(n=!0,(e instanceof HTMLElement?Bt(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{UA.hasFocusWithin(e)!==t&&(t?o():r())},this._register(xe(e,Je.FOCUS,r,!0)),this._register(xe(e,Je.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(xe(e,Je.FOCUS_IN,()=>this._refreshStateHandler())),this._register(xe(e,Je.FOCUS_OUT,()=>this._refreshStateHandler())))}}function ph(i){return new UA(i)}function Rot(i,e){return i.after(e),e}function Oe(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function xY(i,e){return i.insertBefore(e,i.firstChild),e}function ms(i,...e){i.innerText="",Oe(i,...e)}const Mot=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var lI;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(lI||(lI={}));function O1e(i,e,t,...n){const r=Mot.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return i!==lI.HTML?s=document.createElementNS(i,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function Xe(i,e,...t){return O1e(lI.HTML,i,e,...t)}Xe.SVG=function(i,e,...t){return O1e(lI.SVG,i,e,...t)};function Pot(i,...e){i?Sl(...e):pa(...e)}function Sl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function pa(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function nae(i,e){const t=i.devicePixelRatio*e;return Math.max(1,Math.floor(t))/i.devicePixelRatio}function F1e(i){hi.open(i,"_blank","noopener")}function Aot(i,e){const t=()=>{e(),n=Ml(i,t)};let n=Ml(i,t);return Ot(()=>n.dispose())}L1e.setPreferredWebSchema(/^https:/.test(hi.location.href)?"https":"http");function Jv(i){return i?`url('${E1e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function iae(i){return`'${i.replace(/'/g,"%27")}'`}function bp(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=bp(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function Oot(i,e=!1){const t=document.createElement("a");return iz("afterSanitizeAttributes",n=>{for(const r of["href","src"])if(n.hasAttribute(r)){const o=n.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!i.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(r)}}}),Ot(()=>{x1e("afterSanitizeAttributes")})}const Fot=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 tp extends ae{constructor(){super(),this._subscriptions=new Fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ot.runAndSubscribe(u3,({window:e,disposables:t})=>this.registerListeners(e,t),{window:hi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(xe(e,"keydown",n=>{if(n.defaultPrevented)return;const r=new Oi(n);if(!(r.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(r.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(xe(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.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=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(xe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(xe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(xe(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(xe(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 tp.instance||(tp.instance=new tp),tp.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Bot extends me{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(xe(this.element,Je.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)===null||n===void 0||n.call(t,e)})),this.callbacks.onDrag&&this._register(xe(this.element,Je.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(xe(this.element,Je.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)===null||n===void 0||n.call(t,e))})),this._register(xe(this.element,Je.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)===null||n===void 0||n.call(t,e)})),this._register(xe(this.element,Je.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)===null||n===void 0||n.call(t,e)}))}}const Wot=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function pi(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const r=Wot.exec(i);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(rae(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(rae(c),u.toString());return l.root=s,l}function rae(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class $ot extends me{constructor(e){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var n;(n=this._mediaQueryList)===null||n===void 0||n.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class Hot extends me{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new $ot(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),n=e.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}}class Vot{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=$A(e);let n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=new Hot(e),this.mapWindowIdToPixelRatioMonitor.set(t,n),ot.once(mot)(({vscodeWindowId:r})=>{r===t&&(n==null||n.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const cI=new Vot;class B1e{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=xd(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=xd(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=xd(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=xd(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=xd(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=xd(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=xd(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=xd(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=xd(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=xd(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=xd(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 xd(i){return typeof i=="number"?`${i}px`:i}function Jn(i){return new B1e(i)}function vs(i,e){i instanceof B1e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class zot{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class LY{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");vs(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");vs(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const r=document.createElement("div");vs(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");LY._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let n=" ";for(let r=0;r<8;r++)n+=n;e.innerText=n}else{let n=t.chr;for(let r=0;r<8;r++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),n=t.getValues();let r=!1;for(const o of n)o.isTrusted||(r=!0,t.remove(o));r&&this._onDidChange.fire()}readFontInfo(e,t){const n=this._ensureCache(e);if(!n.has(t)){let r=this._actualReadFontInfo(e,t);(r.typicalHalfwidthCharacterWidth<=2||r.typicalFullwidthCharacterWidth<=2||r.spaceWidth<=2||r.maxDigitWidth<=2)&&(r=new oz({pixelRatio:cI.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 n.get(t)}_createRequest(e,t,n,r){const o=new zot(e,t);return n.push(o),r==null||r.push(o),o}_actualReadFontInfo(e,t){const n=[],r=[],o=this._createRequest("n",0,n,r),s=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,r),l=this._createRequest("0",0,n,r),c=this._createRequest("1",0,n,r),u=this._createRequest("2",0,n,r),d=this._createRequest("3",0,n,r),h=this._createRequest("4",0,n,r),f=this._createRequest("5",0,n,r),g=this._createRequest("6",0,n,r),p=this._createRequest("7",0,n,r),m=this._createRequest("8",0,n,r),v=this._createRequest("9",0,n,r),_=this._createRequest("→",0,n,r),y=this._createRequest("→",0,n,null),S=this._createRequest("·",0,n,r),L=this._createRequest(String.fromCharCode(11825),0,n,null),E="|/-_ilm%";for(let P=0,N=E.length;P.001){k=!1;break}}let M=!0;return k&&y.width!==T&&(M=!1),y.width>_.width&&(M=!1),new oz({pixelRatio:cI.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:k,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:S.width,wsmiddotWidth:L.width,maxDigitWidth:D},!0)}}class qot{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const sz=new Got;var Zd;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Zd||(Zd={}));const Wt=Sn("instantiationService");function Xot(i,e,t){e[Zd.DI_TARGET]===e?e[Zd.DI_DEPENDENCIES].push({id:i,index:t}):(e[Zd.DI_DEPENDENCIES]=[{id:i,index:t}],e[Zd.DI_TARGET]=e)}function Sn(i){if(Zd.serviceIds.has(i))return Zd.serviceIds.get(i);const e=function(t,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Xot(e,t,r)};return e.toString=()=>i,Zd.serviceIds.set(i,e),e}const jn=Sn("codeEditorService"),or=Sn("modelService"),ul=Sn("textModelService");class Il extends me{constructor(e,t="",n="",r=!0,o){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Vb extends me{constructor(){super(...arguments),this._onWillRun=this._register(new ae),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new ae),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(r){n=r}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}}class ho{constructor(){this.id=ho.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new ho,...n]:t=n);return t}async run(){}}ho.ID="vs.actions.separator";class jw{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}}class h3 extends Il{constructor(){super(h3.ID,w("submenu.empty","(empty)"),void 0,!1)}}h3.ID="vs.actions.empty";function Yy(i){var e;return{id:i.id,label:i.label,class:i.class,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:i.checked,run:async(...t)=>i.run(...t),tooltip:i.label}}var az;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(az||(az={}));var Vt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(tt.error);const[,g,p]=f,m=["codicon","codicon-"+g];return p&&m.push("codicon-modifier-"+p.substring(1)),m}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function r(h){return"."+t(h).join(".")}i.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||az.isThemeColor(h.color))}i.isThemeIcon=o;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Vt||(Vt={}));const cr=Sn("commandService"),kn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ae,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.metadata&&Array.isArray(i.metadata.args)){const s=[];for(const l of i.metadata.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return dnt(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new Ca,this._commands.set(t,n));const r=n.unshift(i),o=Ot(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(i,e){return kn.registerCommand(i,(t,...n)=>t.get(cr).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return In.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};kn.registerCommand("noop",()=>{});function D9(...i){switch(i.length){case 1:return w("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return w("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return w("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const Yot=w("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Zot=w("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let D0=class lz{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 eY(`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(D9("==","=~"));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(D9("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(D9("||"));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,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,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),n=lz._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Yot);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,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Zot);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!n){e++;break}else o===91?n=!0:o===92?t=!0:o===93&&(n=!1);e++}for(;e=this._input.length}};D0._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));D0._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Bs=new Map;Bs.set("false",!1);Bs.set("true",!0);Bs.set("isMac",Dn);Bs.set("isLinux",ka);Bs.set("isWindows",Os);Bs.set("isWeb",k_);Bs.set("isMacNative",Dn&&!k_);Bs.set("isEdge",Ent);Bs.set("isFirefox",xnt);Bs.set("isChrome",WCe);Bs.set("isSafari",Lnt);const Qot=Object.prototype.hasOwnProperty,Jot={regexParsingWithErrorRecovery:!0},est=w("contextkey.parser.error.emptyString","Empty context key expression"),tst=w("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."),nst=w("contextkey.parser.error.noInAfterNot","'in' after 'not'."),oae=w("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ist=w("contextkey.parser.error.unexpectedToken","Unexpected token"),rst=w("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),ost=w("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),sst=w("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let W1e=class VL{constructor(e=Jot){this._config=e,this._scanner=new D0,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:est,offset:0,lexeme:"",additionalInfo:tst});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),r=n.type===17?rst:void 0;throw this._parsingErrors.push({message:ist,offset:n.offset,lexeme:D0.getLexeme(n),additionalInfo:r}),VL._parseError}return t}catch(t){if(t!==VL._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]:Re.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Re.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Ta.INSTANCE;case 12:return this._advance(),ol.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,oae),t==null?void 0:t.negate()}case 17:return this._advance(),bC.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(),Re.true();case 12:return this._advance(),Re.false();case 0:{this._advance();const t=this._expr();return this._consume(1,oae),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return uI.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return uI.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,nst);const r=this._value();return Re.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return Re.equals(t,r);switch(r){case"true":return Re.has(t);case"false":return Re.not(t);default:return Re.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return Re.notEquals(t,r);switch(r){case"true":return Re.not(t);case"false":return Re.has(t);default:return Re.notEquals(t,r)}}case 5:return this._advance(),b3.create(t,this._value());case 6:return this._advance(),C3.create(t,this._value());case 7:return this._advance(),v3.create(t,this._value());case 8:return this._advance(),_3.create(t,this._value());case 13:return this._advance(),Re.in(t,this._value());default:return Re.has(t)}}case 20:throw this._parsingErrors.push({message:ost,offset:e.offset,lexeme:"",additionalInfo:sst}),VL._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,n){const r=w("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,E0.getLexeme(t)),o=t.offset,s=E0.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:n}),VL._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};W1e._parseError=new Error;class Re{static false(){return Ta.INSTANCE}static true(){return ol.INSTANCE}static has(e){return _C.create(e)}static equals(e,t){return US.create(e,t)}static notEquals(e,t){return p3.create(e,t)}static regex(e,t){return uI.create(e,t)}static in(e,t){return f3.create(e,t)}static notIn(e,t){return g3.create(e,t)}static not(e){return bC.create(e)}static and(...e){return K0.create(e,null,!0)}static or(...e){return zg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Re._parser=new W1e({regexParsingWithErrorRecovery:!1});function ast(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function OE(i,e){return i.cmp(e)}class Ta{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 ol.INSTANCE}}Ta.INSTANCE=new Ta;class ol{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 Ta.INSTANCE}}ol.INSTANCE=new ol;class _C{static create(e,t=null){const n=Bs.get(e);return typeof n=="boolean"?n?ol.INSTANCE:Ta.INSTANCE:new _C(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:H1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bs.get(this.key);return typeof e=="boolean"?e?ol.INSTANCE:Ta.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=bC.create(this.key,this)),this.negated}}class US{static create(e,t,n=null){if(typeof t=="boolean")return t?_C.create(e,n):bC.create(e,n);const r=Bs.get(e);return typeof r=="boolean"?t===(r?"true":"false")?ol.INSTANCE:Ta.INSTANCE:new US(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=Bs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ol.INSTANCE:Ta.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=p3.create(this.key,this.value,this)),this.negated}}class f3{static create(e,t){return new f3(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:CC(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),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?Qot.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=g3.create(this.key,this.valueKey)),this.negated}}class g3{static create(e,t){return new g3(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=f3.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 p3{static create(e,t,n=null){if(typeof t=="boolean")return t?bC.create(e,n):_C.create(e,n);const r=Bs.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Ta.INSTANCE:ol.INSTANCE:new p3(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=Bs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ta.INSTANCE:ol.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=US.create(this.key,this.value,this)),this.negated}}class bC{static create(e,t=null){const n=Bs.get(e);return typeof n=="boolean"?n?Ta.INSTANCE:ol.INSTANCE:new bC(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:H1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bs.get(this.key);return typeof e=="boolean"?e?Ta.INSTANCE:ol.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_C.create(this.key,this)),this.negated}}function m3(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):Ta.INSTANCE}class v3{static create(e,t,n=null){return m3(t,r=>new v3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=C3.create(this.key,this.value,this)),this.negated}}class _3{static create(e,t,n=null){return m3(t,r=>new _3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=b3.create(this.key,this.value,this)),this.negated}}class b3{static create(e,t,n=null){return m3(t,r=>new b3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:CC(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))new C3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=v3.create(this.key,this.value,this)),this.negated}}class uI{static create(e,t){return new uI(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.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){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=EY.create(this)),this.negated}}class EY{static create(e){return new EY(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 $1e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=zg.create(s.expr.map(u=>K0.create([u,a],null,n)),null,l);c&&(r.push(c),r.sort(OE))}if(r.length===1)return r[0];if(n){for(let s=0;se.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=zg.create(e,this,!0)}return this.negated}}class zg{static create(e,t,n){return zg._normalizeArr(e,t,n)}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.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.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(),n=e.shift(),r=[];for(const o of aae(t))for(const s of aae(n))r.push(K0.create([o,s],null,!1));e.unshift(zg.create(r,null,!1))}this.negated=zg.create(e,this,!0)}return this.negated}}class ct extends _C{static all(){return ct._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?ct._info.push({...n,key:e}):n!==!0&&ct._info.push({key:e,description:n,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 US.create(this.key,e)}}ct._info=[];const Gt=Sn("contextKeyService");function H1e(i,e){return ie?1:0}function CC(i,e,t,n){return it?1:en?1:0}function cz(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?sae(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(cz(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return sae(e.expr,i.expr);for(const t of i.expr)if(cz(t,e))return!0;return!1}return i.equals(e)}function sae(i,e){let t=0,n=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(ust)),this._cachedMergedKeybindings.slice(0)}}const sl=new DY,cst={EditorModes:"platform.keybindingsRegistry"};ur.add(cst.EditorModes,sl);function ust(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var dst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WM;function hy(i){return i.command!==void 0}function hst(i){return i.submenu!==void 0}class H{constructor(e){if(H._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);H._instances.set(e,this),this.id=e}}H._instances=new Map;H.CommandPalette=new H("CommandPalette");H.DebugBreakpointsContext=new H("DebugBreakpointsContext");H.DebugCallStackContext=new H("DebugCallStackContext");H.DebugConsoleContext=new H("DebugConsoleContext");H.DebugVariablesContext=new H("DebugVariablesContext");H.NotebookVariablesContext=new H("NotebookVariablesContext");H.DebugHoverContext=new H("DebugHoverContext");H.DebugWatchContext=new H("DebugWatchContext");H.DebugToolBar=new H("DebugToolBar");H.DebugToolBarStop=new H("DebugToolBarStop");H.EditorContext=new H("EditorContext");H.SimpleEditorContext=new H("SimpleEditorContext");H.EditorContent=new H("EditorContent");H.EditorLineNumberContext=new H("EditorLineNumberContext");H.EditorContextCopy=new H("EditorContextCopy");H.EditorContextPeek=new H("EditorContextPeek");H.EditorContextShare=new H("EditorContextShare");H.EditorTitle=new H("EditorTitle");H.EditorTitleRun=new H("EditorTitleRun");H.EditorTitleContext=new H("EditorTitleContext");H.EditorTitleContextShare=new H("EditorTitleContextShare");H.EmptyEditorGroup=new H("EmptyEditorGroup");H.EmptyEditorGroupContext=new H("EmptyEditorGroupContext");H.EditorTabsBarContext=new H("EditorTabsBarContext");H.EditorTabsBarShowTabsSubmenu=new H("EditorTabsBarShowTabsSubmenu");H.EditorTabsBarShowTabsZenModeSubmenu=new H("EditorTabsBarShowTabsZenModeSubmenu");H.EditorActionsPositionSubmenu=new H("EditorActionsPositionSubmenu");H.ExplorerContext=new H("ExplorerContext");H.ExplorerContextShare=new H("ExplorerContextShare");H.ExtensionContext=new H("ExtensionContext");H.GlobalActivity=new H("GlobalActivity");H.CommandCenter=new H("CommandCenter");H.CommandCenterCenter=new H("CommandCenterCenter");H.LayoutControlMenuSubmenu=new H("LayoutControlMenuSubmenu");H.LayoutControlMenu=new H("LayoutControlMenu");H.MenubarMainMenu=new H("MenubarMainMenu");H.MenubarAppearanceMenu=new H("MenubarAppearanceMenu");H.MenubarDebugMenu=new H("MenubarDebugMenu");H.MenubarEditMenu=new H("MenubarEditMenu");H.MenubarCopy=new H("MenubarCopy");H.MenubarFileMenu=new H("MenubarFileMenu");H.MenubarGoMenu=new H("MenubarGoMenu");H.MenubarHelpMenu=new H("MenubarHelpMenu");H.MenubarLayoutMenu=new H("MenubarLayoutMenu");H.MenubarNewBreakpointMenu=new H("MenubarNewBreakpointMenu");H.PanelAlignmentMenu=new H("PanelAlignmentMenu");H.PanelPositionMenu=new H("PanelPositionMenu");H.ActivityBarPositionMenu=new H("ActivityBarPositionMenu");H.MenubarPreferencesMenu=new H("MenubarPreferencesMenu");H.MenubarRecentMenu=new H("MenubarRecentMenu");H.MenubarSelectionMenu=new H("MenubarSelectionMenu");H.MenubarShare=new H("MenubarShare");H.MenubarSwitchEditorMenu=new H("MenubarSwitchEditorMenu");H.MenubarSwitchGroupMenu=new H("MenubarSwitchGroupMenu");H.MenubarTerminalMenu=new H("MenubarTerminalMenu");H.MenubarViewMenu=new H("MenubarViewMenu");H.MenubarHomeMenu=new H("MenubarHomeMenu");H.OpenEditorsContext=new H("OpenEditorsContext");H.OpenEditorsContextShare=new H("OpenEditorsContextShare");H.ProblemsPanelContext=new H("ProblemsPanelContext");H.SCMInputBox=new H("SCMInputBox");H.SCMChangesSeparator=new H("SCMChangesSeparator");H.SCMIncomingChanges=new H("SCMIncomingChanges");H.SCMIncomingChangesContext=new H("SCMIncomingChangesContext");H.SCMIncomingChangesSetting=new H("SCMIncomingChangesSetting");H.SCMOutgoingChanges=new H("SCMOutgoingChanges");H.SCMOutgoingChangesContext=new H("SCMOutgoingChangesContext");H.SCMOutgoingChangesSetting=new H("SCMOutgoingChangesSetting");H.SCMIncomingChangesAllChangesContext=new H("SCMIncomingChangesAllChangesContext");H.SCMIncomingChangesHistoryItemContext=new H("SCMIncomingChangesHistoryItemContext");H.SCMOutgoingChangesAllChangesContext=new H("SCMOutgoingChangesAllChangesContext");H.SCMOutgoingChangesHistoryItemContext=new H("SCMOutgoingChangesHistoryItemContext");H.SCMChangeContext=new H("SCMChangeContext");H.SCMResourceContext=new H("SCMResourceContext");H.SCMResourceContextShare=new H("SCMResourceContextShare");H.SCMResourceFolderContext=new H("SCMResourceFolderContext");H.SCMResourceGroupContext=new H("SCMResourceGroupContext");H.SCMSourceControl=new H("SCMSourceControl");H.SCMSourceControlInline=new H("SCMSourceControlInline");H.SCMSourceControlTitle=new H("SCMSourceControlTitle");H.SCMTitle=new H("SCMTitle");H.SearchContext=new H("SearchContext");H.SearchActionMenu=new H("SearchActionContext");H.StatusBarWindowIndicatorMenu=new H("StatusBarWindowIndicatorMenu");H.StatusBarRemoteIndicatorMenu=new H("StatusBarRemoteIndicatorMenu");H.StickyScrollContext=new H("StickyScrollContext");H.TestItem=new H("TestItem");H.TestItemGutter=new H("TestItemGutter");H.TestMessageContext=new H("TestMessageContext");H.TestMessageContent=new H("TestMessageContent");H.TestPeekElement=new H("TestPeekElement");H.TestPeekTitle=new H("TestPeekTitle");H.TouchBarContext=new H("TouchBarContext");H.TitleBarContext=new H("TitleBarContext");H.TitleBarTitleContext=new H("TitleBarTitleContext");H.TunnelContext=new H("TunnelContext");H.TunnelPrivacy=new H("TunnelPrivacy");H.TunnelProtocol=new H("TunnelProtocol");H.TunnelPortInline=new H("TunnelInline");H.TunnelTitle=new H("TunnelTitle");H.TunnelLocalAddressInline=new H("TunnelLocalAddressInline");H.TunnelOriginInline=new H("TunnelOriginInline");H.ViewItemContext=new H("ViewItemContext");H.ViewContainerTitle=new H("ViewContainerTitle");H.ViewContainerTitleContext=new H("ViewContainerTitleContext");H.ViewTitle=new H("ViewTitle");H.ViewTitleContext=new H("ViewTitleContext");H.CommentEditorActions=new H("CommentEditorActions");H.CommentThreadTitle=new H("CommentThreadTitle");H.CommentThreadActions=new H("CommentThreadActions");H.CommentThreadAdditionalActions=new H("CommentThreadAdditionalActions");H.CommentThreadTitleContext=new H("CommentThreadTitleContext");H.CommentThreadCommentContext=new H("CommentThreadCommentContext");H.CommentTitle=new H("CommentTitle");H.CommentActions=new H("CommentActions");H.InteractiveToolbar=new H("InteractiveToolbar");H.InteractiveCellTitle=new H("InteractiveCellTitle");H.InteractiveCellDelete=new H("InteractiveCellDelete");H.InteractiveCellExecute=new H("InteractiveCellExecute");H.InteractiveInputExecute=new H("InteractiveInputExecute");H.IssueReporter=new H("IssueReporter");H.NotebookToolbar=new H("NotebookToolbar");H.NotebookStickyScrollContext=new H("NotebookStickyScrollContext");H.NotebookCellTitle=new H("NotebookCellTitle");H.NotebookCellDelete=new H("NotebookCellDelete");H.NotebookCellInsert=new H("NotebookCellInsert");H.NotebookCellBetween=new H("NotebookCellBetween");H.NotebookCellListTop=new H("NotebookCellTop");H.NotebookCellExecute=new H("NotebookCellExecute");H.NotebookCellExecuteGoTo=new H("NotebookCellExecuteGoTo");H.NotebookCellExecutePrimary=new H("NotebookCellExecutePrimary");H.NotebookDiffCellInputTitle=new H("NotebookDiffCellInputTitle");H.NotebookDiffCellMetadataTitle=new H("NotebookDiffCellMetadataTitle");H.NotebookDiffCellOutputsTitle=new H("NotebookDiffCellOutputsTitle");H.NotebookOutputToolbar=new H("NotebookOutputToolbar");H.NotebookEditorLayoutConfigure=new H("NotebookEditorLayoutConfigure");H.NotebookKernelSource=new H("NotebookKernelSource");H.BulkEditTitle=new H("BulkEditTitle");H.BulkEditContext=new H("BulkEditContext");H.TimelineItemContext=new H("TimelineItemContext");H.TimelineTitle=new H("TimelineTitle");H.TimelineTitleContext=new H("TimelineTitleContext");H.TimelineFilterSubMenu=new H("TimelineFilterSubMenu");H.AccountsContext=new H("AccountsContext");H.SidebarTitle=new H("SidebarTitle");H.PanelTitle=new H("PanelTitle");H.AuxiliaryBarTitle=new H("AuxiliaryBarTitle");H.TerminalInstanceContext=new H("TerminalInstanceContext");H.TerminalEditorInstanceContext=new H("TerminalEditorInstanceContext");H.TerminalNewDropdownContext=new H("TerminalNewDropdownContext");H.TerminalTabContext=new H("TerminalTabContext");H.TerminalTabEmptyAreaContext=new H("TerminalTabEmptyAreaContext");H.TerminalStickyScrollContext=new H("TerminalStickyScrollContext");H.WebviewContext=new H("WebviewContext");H.InlineCompletionsActions=new H("InlineCompletionsActions");H.InlineEditActions=new H("InlineEditActions");H.NewFile=new H("NewFile");H.MergeInput1Toolbar=new H("MergeToolbar1Toolbar");H.MergeInput2Toolbar=new H("MergeToolbar2Toolbar");H.MergeBaseToolbar=new H("MergeBaseToolbar");H.MergeInputResultToolbar=new H("MergeToolbarResultToolbar");H.InlineSuggestionToolbar=new H("InlineSuggestionToolbar");H.InlineEditToolbar=new H("InlineEditToolbar");H.ChatContext=new H("ChatContext");H.ChatCodeBlock=new H("ChatCodeblock");H.ChatMessageTitle=new H("ChatMessageTitle");H.ChatExecute=new H("ChatExecute");H.ChatInputSide=new H("ChatInputSide");H.AccessibleView=new H("AccessibleView");H.MultiDiffEditorFileToolbar=new H("MultiDiffEditorFileToolbar");const mu=Sn("menuService");class Ug{static for(e){let t=this._all.get(e);return t||(t=new Ug(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const n of e)n instanceof Ug&&t.add(n.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}Ug._all=new Map;const ns=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new kit({merge:Ug.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(Ug.for(H.CommandPalette)),Ot(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(Ug.for(H.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new Ca,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(Ug.for(i)),Ot(()=>{n(),this._onDidChangeMenu.fire(Ug.for(i))})}appendMenuItems(i){const e=new Fe;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===H.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)hy(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class dI extends jw{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let bc=WM=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,n,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=WM.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Vt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Vt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new WM(t,void 0,n,r,o,s):void 0,this._options=n,this.class=c&&Vt.asClassName(c)}run(...e){var t,n;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};bc=WM=dst([cae(4,Gt),cae(5,cr)],bc);class dl{constructor(e){this.desc=e}}function ki(i){const e=new Fe,t=new i,{f1:n,menu:r,keybinding:o,...s}=t.desc;if(kn.getCommand(s.id))throw new Error(`Cannot register two commands with the same id: ${s.id}`);if(e.add(kn.registerCommand({id:s.id,handler:(a,...l)=>t.run(a,...l),metadata:s.metadata})),Array.isArray(r))for(const a of r)e.add(ns.appendMenuItem(a.id,{command:{...s,precondition:a.precondition===null?void 0:s.precondition},...a}));else r&&e.add(ns.appendMenuItem(r.id,{command:{...s,precondition:r.precondition===null?void 0:s.precondition},...r}));if(n&&(e.add(ns.appendMenuItem(H.CommandPalette,{command:s,when:s.precondition})),e.add(ns.addCommand(s))),Array.isArray(o))for(const a of o)e.add(sl.registerKeybindingRule({...a,id:s.id,when:s.precondition?Re.and(s.precondition,a.when):a.when}));else o&&e.add(sl.registerKeybindingRule({...o,id:s.id,when:s.precondition?Re.and(s.precondition,o.when):o.when}));return e}const ia=Sn("telemetryService"),Ra=Sn("logService");var hs;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(hs||(hs={}));const z1e=hs.Info;class U1e extends me{constructor(){super(...arguments),this.level=z1e,this._onDidChangeLogLevel=this._register(new ae),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!==hs.Off&&this.level<=e}}class fst extends U1e{constructor(e=z1e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(hs.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(hs.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(hs.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(hs.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(hs.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class gst extends U1e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function pst(i){switch(i){case hs.Trace:return"trace";case hs.Debug:return"debug";case hs.Info:return"info";case hs.Warning:return"warn";case hs.Error:return"error";case hs.Off:return"off"}}new ct("logLevel",pst(hs.Info));class w3{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 n=t.kbExpr;this.precondition&&(n?n=Re.and(n,this.precondition):n=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};sl.registerKeybindingRule(r)}}kn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){ns.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 jS extends w3{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,r){return this._implementations.push({priority:e,name:t,implementation:n,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Gt).contextMatchesRules(n??void 0))return r(a,s,t)})}runCommand(e,t){return zo.runEditorCommand(e,t,this.precondition,(n,r,o)=>this.runEditorCommand(n,r,o))}}class pt extends zo{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(r){return r.menuId||(r.menuId=H.EditorContext),r.title||(r.title=e.label),r.when=Re.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(pt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ia).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class K1e extends pt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,r)=>r[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=o.get(Gt),c=o.get(Ra);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function rg(i,e){kn.registerCommand(i,function(t,...n){const r=t.get(Wt),[o,s]=n;Yn(Ft.isUri(o)),Yn(le.isIPosition(s));const a=t.get(rr).getModel(o);if(a){const l=le.lift(s);return r.invokeFunction(e,a,l,...n.slice(2))}return t.get(ul).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,le.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function st(i){return Gc.INSTANCE.registerEditorCommand(i),i}function Ke(i){const e=new i;return Gc.INSTANCE.registerEditorAction(e),e}function G1e(i){return Gc.INSTANCE.registerEditorAction(i),i}function mst(i){Gc.INSTANCE.registerEditorAction(i)}function Kn(i,e,t){Gc.INSTANCE.registerEditorContribution(i,e,t)}var Zy;(function(i){function e(s){return Gc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Gc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Gc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function r(s){return Gc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=r;function o(){return Gc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=o})(Zy||(Zy={}));const vst={EditorCommonContributions:"editor.contributions"};class Gc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}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}}Gc.INSTANCE=new Gc;ur.add(vst.EditorCommonContributions,Gc.INSTANCE);function mT(i){return i.register(),i}const q1e=mT(new jS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:H.MenubarEditMenu,group:"1_do",title:w({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:H.CommandPalette,group:"",title:w("undo","Undo"),order:1}]}));mT(new j1e(q1e,{id:"default:undo",precondition:void 0}));const X1e=mT(new jS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:H.MenubarEditMenu,group:"1_do",title:w({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:H.CommandPalette,group:"",title:w("redo","Redo"),order:1}]}));mT(new j1e(X1e,{id:"default:redo",precondition:void 0}));const _st=mT(new jS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:H.CommandPalette,group:"",title:w("selectAll","Select All"),order:1}]})),bst="$initialize";let uae=!1;function uz(i){I_&&(uae||(uae=!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(i.message))}class Cst{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.method=n,this.args=r,this.type=0}}class dae{constructor(e,t,n,r){this.vsWorker=e,this.seq=t,this.res=n,this.err=r,this.type=1}}class yst{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=r,this.type=2}}class wst{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class Sst{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class xst{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const n=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[n]={resolve:r,reject:o},this._send(new Cst(this._workerId,n,e,t))})}listen(e,t){let n=null;const r=new ae({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,r),this._send(new yst(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new Sst(this._workerId,n)),n=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new dae(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=Ose(r.detail)),this._send(new dae(this._workerId,t,void 0,Ose(r)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new wst(this._workerId,t,r))});this._pendingEvents.set(t,n)}_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 n=0;n{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new xst({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(Z1e(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(Y1e(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=XX(n);this._onModuleLoaded=this._protocol.sendMessage(bst,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(Est(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function Y1e(i){return i[0]==="o"&&i[1]==="n"&&af(i.charCodeAt(2))}function Z1e(i){return/^onDynamic/.test(i)&&af(i.charCodeAt(9))}function Est(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of i){if(Z1e(s)){o[s]=r(s);continue}if(Y1e(s)){o[s]=t(s,void 0);continue}o[s]=n(s)}return o}function Gp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(r){nn(r);return}try{return(t=hi.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(r){nn(r);return}}const hae=Gp("defaultWorkerFactory",{createScriptURL:i=>i});function Dst(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(hae?hae.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Ist(i){return typeof i.then=="function"}class kst extends me{constructor(e,t,n,r,o){super(),this.id=t,this.label=n;const s=Dst(n);Ist(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ot(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(r=>{try{r.postMessage(e,t)}catch(o){nn(o),nn(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class S3{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const r=++S3.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new kst(e,r,this._label||"anonymous"+r,t,o=>{uz(o),this._webWorkerFailedBeforeError=o,n(o)})}}S3.LAST_WORKER_ID=0;var Zr;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Zr||(Zr={}));class k9{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,n=e.notIn.length;t0&&i.getLanguageId(s-1)===r;)s--;return new Nst(i,r,s,o+1,i.getStartOffset(s),i.getEndOffset(o))}class Nst{constructor(e,t,n,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function Xh(i){return(i&3)!==0}class Gw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new k9(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new k9({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new k9({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Gw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Gw.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}}Gw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> +Received: '{1}'.`,e,D0.getLexeme(t)),o=t.offset,s=D0.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:n}),VL._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};W1e._parseError=new Error;class Re{static false(){return Ta.INSTANCE}static true(){return ol.INSTANCE}static has(e){return _C.create(e)}static equals(e,t){return US.create(e,t)}static notEquals(e,t){return p3.create(e,t)}static regex(e,t){return uI.create(e,t)}static in(e,t){return f3.create(e,t)}static notIn(e,t){return g3.create(e,t)}static not(e){return bC.create(e)}static and(...e){return G0.create(e,null,!0)}static or(...e){return zg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Re._parser=new W1e({regexParsingWithErrorRecovery:!1});function ast(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function OE(i,e){return i.cmp(e)}class Ta{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 ol.INSTANCE}}Ta.INSTANCE=new Ta;class ol{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 Ta.INSTANCE}}ol.INSTANCE=new ol;class _C{static create(e,t=null){const n=Bs.get(e);return typeof n=="boolean"?n?ol.INSTANCE:Ta.INSTANCE:new _C(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:H1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bs.get(this.key);return typeof e=="boolean"?e?ol.INSTANCE:Ta.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=bC.create(this.key,this)),this.negated}}class US{static create(e,t,n=null){if(typeof t=="boolean")return t?_C.create(e,n):bC.create(e,n);const r=Bs.get(e);return typeof r=="boolean"?t===(r?"true":"false")?ol.INSTANCE:Ta.INSTANCE:new US(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=Bs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ol.INSTANCE:Ta.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=p3.create(this.key,this.value,this)),this.negated}}class f3{static create(e,t){return new f3(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:CC(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),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?Qot.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=g3.create(this.key,this.valueKey)),this.negated}}class g3{static create(e,t){return new g3(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=f3.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 p3{static create(e,t,n=null){if(typeof t=="boolean")return t?bC.create(e,n):_C.create(e,n);const r=Bs.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Ta.INSTANCE:ol.INSTANCE:new p3(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=Bs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ta.INSTANCE:ol.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=US.create(this.key,this.value,this)),this.negated}}class bC{static create(e,t=null){const n=Bs.get(e);return typeof n=="boolean"?n?Ta.INSTANCE:ol.INSTANCE:new bC(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:H1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bs.get(this.key);return typeof e=="boolean"?e?Ta.INSTANCE:ol.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_C.create(this.key,this)),this.negated}}function m3(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):Ta.INSTANCE}class v3{static create(e,t,n=null){return m3(t,r=>new v3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=C3.create(this.key,this.value,this)),this.negated}}class _3{static create(e,t,n=null){return m3(t,r=>new _3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=b3.create(this.key,this.value,this)),this.negated}}class b3{static create(e,t,n=null){return m3(t,r=>new b3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:CC(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))new C3(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:CC(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=v3.create(this.key,this.value,this)),this.negated}}class uI{static create(e,t){return new uI(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.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){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=EY.create(this)),this.negated}}class EY{static create(e){return new EY(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 $1e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=zg.create(s.expr.map(u=>G0.create([u,a],null,n)),null,l);c&&(r.push(c),r.sort(OE))}if(r.length===1)return r[0];if(n){for(let s=0;se.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=zg.create(e,this,!0)}return this.negated}}class zg{static create(e,t,n){return zg._normalizeArr(e,t,n)}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.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.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(),n=e.shift(),r=[];for(const o of aae(t))for(const s of aae(n))r.push(G0.create([o,s],null,!1));e.unshift(zg.create(r,null,!1))}this.negated=zg.create(e,this,!0)}return this.negated}}class ct extends _C{static all(){return ct._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?ct._info.push({...n,key:e}):n!==!0&&ct._info.push({key:e,description:n,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 US.create(this.key,e)}}ct._info=[];const Gt=Sn("contextKeyService");function H1e(i,e){return ie?1:0}function CC(i,e,t,n){return it?1:en?1:0}function cz(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?sae(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(cz(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return sae(e.expr,i.expr);for(const t of i.expr)if(cz(t,e))return!0;return!1}return i.equals(e)}function sae(i,e){let t=0,n=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(ust)),this._cachedMergedKeybindings.slice(0)}}const sl=new DY,cst={EditorModes:"platform.keybindingsRegistry"};ur.add(cst.EditorModes,sl);function ust(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var dst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WM;function hy(i){return i.command!==void 0}function hst(i){return i.submenu!==void 0}class H{constructor(e){if(H._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);H._instances.set(e,this),this.id=e}}H._instances=new Map;H.CommandPalette=new H("CommandPalette");H.DebugBreakpointsContext=new H("DebugBreakpointsContext");H.DebugCallStackContext=new H("DebugCallStackContext");H.DebugConsoleContext=new H("DebugConsoleContext");H.DebugVariablesContext=new H("DebugVariablesContext");H.NotebookVariablesContext=new H("NotebookVariablesContext");H.DebugHoverContext=new H("DebugHoverContext");H.DebugWatchContext=new H("DebugWatchContext");H.DebugToolBar=new H("DebugToolBar");H.DebugToolBarStop=new H("DebugToolBarStop");H.EditorContext=new H("EditorContext");H.SimpleEditorContext=new H("SimpleEditorContext");H.EditorContent=new H("EditorContent");H.EditorLineNumberContext=new H("EditorLineNumberContext");H.EditorContextCopy=new H("EditorContextCopy");H.EditorContextPeek=new H("EditorContextPeek");H.EditorContextShare=new H("EditorContextShare");H.EditorTitle=new H("EditorTitle");H.EditorTitleRun=new H("EditorTitleRun");H.EditorTitleContext=new H("EditorTitleContext");H.EditorTitleContextShare=new H("EditorTitleContextShare");H.EmptyEditorGroup=new H("EmptyEditorGroup");H.EmptyEditorGroupContext=new H("EmptyEditorGroupContext");H.EditorTabsBarContext=new H("EditorTabsBarContext");H.EditorTabsBarShowTabsSubmenu=new H("EditorTabsBarShowTabsSubmenu");H.EditorTabsBarShowTabsZenModeSubmenu=new H("EditorTabsBarShowTabsZenModeSubmenu");H.EditorActionsPositionSubmenu=new H("EditorActionsPositionSubmenu");H.ExplorerContext=new H("ExplorerContext");H.ExplorerContextShare=new H("ExplorerContextShare");H.ExtensionContext=new H("ExtensionContext");H.GlobalActivity=new H("GlobalActivity");H.CommandCenter=new H("CommandCenter");H.CommandCenterCenter=new H("CommandCenterCenter");H.LayoutControlMenuSubmenu=new H("LayoutControlMenuSubmenu");H.LayoutControlMenu=new H("LayoutControlMenu");H.MenubarMainMenu=new H("MenubarMainMenu");H.MenubarAppearanceMenu=new H("MenubarAppearanceMenu");H.MenubarDebugMenu=new H("MenubarDebugMenu");H.MenubarEditMenu=new H("MenubarEditMenu");H.MenubarCopy=new H("MenubarCopy");H.MenubarFileMenu=new H("MenubarFileMenu");H.MenubarGoMenu=new H("MenubarGoMenu");H.MenubarHelpMenu=new H("MenubarHelpMenu");H.MenubarLayoutMenu=new H("MenubarLayoutMenu");H.MenubarNewBreakpointMenu=new H("MenubarNewBreakpointMenu");H.PanelAlignmentMenu=new H("PanelAlignmentMenu");H.PanelPositionMenu=new H("PanelPositionMenu");H.ActivityBarPositionMenu=new H("ActivityBarPositionMenu");H.MenubarPreferencesMenu=new H("MenubarPreferencesMenu");H.MenubarRecentMenu=new H("MenubarRecentMenu");H.MenubarSelectionMenu=new H("MenubarSelectionMenu");H.MenubarShare=new H("MenubarShare");H.MenubarSwitchEditorMenu=new H("MenubarSwitchEditorMenu");H.MenubarSwitchGroupMenu=new H("MenubarSwitchGroupMenu");H.MenubarTerminalMenu=new H("MenubarTerminalMenu");H.MenubarViewMenu=new H("MenubarViewMenu");H.MenubarHomeMenu=new H("MenubarHomeMenu");H.OpenEditorsContext=new H("OpenEditorsContext");H.OpenEditorsContextShare=new H("OpenEditorsContextShare");H.ProblemsPanelContext=new H("ProblemsPanelContext");H.SCMInputBox=new H("SCMInputBox");H.SCMChangesSeparator=new H("SCMChangesSeparator");H.SCMIncomingChanges=new H("SCMIncomingChanges");H.SCMIncomingChangesContext=new H("SCMIncomingChangesContext");H.SCMIncomingChangesSetting=new H("SCMIncomingChangesSetting");H.SCMOutgoingChanges=new H("SCMOutgoingChanges");H.SCMOutgoingChangesContext=new H("SCMOutgoingChangesContext");H.SCMOutgoingChangesSetting=new H("SCMOutgoingChangesSetting");H.SCMIncomingChangesAllChangesContext=new H("SCMIncomingChangesAllChangesContext");H.SCMIncomingChangesHistoryItemContext=new H("SCMIncomingChangesHistoryItemContext");H.SCMOutgoingChangesAllChangesContext=new H("SCMOutgoingChangesAllChangesContext");H.SCMOutgoingChangesHistoryItemContext=new H("SCMOutgoingChangesHistoryItemContext");H.SCMChangeContext=new H("SCMChangeContext");H.SCMResourceContext=new H("SCMResourceContext");H.SCMResourceContextShare=new H("SCMResourceContextShare");H.SCMResourceFolderContext=new H("SCMResourceFolderContext");H.SCMResourceGroupContext=new H("SCMResourceGroupContext");H.SCMSourceControl=new H("SCMSourceControl");H.SCMSourceControlInline=new H("SCMSourceControlInline");H.SCMSourceControlTitle=new H("SCMSourceControlTitle");H.SCMTitle=new H("SCMTitle");H.SearchContext=new H("SearchContext");H.SearchActionMenu=new H("SearchActionContext");H.StatusBarWindowIndicatorMenu=new H("StatusBarWindowIndicatorMenu");H.StatusBarRemoteIndicatorMenu=new H("StatusBarRemoteIndicatorMenu");H.StickyScrollContext=new H("StickyScrollContext");H.TestItem=new H("TestItem");H.TestItemGutter=new H("TestItemGutter");H.TestMessageContext=new H("TestMessageContext");H.TestMessageContent=new H("TestMessageContent");H.TestPeekElement=new H("TestPeekElement");H.TestPeekTitle=new H("TestPeekTitle");H.TouchBarContext=new H("TouchBarContext");H.TitleBarContext=new H("TitleBarContext");H.TitleBarTitleContext=new H("TitleBarTitleContext");H.TunnelContext=new H("TunnelContext");H.TunnelPrivacy=new H("TunnelPrivacy");H.TunnelProtocol=new H("TunnelProtocol");H.TunnelPortInline=new H("TunnelInline");H.TunnelTitle=new H("TunnelTitle");H.TunnelLocalAddressInline=new H("TunnelLocalAddressInline");H.TunnelOriginInline=new H("TunnelOriginInline");H.ViewItemContext=new H("ViewItemContext");H.ViewContainerTitle=new H("ViewContainerTitle");H.ViewContainerTitleContext=new H("ViewContainerTitleContext");H.ViewTitle=new H("ViewTitle");H.ViewTitleContext=new H("ViewTitleContext");H.CommentEditorActions=new H("CommentEditorActions");H.CommentThreadTitle=new H("CommentThreadTitle");H.CommentThreadActions=new H("CommentThreadActions");H.CommentThreadAdditionalActions=new H("CommentThreadAdditionalActions");H.CommentThreadTitleContext=new H("CommentThreadTitleContext");H.CommentThreadCommentContext=new H("CommentThreadCommentContext");H.CommentTitle=new H("CommentTitle");H.CommentActions=new H("CommentActions");H.InteractiveToolbar=new H("InteractiveToolbar");H.InteractiveCellTitle=new H("InteractiveCellTitle");H.InteractiveCellDelete=new H("InteractiveCellDelete");H.InteractiveCellExecute=new H("InteractiveCellExecute");H.InteractiveInputExecute=new H("InteractiveInputExecute");H.IssueReporter=new H("IssueReporter");H.NotebookToolbar=new H("NotebookToolbar");H.NotebookStickyScrollContext=new H("NotebookStickyScrollContext");H.NotebookCellTitle=new H("NotebookCellTitle");H.NotebookCellDelete=new H("NotebookCellDelete");H.NotebookCellInsert=new H("NotebookCellInsert");H.NotebookCellBetween=new H("NotebookCellBetween");H.NotebookCellListTop=new H("NotebookCellTop");H.NotebookCellExecute=new H("NotebookCellExecute");H.NotebookCellExecuteGoTo=new H("NotebookCellExecuteGoTo");H.NotebookCellExecutePrimary=new H("NotebookCellExecutePrimary");H.NotebookDiffCellInputTitle=new H("NotebookDiffCellInputTitle");H.NotebookDiffCellMetadataTitle=new H("NotebookDiffCellMetadataTitle");H.NotebookDiffCellOutputsTitle=new H("NotebookDiffCellOutputsTitle");H.NotebookOutputToolbar=new H("NotebookOutputToolbar");H.NotebookEditorLayoutConfigure=new H("NotebookEditorLayoutConfigure");H.NotebookKernelSource=new H("NotebookKernelSource");H.BulkEditTitle=new H("BulkEditTitle");H.BulkEditContext=new H("BulkEditContext");H.TimelineItemContext=new H("TimelineItemContext");H.TimelineTitle=new H("TimelineTitle");H.TimelineTitleContext=new H("TimelineTitleContext");H.TimelineFilterSubMenu=new H("TimelineFilterSubMenu");H.AccountsContext=new H("AccountsContext");H.SidebarTitle=new H("SidebarTitle");H.PanelTitle=new H("PanelTitle");H.AuxiliaryBarTitle=new H("AuxiliaryBarTitle");H.TerminalInstanceContext=new H("TerminalInstanceContext");H.TerminalEditorInstanceContext=new H("TerminalEditorInstanceContext");H.TerminalNewDropdownContext=new H("TerminalNewDropdownContext");H.TerminalTabContext=new H("TerminalTabContext");H.TerminalTabEmptyAreaContext=new H("TerminalTabEmptyAreaContext");H.TerminalStickyScrollContext=new H("TerminalStickyScrollContext");H.WebviewContext=new H("WebviewContext");H.InlineCompletionsActions=new H("InlineCompletionsActions");H.InlineEditActions=new H("InlineEditActions");H.NewFile=new H("NewFile");H.MergeInput1Toolbar=new H("MergeToolbar1Toolbar");H.MergeInput2Toolbar=new H("MergeToolbar2Toolbar");H.MergeBaseToolbar=new H("MergeBaseToolbar");H.MergeInputResultToolbar=new H("MergeToolbarResultToolbar");H.InlineSuggestionToolbar=new H("InlineSuggestionToolbar");H.InlineEditToolbar=new H("InlineEditToolbar");H.ChatContext=new H("ChatContext");H.ChatCodeBlock=new H("ChatCodeblock");H.ChatMessageTitle=new H("ChatMessageTitle");H.ChatExecute=new H("ChatExecute");H.ChatInputSide=new H("ChatInputSide");H.AccessibleView=new H("AccessibleView");H.MultiDiffEditorFileToolbar=new H("MultiDiffEditorFileToolbar");const mu=Sn("menuService");class Ug{static for(e){let t=this._all.get(e);return t||(t=new Ug(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const n of e)n instanceof Ug&&t.add(n.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}Ug._all=new Map;const ns=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new kit({merge:Ug.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(Ug.for(H.CommandPalette)),Ot(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(Ug.for(H.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new Ca,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(Ug.for(i)),Ot(()=>{n(),this._onDidChangeMenu.fire(Ug.for(i))})}appendMenuItems(i){const e=new Fe;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===H.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)hy(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class dI extends jw{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let bc=WM=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,n,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=WM.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Vt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Vt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new WM(t,void 0,n,r,o,s):void 0,this._options=n,this.class=c&&Vt.asClassName(c)}run(...e){var t,n;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};bc=WM=dst([cae(4,Gt),cae(5,cr)],bc);class dl{constructor(e){this.desc=e}}function ki(i){const e=new Fe,t=new i,{f1:n,menu:r,keybinding:o,...s}=t.desc;if(kn.getCommand(s.id))throw new Error(`Cannot register two commands with the same id: ${s.id}`);if(e.add(kn.registerCommand({id:s.id,handler:(a,...l)=>t.run(a,...l),metadata:s.metadata})),Array.isArray(r))for(const a of r)e.add(ns.appendMenuItem(a.id,{command:{...s,precondition:a.precondition===null?void 0:s.precondition},...a}));else r&&e.add(ns.appendMenuItem(r.id,{command:{...s,precondition:r.precondition===null?void 0:s.precondition},...r}));if(n&&(e.add(ns.appendMenuItem(H.CommandPalette,{command:s,when:s.precondition})),e.add(ns.addCommand(s))),Array.isArray(o))for(const a of o)e.add(sl.registerKeybindingRule({...a,id:s.id,when:s.precondition?Re.and(s.precondition,a.when):a.when}));else o&&e.add(sl.registerKeybindingRule({...o,id:s.id,when:s.precondition?Re.and(s.precondition,o.when):o.when}));return e}const ia=Sn("telemetryService"),Ra=Sn("logService");var hs;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(hs||(hs={}));const z1e=hs.Info;class U1e extends me{constructor(){super(...arguments),this.level=z1e,this._onDidChangeLogLevel=this._register(new ae),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!==hs.Off&&this.level<=e}}class fst extends U1e{constructor(e=z1e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(hs.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(hs.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(hs.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(hs.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(hs.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class gst extends U1e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function pst(i){switch(i){case hs.Trace:return"trace";case hs.Debug:return"debug";case hs.Info:return"info";case hs.Warning:return"warn";case hs.Error:return"error";case hs.Off:return"off"}}new ct("logLevel",pst(hs.Info));class w3{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 n=t.kbExpr;this.precondition&&(n?n=Re.and(n,this.precondition):n=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};sl.registerKeybindingRule(r)}}kn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){ns.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 jS extends w3{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,r){return this._implementations.push({priority:e,name:t,implementation:n,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Gt).contextMatchesRules(n??void 0))return r(a,s,t)})}runCommand(e,t){return zo.runEditorCommand(e,t,this.precondition,(n,r,o)=>this.runEditorCommand(n,r,o))}}class pt extends zo{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(r){return r.menuId||(r.menuId=H.EditorContext),r.title||(r.title=e.label),r.when=Re.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(pt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ia).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class K1e extends pt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,r)=>r[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=o.get(Gt),c=o.get(Ra);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function rg(i,e){kn.registerCommand(i,function(t,...n){const r=t.get(Wt),[o,s]=n;Yn(Ft.isUri(o)),Yn(le.isIPosition(s));const a=t.get(or).getModel(o);if(a){const l=le.lift(s);return r.invokeFunction(e,a,l,...n.slice(2))}return t.get(ul).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,le.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function st(i){return Gc.INSTANCE.registerEditorCommand(i),i}function Ke(i){const e=new i;return Gc.INSTANCE.registerEditorAction(e),e}function G1e(i){return Gc.INSTANCE.registerEditorAction(i),i}function mst(i){Gc.INSTANCE.registerEditorAction(i)}function Kn(i,e,t){Gc.INSTANCE.registerEditorContribution(i,e,t)}var Zy;(function(i){function e(s){return Gc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Gc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Gc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function r(s){return Gc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=r;function o(){return Gc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=o})(Zy||(Zy={}));const vst={EditorCommonContributions:"editor.contributions"};class Gc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}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}}Gc.INSTANCE=new Gc;ur.add(vst.EditorCommonContributions,Gc.INSTANCE);function mT(i){return i.register(),i}const q1e=mT(new jS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:H.MenubarEditMenu,group:"1_do",title:w({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:H.CommandPalette,group:"",title:w("undo","Undo"),order:1}]}));mT(new j1e(q1e,{id:"default:undo",precondition:void 0}));const X1e=mT(new jS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:H.MenubarEditMenu,group:"1_do",title:w({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:H.CommandPalette,group:"",title:w("redo","Redo"),order:1}]}));mT(new j1e(X1e,{id:"default:redo",precondition:void 0}));const _st=mT(new jS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:H.CommandPalette,group:"",title:w("selectAll","Select All"),order:1}]})),bst="$initialize";let uae=!1;function uz(i){k_&&(uae||(uae=!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(i.message))}class Cst{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.method=n,this.args=r,this.type=0}}class dae{constructor(e,t,n,r){this.vsWorker=e,this.seq=t,this.res=n,this.err=r,this.type=1}}class yst{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=r,this.type=2}}class wst{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class Sst{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class xst{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const n=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[n]={resolve:r,reject:o},this._send(new Cst(this._workerId,n,e,t))})}listen(e,t){let n=null;const r=new ae({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,r),this._send(new yst(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new Sst(this._workerId,n)),n=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new dae(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=Ose(r.detail)),this._send(new dae(this._workerId,t,void 0,Ose(r)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new wst(this._workerId,t,r))});this._pendingEvents.set(t,n)}_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 n=0;n{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new xst({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(Z1e(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(Y1e(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=XX(n);this._onModuleLoaded=this._protocol.sendMessage(bst,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(Est(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function Y1e(i){return i[0]==="o"&&i[1]==="n"&&af(i.charCodeAt(2))}function Z1e(i){return/^onDynamic/.test(i)&&af(i.charCodeAt(9))}function Est(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of i){if(Z1e(s)){o[s]=r(s);continue}if(Y1e(s)){o[s]=t(s,void 0);continue}o[s]=n(s)}return o}function Gp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(r){nn(r);return}try{return(t=hi.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(r){nn(r);return}}const hae=Gp("defaultWorkerFactory",{createScriptURL:i=>i});function Dst(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(hae?hae.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Ist(i){return typeof i.then=="function"}class kst extends me{constructor(e,t,n,r,o){super(),this.id=t,this.label=n;const s=Dst(n);Ist(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ot(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(r=>{try{r.postMessage(e,t)}catch(o){nn(o),nn(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class S3{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const r=++S3.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new kst(e,r,this._label||"anonymous"+r,t,o=>{uz(o),this._webWorkerFailedBeforeError=o,n(o)})}}S3.LAST_WORKER_ID=0;var Zr;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Zr||(Zr={}));class k9{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,n=e.notIn.length;t0&&i.getLanguageId(s-1)===r;)s--;return new Nst(i,r,s,o+1,i.getStartOffset(s),i.getEndOffset(o))}class Nst{constructor(e,t,n,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function Xh(i){return(i&3)!==0}class Gw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new k9(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new k9({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new k9({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Gw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Gw.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}}Gw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;Gw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const fae=typeof Buffer<"u";let T9;class L3{static wrap(e){return fae&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new L3(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return fae?this.buffer.toString():(T9||(T9=new TextDecoder),T9.decode(this.buffer))}}function Rst(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function Mst(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function Md(i,e){return i[e]*2**24+i[e+1]*2**16+i[e+2]*2**8+i[e+3]}function Pd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function gae(i,e){return i[e]}function pae(i,e,t){i[t]=e}let N9;function Q1e(){return N9||(N9=new TextDecoder("UTF-16LE")),N9}let R9;function Pst(){return R9||(R9=new TextDecoder("UTF-16BE")),R9}let M9;function J1e(){return M9||(M9=BCe()?Q1e():Pst()),M9}function Ast(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?Ost(i,e,t):Q1e().decode(n)}function Ost(i,e,t){const n=[];let r=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&o.push({open:a,close:l})}return o}class Bst{constructor(e,t){this._richEditBracketsBrand=void 0;const n=Fst(t);this.brackets=n.map((r,o)=>new jA(e,o,r.open,r.close,Wst(r.open,r.close,n,o),$st(r.open,r.close,n,o))),this.forwardRegex=Hst(this.brackets),this.reversedRegex=Vst(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function eye(i,e,t,n){for(let r=0,o=e.length;r=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function tye(i,e){return i.length-e.length}function E3(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function Wst(i,e,t,n){let r=[];r=r.concat(i),r=r.concat(e);for(let o=0,s=r.length;o=0;s--)r[o++]=n.charCodeAt(s);return J1e().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=i(e)),t}}();class Ou{static _findPrevBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=n.length-(o.index||0),a=o[0].length,l=r+s;return new W(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,r,o){const a=IY(n).substring(n.length-o,n.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new W(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,r,o){const s=n.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class Ust{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const r=n.charAt(n.length-1);e.push(r)}return Ap(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(n-1);if(Xh(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=Ou.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function zR(i){return i.global&&(i.lastIndex=0),!0}class jst{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&zR(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&zR(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&zR(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&zR(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 fy{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=fy._createOpenBracketRegExp(t[0]),r=fy._createCloseBracketRegExp(t[1]);n&&r&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,r){if(e>=3)for(let o=0,s=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o=2&&n.length>0){for(let o=0,s=this._brackets.length;o"u"?t:o}function Gst(i){return i.replace(/[\[\]]/g,"")}const qi=Sn("languageService");class lf{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}const rye=[];function Tn(i,e,t){e instanceof lf||(e=new lf(e,[],!!t)),rye.push([i,e])}function vae(){return rye}const wr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),I3={JSONContribution:"base.contributions.json"};function qst(i){return i.length>0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class Xst{constructor(){this._onDidChangeSchema=new ae,this.schemasById={}}registerSchema(e,t){this.schemasById[qst(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Yst=new Xst;ur.add(I3.JSONContribution,Yst);const Rh={Configuration:"base.contributions.configuration"},iL="vscode://schemas/settings/resourceLanguage",_ae=ur.as(I3.JSONContribution);class Zst{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new ae,this._onDidUpdateConfiguration=new ae,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:w("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={},_ae.registerSchema(iL,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),_ae.registerSchema(iL,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),Jv.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(o[a]))c.set(f,s);const u={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=Gst(a),h={type:"object",default:u,description:w("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:iL,defaultDefaultValue:u,source:Ea(s)?void 0:s,defaultValueSource:s};r.push(...KA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,n),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,n,r,o=3,s){var a;o=sc(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&eat(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),Jv.test(u)?d.scope=void 0:(d.scope=sc(d.scope)?o:d.scope,d.restricted=sc(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const r=n.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=n.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:w("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:iL};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),w("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let r=n==null?void 0:n.value,o=n==null?void 0:n.source;xl(r)&&(r=t.defaultDefaultValue,o=void 0),xl(r)&&(r=Jst(t.type)),t.default=r,t.defaultValueSource=o}}const oye="\\[([^\\]]+)\\]",bae=new RegExp(oye,"g"),Qst=`^(${oye})+$`,Jv=new RegExp(Qst);function KA(i){const e=[];if(Jv.test(i)){let t=bae.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=bae.exec(i)}}return Ap(e)}function Jst(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const $M=new Zst;ur.add(Rh.Configuration,$M);function eat(i,e){var t,n,r,o;return i.trim()?Jv.test(i)?w("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):$M.getConfigurationProperties()[i]!==void 0?w("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):!((t=e.policy)===null||t===void 0)&&t.name&&$M.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?w("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(r=e.policy)===null||r===void 0?void 0:r.name,$M.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:w("config.property.empty","Cannot register an empty property")}const tat={ModesRegistry:"editor.modesRegistry"};class nat{constructor(){this._onDidChangeLanguages=new ae,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new oat(this,a,l),closing:l}}),o=new Hse(a=>{const l=new Set,c=new Set;return{info:new sat(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?Cae(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function Cae(i){return i.filter(([e,t])=>e!==""&&t!=="")}class sye{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class oat extends sye{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class sat extends sye{constructor(e,t,n,r){super(e,t),this.openingBrackets=n,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 aat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class P9{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=Sn("languageConfigurationService");let hz=class extends me{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new dat),this.onDidChangeEmitter=this._register(new ae),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(fz));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>n.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new P9(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new P9(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new P9(r.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=lat(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};hz=aat([yae(0,mn),yae(1,qi)],hz);function lat(i,e,t,n){let r=e.getLanguageConfiguration(i);if(!r){if(!n.isRegisteredLanguageId(i))return new Jy(i,{});r=new Jy(i,{})}const o=cat(r.languageId,t),s=lye([r.underlyingConfig,o]);return new Jy(r.languageId,s)}const fz={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function cat(i,e){const t=e.getValue(fz.brackets,{overrideIdentifier:i}),n=e.getValue(fz.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:wae(t),colorizedBracketPairs:wae(n)}}function wae(i){if(Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function aye(i,e,t){const n=i.getLineContent(e);let r=yi(n);return r.length>t-1&&(r=r.substring(0,t-1)),r}function Qy(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),r=typeof t>"u"?i.getLineMaxColumn(e)-1:t-1;return x3(n,r)}class uat{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Sae(e,t,++this._order);return this._entries.push(n),this._resolved=null,Ot(()=>{for(let r=0;re.configuration)))}}function lye(i){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 i)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 Sae{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class xae{constructor(e){this.languageId=e}}class dat extends me{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._register(this.register(mc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let r=this._entries.get(e);r||(r=new uat(e),this._entries.set(e,r));const o=r.register(t,n);return this._onDidChange.fire(new xae(e)),Ot(()=>{o.dispose(),this._onDidChange.fire(new xae(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Jy{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 fy(this.underlyingConfig):null,this.comments=Jy._handleComments(this.underlyingConfig),this.characterPair=new Gw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||QX,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new jst(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new rat(e,this.underlyingConfig)}getWordDefinition(){return JX(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Bst(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Ust(this.brackets)),this._electricCharacter}onEnter(e,t,n,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,r):null}getAutoClosingPairs(){return new Tst(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;n.blockCommentStartToken=r,n.blockCommentEndToken=o}return n}}Tn(Ti,hz,1);class wm{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Lae{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new wm(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 gf{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=gf._getElements(e),[a,l,c]=gf._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(gf._isStringArray(t)){const n=new Int32Array(t.length);for(let r=0,o=t.length;r=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let d;return n<=r?(g1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new wm(e,0,n,r-n+1)]):e<=t?(g1.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new wm(e,t-e+1,n,0)]):(g1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),g1.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,n,u,o);let h=[];return o[0]?h=[new wm(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new wm(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m,v,_){let y=null,S=null,L=new Eae,E=t,D=n,k=f[0]-m[0]-r,T=-1073741824,M=this.m_forwardHistory.length-1;do{const P=k+e;P===E||P=0&&(c=this.m_forwardHistory[M],e=c[0],E=1,D=c.length-1)}while(--M>=-1);if(y=L.getReverseChanges(),_[0]){let P=f[0]+1,N=m[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];P=Math.max(P,R.getOriginalEnd()),N=Math.max(N,R.getModifiedEnd())}S=[new wm(P,h-P+1,N,p-N+1)]}else{L=new Eae,E=s,D=a,k=f[0]-m[0]-l,T=1073741824,M=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const P=k+o;P===E||P=u[P+1]?(d=u[P+1]-1,g=d-k-l,d>T&&L.MarkNextChange(),T=d+1,L.AddOriginalElement(d+1,g+1),k=P+1-o):(d=u[P-1],g=d-k-l,d>T&&L.MarkNextChange(),T=d,L.AddModifiedElement(d+1,g+1),k=P-1-o),M>=0&&(u=this.m_reverseHistory[M],o=u[0],E=1,D=u.length-1)}while(--M>=-1);S=L.getChanges()}return this.ConcatenateChanges(y,S)}ComputeRecursionPoint(e,t,n,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-n),p=g+1,m=new Int32Array(p),v=new Int32Array(p),_=r-n,y=t-e,S=e-n,L=t-r,D=(y-_)%2===0;m[_]=e,v[y]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let T=0,M=0;u=this.ClipDiagonalBound(_-k,k,_,p),d=this.ClipDiagonalBound(_+k,k,_,p);for(let N=u;N<=d;N+=2){N===u||NT+M&&(T=l,M=c),!D&&Math.abs(N-y)<=k-1&&l>=v[N])return o[0]=l,s[0]=c,R<=v[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):null}const P=(T-e+(M-n)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(T,P))return a[0]=!0,o[0]=T,s[0]=M,P>0&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):(e++,n++,[new wm(e,t-e+1,n,r-n+1)]);h=this.ClipDiagonalBound(y-k,k,y,p),f=this.ClipDiagonalBound(y+k,k,y,p);for(let N=h;N<=f;N+=2){N===h||N=v[N+1]?l=v[N+1]-1:l=v[N-1],c=l-(N-y)-L;const R=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(v[N]=l,D&&Math.abs(N-_)<=k&&l<=m[N])return o[0]=l,s[0]=c,R>=m[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):null}if(k<=1447){let N=new Int32Array(d-u+2);N[0]=_-u+1,p1.Copy2(m,u,N,1,d-u+1),this.m_forwardHistory.push(N),N=new Int32Array(f-h+2),N[0]=y-h+1,p1.Copy2(v,h,N,1,f-h+1),this.m_reverseHistory.push(N)}}return this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.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,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let r=0;for(let o=0;o=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,r)?1:0;return o+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return p1.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],p1.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return p1.Copy(e,0,r,0,e.length),p1.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,n){if(g1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),g1.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new wm(r,o,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e255?255:i|0}function m1(i){return i<0?0:i>4294967295?4294967295:i|0}class fat{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=m1(e);const n=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(n.length+o),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=m1(e),t=m1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const o=n.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=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=m1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,o=0,s=0;for(;t<=n;)if(r=t+(n-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e=o)t=r+1;else break;return new cye(r,e-s)}}class gat{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],n=t>0?this._prefixSum[t-1]:0;return new cye(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=n3(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;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+n;for(let o=0;o=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class qA{constructor(){this._actual=new GS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class mat{constructor(e,t,n){const r=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const r=new mat(n,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let A9=null;function _at(){return A9===null&&(A9=new vat([[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]])),A9}let rL=null;function bat(){if(rL===null){rL=new GS(0);const i=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tr);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=_at()){const n=bat(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,m=!1;for(;c=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}gz.INSTANCE=new gz;class yat extends GS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const cu=wat(i=>new yat(i));var Cc;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Cc||(Cc={}));var Uf;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(Uf||(Uf={}));var kl;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(kl||(kl={}));var qu;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(qu||(qu={}));class HM{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&&pc(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 hI{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function Sat(i){return i&&typeof i.read=="function"}class O9{constructor(e,t,n,r,o,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class xat{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class Lat{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function uye(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const Eat=999;class b0{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Dat(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=a1e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new xat(t,this.wordSeparators?cu(this.wordSeparators):null,n?this.searchString:null)}}function Dat(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const r=i.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function D0(i,e,t){if(!t)return new hI(i,null);const n=[];for(let r=0,o=e.length;r>0);t[o]>=e?r=o-1:t[o+1]>=e?(n=o,r=o):n=o+1}return n+1}}class UR{static findMatches(e,t,n,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new gy(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,n,s,r,o):[]}static _getMultilineMatchRange(e,t,n,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new W(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new Dae(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=D0(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,n,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const u=new gy(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=D0(new W(n,d.index+1+r,n,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new gy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,s,r):this._doFindNextMatchLineByLine(e,n,s,r)}static _doFindNextMatchMultiline(e,t,n,r){const o=new le(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new W(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new Dae(l):null;n.reset(t.column-1);const u=n.next(l);return u?D0(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new le(1,1),n,r):null}static _doFindNextMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,r,o){e.reset(r-1);const s=e.next(t);return s?D0(new W(n,s.index+1,n,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new gy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,r):this._doFindPreviousMatchLineByLine(e,n,s,r)}static _doFindPreviousMatchMultiline(e,t,n,r){const o=this._doFindMatchesMultiline(e,new W(1,1,t.lineNumber,t.column),n,r,10*Eat);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new le(s,e.getLineMaxColumn(s)),n,r):null}static _doFindPreviousMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,n,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=D0(new W(n,s.index+1,n,s.index+1+s[0].length),s,r);return o}}function Iat(i,e,t,n,r){if(n===0)return!0;const o=e.charCodeAt(n-1);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function kat(i,e,t,n,r){if(n+r===t)return!0;const o=e.charCodeAt(n+r);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n+r-1);if(i.get(s)!==0)return!0}return!1}function kY(i,e,t,n,r){return Iat(i,e,t,n,r)&&kat(i,e,t,n,r)}class gy{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const r=n.index,o=n[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){BA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||kY(this._wordSeparators,e,t,r,o))return n}while(n);return null}}class TY{static computeUnicodeHighlights(e,t,n){const r=n?n.startLineNumber:1,o=n?n.endLineNumber:e.getLineCount(),s=new Iae(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Tat(Array.from(a))}`,"g");const c=new gy(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let m=r,v=o;m<=v;m++){const _=e.getLineContent(m),y=_.length;c.reset(0);do if(h=c.next(_),h){let S=h.index,L=h.index+h[0].length;if(S>0){const T=_.charCodeAt(S-1);Do(T)&&S--}if(L+1=T){d=!0;break e}u.push(new W(m,S+1,m,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Iae(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(o),a=Bb.getLocales().filter(l=>!Bb.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Tat(i,e){return`[${vc(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Iae{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Bb.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Of.codePoints)kae(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=hT(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Of.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!kae(e)&&Of.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function kae(i){return i===" "||i===` -`||i===" "}class VM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class dye{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class bn{static addRange(e,t){let n=0;for(;nt)throw new Zi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new bn(this.start+e,this.endExclusive+e)}deltaStart(e){return new bn(this.start+e,this.endExclusive)}deltaEnd(e){return new bn(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=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Zi(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Zi(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function fI(i,e,t){const n=Nat(i,e);if(n!==-1)return i[n]}function Nat(i,e,t=i.length-1){for(let n=t;n>=0;n--){const r=i[n];if(e(r))return n}return-1}function Xw(i,e){const t=gI(i,e);return t===-1?void 0:i[t]}function gI(i,e,t=0,n=i.length){let r=t,o=n;for(;r0&&(t=r)}return t}function Mat(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=r)}return t}function Pat(i,e){return RY(i,(t,n)=>-e(t,n))}function Aat(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function Oat(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}let vn=class Sm{static fromRangeInclusive(e){return new Sm(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Uu(e[0].slice());for(let n=1;nt)throw new Zi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&er.endLineNumberExclusive>=e.startLineNumber),n=gI(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}contains(e){const t=Xw(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=Xw(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,r=0,o=null;for(;n=s.startLineNumber?o=new vn(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new Uu(t)}subtractFrom(e){const t=pI(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=gI(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Uu([e]);const r=[];let o=e.startLineNumber;for(let s=t;so&&r.push(new vn(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let n=0,r=0;for(;nt.delta(e)))}}class el{static inverse(e,t,n){const r=[];let o=1,s=1;for(const l of e){const c=new el(new vn(o,l.original.startLineNumber),new vn(s,l.modified.startLineNumber));c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new el(new vn(o,t+1),new vn(s,n+1));return a.modified.isEmpty||r.push(a),r}static clip(e,t,n){const r=[];for(const o of e){const s=o.original.intersect(t),a=o.modified.intersect(n);s&&!s.isEmpty&&a&&!a.isEmpty&&r.push(new el(s,a))}return r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new el(this.modified,this.original)}join(e){return new el(this.original.join(e.original),this.modified.join(e.modified))}}class mh extends el{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new mh(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class e_{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new e_(this.modifiedRange,this.originalRange)}}const Fat=3;class Bat{computeDiff(e,t,n){var r;const s=new Hat(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new vn(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new vn(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new vn(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new vn(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new mh(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new e_(new W(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new W(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new mh(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Kw(()=>V1e(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(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 ew{constructor(e,t,n,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new ew(r,o,s,a,l,c,u,d)}}function $at(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,r=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=hye(f,g,o,!0).changes;a&&(p=$at(p)),h=[];for(let m=0,v=p.length;m1&&p>1;){const m=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(m!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,p)}{let g=mz(h,1),p=mz(f,1);const m=h.length+1,v=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Eo.fromOffsetPairs(r?r.getEndExclusives():Zc.zero,o?o.getStarts():new Zc(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Eo(new bn(e.offset1,t.offset1),new bn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Eo(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Eo(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Eo(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Eo(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Eo(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Eo(t,n)}getStarts(){return new Zc(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Zc(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Zc{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Zc(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Zc.zero=new Zc(0,0);Zc.max=new Zc(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class mI{isValid(){return!0}}mI.instance=new mI;class Vat{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Zi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=r?r(g,p):1):_=-1;const y=Math.max(m,v,_);if(y===_){const S=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,S+1),s.set(g,p,3)}else y===m?(a.set(g,p,0),s.set(g,p,1)):y===v&&(a.set(g,p,0),s.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new Eo(new bn(g+1,c),new bn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new Cp(l,!1)}}class fye{compute(e,t,n=mI.instance){if(e.length===0||t.length===0)return Cp.trivial(e,t);const r=e,o=t;function s(p,m){for(;pr.length||S>o.length)continue;const L=s(y,S);l.set(u,L);const E=y===v?c.get(u+1):c.get(u-1);if(c.set(u,L!==y?new Rae(E,y,S,L-y):E),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const p=d?d.x+d.length:0,m=d?d.y+d.length:0;if((p!==f||m!==g)&&h.push(new Eo(new bn(p,f),new bn(m,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new Cp(h,!1)}}class Rae{constructor(e,t,n,r){this.prev=e,this.x=t,this.y=n,this.length=r}}class Uat{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class jat{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var Mae,Pae;class Kat{constructor(e,t){this.uri=e,this.value=t}}function Gat(i){return Array.isArray(i)}class Mr{constructor(e,t){if(this[Mae]="ResourceMap",e instanceof Mr)this.map=new Map(e.map),this.toKey=t??Mr.defaultToKey;else if(Gat(e)){this.map=new Map,this.toKey=t??Mr.defaultToKey;for(const[n,r]of e)this.set(n,r)}else this.map=new Map,this.toKey=e??Mr.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Kat(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[n,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]}*[(Mae=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Mr.defaultToKey=i=>i.toString();class qat{constructor(){this[Pae]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let r=this._map.get(e);if(r)r.value=t,n!==0&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){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 n=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!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:[n.key,n.value],done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}[(Pae=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),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 n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class N_ extends qat{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class Xat{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}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 MY{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);n&&n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class YA{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new bn(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o>>0|i[e+1]<<8>>>0}function Mst(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function Md(i,e){return i[e]*2**24+i[e+1]*2**16+i[e+2]*2**8+i[e+3]}function Pd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function gae(i,e){return i[e]}function pae(i,e,t){i[t]=e}let N9;function Q1e(){return N9||(N9=new TextDecoder("UTF-16LE")),N9}let R9;function Pst(){return R9||(R9=new TextDecoder("UTF-16BE")),R9}let M9;function J1e(){return M9||(M9=BCe()?Q1e():Pst()),M9}function Ast(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?Ost(i,e,t):Q1e().decode(n)}function Ost(i,e,t){const n=[];let r=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&o.push({open:a,close:l})}return o}class Bst{constructor(e,t){this._richEditBracketsBrand=void 0;const n=Fst(t);this.brackets=n.map((r,o)=>new jA(e,o,r.open,r.close,Wst(r.open,r.close,n,o),$st(r.open,r.close,n,o))),this.forwardRegex=Hst(this.brackets),this.reversedRegex=Vst(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function eye(i,e,t,n){for(let r=0,o=e.length;r=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function tye(i,e){return i.length-e.length}function E3(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function Wst(i,e,t,n){let r=[];r=r.concat(i),r=r.concat(e);for(let o=0,s=r.length;o=0;s--)r[o++]=n.charCodeAt(s);return J1e().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=i(e)),t}}();class Ou{static _findPrevBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=n.length-(o.index||0),a=o[0].length,l=r+s;return new W(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,r,o){const a=IY(n).substring(n.length-o,n.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new W(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,r,o){const s=n.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class Ust{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const r=n.charAt(n.length-1);e.push(r)}return Ap(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(n-1);if(Xh(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=Ou.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function zR(i){return i.global&&(i.lastIndex=0),!0}class jst{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&zR(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&zR(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&zR(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&zR(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 fy{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=fy._createOpenBracketRegExp(t[0]),r=fy._createCloseBracketRegExp(t[1]);n&&r&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,r){if(e>=3)for(let o=0,s=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o=2&&n.length>0){for(let o=0,s=this._brackets.length;o"u"?t:o}function Gst(i){return i.replace(/[\[\]]/g,"")}const qi=Sn("languageService");class lf{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}const rye=[];function Tn(i,e,t){e instanceof lf||(e=new lf(e,[],!!t)),rye.push([i,e])}function vae(){return rye}const wr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),I3={JSONContribution:"base.contributions.json"};function qst(i){return i.length>0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class Xst{constructor(){this._onDidChangeSchema=new ae,this.schemasById={}}registerSchema(e,t){this.schemasById[qst(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Yst=new Xst;ur.add(I3.JSONContribution,Yst);const Rh={Configuration:"base.contributions.configuration"},iL="vscode://schemas/settings/resourceLanguage",_ae=ur.as(I3.JSONContribution);class Zst{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new ae,this._onDidUpdateConfiguration=new ae,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:w("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={},_ae.registerSchema(iL,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),_ae.registerSchema(iL,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),e_.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(o[a]))c.set(f,s);const u={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=Gst(a),h={type:"object",default:u,description:w("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:iL,defaultDefaultValue:u,source:Ea(s)?void 0:s,defaultValueSource:s};r.push(...KA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,n),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,n,r,o=3,s){var a;o=sc(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&eat(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),e_.test(u)?d.scope=void 0:(d.scope=sc(d.scope)?o:d.scope,d.restricted=sc(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const r=n.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=n.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:w("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:iL};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),w("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let r=n==null?void 0:n.value,o=n==null?void 0:n.source;xl(r)&&(r=t.defaultDefaultValue,o=void 0),xl(r)&&(r=Jst(t.type)),t.default=r,t.defaultValueSource=o}}const oye="\\[([^\\]]+)\\]",bae=new RegExp(oye,"g"),Qst=`^(${oye})+$`,e_=new RegExp(Qst);function KA(i){const e=[];if(e_.test(i)){let t=bae.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=bae.exec(i)}}return Ap(e)}function Jst(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const $M=new Zst;ur.add(Rh.Configuration,$M);function eat(i,e){var t,n,r,o;return i.trim()?e_.test(i)?w("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):$M.getConfigurationProperties()[i]!==void 0?w("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):!((t=e.policy)===null||t===void 0)&&t.name&&$M.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?w("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(r=e.policy)===null||r===void 0?void 0:r.name,$M.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:w("config.property.empty","Cannot register an empty property")}const tat={ModesRegistry:"editor.modesRegistry"};class nat{constructor(){this._onDidChangeLanguages=new ae,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new oat(this,a,l),closing:l}}),o=new Hse(a=>{const l=new Set,c=new Set;return{info:new sat(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?Cae(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function Cae(i){return i.filter(([e,t])=>e!==""&&t!=="")}class sye{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class oat extends sye{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class sat extends sye{constructor(e,t,n,r){super(e,t),this.openingBrackets=n,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 aat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class P9{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=Sn("languageConfigurationService");let hz=class extends me{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new dat),this.onDidChangeEmitter=this._register(new ae),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(fz));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>n.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new P9(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new P9(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new P9(r.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=lat(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};hz=aat([yae(0,mn),yae(1,qi)],hz);function lat(i,e,t,n){let r=e.getLanguageConfiguration(i);if(!r){if(!n.isRegisteredLanguageId(i))return new Jy(i,{});r=new Jy(i,{})}const o=cat(r.languageId,t),s=lye([r.underlyingConfig,o]);return new Jy(r.languageId,s)}const fz={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function cat(i,e){const t=e.getValue(fz.brackets,{overrideIdentifier:i}),n=e.getValue(fz.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:wae(t),colorizedBracketPairs:wae(n)}}function wae(i){if(Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function aye(i,e,t){const n=i.getLineContent(e);let r=yi(n);return r.length>t-1&&(r=r.substring(0,t-1)),r}function Qy(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),r=typeof t>"u"?i.getLineMaxColumn(e)-1:t-1;return x3(n,r)}class uat{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Sae(e,t,++this._order);return this._entries.push(n),this._resolved=null,Ot(()=>{for(let r=0;re.configuration)))}}function lye(i){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 i)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 Sae{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class xae{constructor(e){this.languageId=e}}class dat extends me{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._register(this.register(mc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let r=this._entries.get(e);r||(r=new uat(e),this._entries.set(e,r));const o=r.register(t,n);return this._onDidChange.fire(new xae(e)),Ot(()=>{o.dispose(),this._onDidChange.fire(new xae(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Jy{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 fy(this.underlyingConfig):null,this.comments=Jy._handleComments(this.underlyingConfig),this.characterPair=new Gw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||QX,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new jst(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new rat(e,this.underlyingConfig)}getWordDefinition(){return JX(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Bst(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Ust(this.brackets)),this._electricCharacter}onEnter(e,t,n,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,r):null}getAutoClosingPairs(){return new Tst(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;n.blockCommentStartToken=r,n.blockCommentEndToken=o}return n}}Tn(Ti,hz,1);class wm{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Lae{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new wm(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 gf{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=gf._getElements(e),[a,l,c]=gf._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(gf._isStringArray(t)){const n=new Int32Array(t.length);for(let r=0,o=t.length;r=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let d;return n<=r?(g1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new wm(e,0,n,r-n+1)]):e<=t?(g1.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new wm(e,t-e+1,n,0)]):(g1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),g1.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,n,u,o);let h=[];return o[0]?h=[new wm(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new wm(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m,v,_){let y=null,S=null,L=new Eae,E=t,D=n,k=f[0]-m[0]-r,T=-1073741824,M=this.m_forwardHistory.length-1;do{const P=k+e;P===E||P=0&&(c=this.m_forwardHistory[M],e=c[0],E=1,D=c.length-1)}while(--M>=-1);if(y=L.getReverseChanges(),_[0]){let P=f[0]+1,N=m[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];P=Math.max(P,R.getOriginalEnd()),N=Math.max(N,R.getModifiedEnd())}S=[new wm(P,h-P+1,N,p-N+1)]}else{L=new Eae,E=s,D=a,k=f[0]-m[0]-l,T=1073741824,M=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const P=k+o;P===E||P=u[P+1]?(d=u[P+1]-1,g=d-k-l,d>T&&L.MarkNextChange(),T=d+1,L.AddOriginalElement(d+1,g+1),k=P+1-o):(d=u[P-1],g=d-k-l,d>T&&L.MarkNextChange(),T=d,L.AddModifiedElement(d+1,g+1),k=P-1-o),M>=0&&(u=this.m_reverseHistory[M],o=u[0],E=1,D=u.length-1)}while(--M>=-1);S=L.getChanges()}return this.ConcatenateChanges(y,S)}ComputeRecursionPoint(e,t,n,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-n),p=g+1,m=new Int32Array(p),v=new Int32Array(p),_=r-n,y=t-e,S=e-n,L=t-r,D=(y-_)%2===0;m[_]=e,v[y]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let T=0,M=0;u=this.ClipDiagonalBound(_-k,k,_,p),d=this.ClipDiagonalBound(_+k,k,_,p);for(let N=u;N<=d;N+=2){N===u||NT+M&&(T=l,M=c),!D&&Math.abs(N-y)<=k-1&&l>=v[N])return o[0]=l,s[0]=c,R<=v[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):null}const P=(T-e+(M-n)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(T,P))return a[0]=!0,o[0]=T,s[0]=M,P>0&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):(e++,n++,[new wm(e,t-e+1,n,r-n+1)]);h=this.ClipDiagonalBound(y-k,k,y,p),f=this.ClipDiagonalBound(y+k,k,y,p);for(let N=h;N<=f;N+=2){N===h||N=v[N+1]?l=v[N+1]-1:l=v[N-1],c=l-(N-y)-L;const R=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(v[N]=l,D&&Math.abs(N-_)<=k&&l<=m[N])return o[0]=l,s[0]=c,R>=m[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a):null}if(k<=1447){let N=new Int32Array(d-u+2);N[0]=_-u+1,p1.Copy2(m,u,N,1,d-u+1),this.m_forwardHistory.push(N),N=new Int32Array(f-h+2),N[0]=y-h+1,p1.Copy2(v,h,N,1,f-h+1),this.m_reverseHistory.push(N)}}return this.WALKTRACE(_,u,d,S,y,h,f,L,m,v,l,t,o,c,r,s,D,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.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,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let r=0;for(let o=0;o=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,r)?1:0;return o+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return p1.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],p1.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return p1.Copy(e,0,r,0,e.length),p1.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,n){if(g1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),g1.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new wm(r,o,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e255?255:i|0}function m1(i){return i<0?0:i>4294967295?4294967295:i|0}class fat{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=m1(e);const n=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(n.length+o),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=m1(e),t=m1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const o=n.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=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=m1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,o=0,s=0;for(;t<=n;)if(r=t+(n-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e=o)t=r+1;else break;return new cye(r,e-s)}}class gat{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],n=t>0?this._prefixSum[t-1]:0;return new cye(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=n3(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;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+n;for(let o=0;o=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class qA{constructor(){this._actual=new GS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class mat{constructor(e,t,n){const r=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const r=new mat(n,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let A9=null;function _at(){return A9===null&&(A9=new vat([[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]])),A9}let rL=null;function bat(){if(rL===null){rL=new GS(0);const i=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tr);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=_at()){const n=bat(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,m=!1;for(;c=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}gz.INSTANCE=new gz;class yat extends GS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const cu=wat(i=>new yat(i));var Cc;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Cc||(Cc={}));var Uf;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(Uf||(Uf={}));var kl;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(kl||(kl={}));var qu;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(qu||(qu={}));class HM{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&&pc(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 hI{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function Sat(i){return i&&typeof i.read=="function"}class O9{constructor(e,t,n,r,o,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class xat{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class Lat{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function uye(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const Eat=999;class C0{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Dat(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=a1e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new xat(t,this.wordSeparators?cu(this.wordSeparators):null,n?this.searchString:null)}}function Dat(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const r=i.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function I0(i,e,t){if(!t)return new hI(i,null);const n=[];for(let r=0,o=e.length;r>0);t[o]>=e?r=o-1:t[o+1]>=e?(n=o,r=o):n=o+1}return n+1}}class UR{static findMatches(e,t,n,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new gy(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,n,s,r,o):[]}static _getMultilineMatchRange(e,t,n,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new W(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new Dae(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=I0(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,n,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const u=new gy(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=I0(new W(n,d.index+1+r,n,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new gy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,s,r):this._doFindNextMatchLineByLine(e,n,s,r)}static _doFindNextMatchMultiline(e,t,n,r){const o=new le(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new W(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new Dae(l):null;n.reset(t.column-1);const u=n.next(l);return u?I0(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new le(1,1),n,r):null}static _doFindNextMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,r,o){e.reset(r-1);const s=e.next(t);return s?I0(new W(n,s.index+1,n,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new gy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,r):this._doFindPreviousMatchLineByLine(e,n,s,r)}static _doFindPreviousMatchMultiline(e,t,n,r){const o=this._doFindMatchesMultiline(e,new W(1,1,t.lineNumber,t.column),n,r,10*Eat);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new le(s,e.getLineMaxColumn(s)),n,r):null}static _doFindPreviousMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,n,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=I0(new W(n,s.index+1,n,s.index+1+s[0].length),s,r);return o}}function Iat(i,e,t,n,r){if(n===0)return!0;const o=e.charCodeAt(n-1);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function kat(i,e,t,n,r){if(n+r===t)return!0;const o=e.charCodeAt(n+r);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n+r-1);if(i.get(s)!==0)return!0}return!1}function kY(i,e,t,n,r){return Iat(i,e,t,n,r)&&kat(i,e,t,n,r)}class gy{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const r=n.index,o=n[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){BA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||kY(this._wordSeparators,e,t,r,o))return n}while(n);return null}}class TY{static computeUnicodeHighlights(e,t,n){const r=n?n.startLineNumber:1,o=n?n.endLineNumber:e.getLineCount(),s=new Iae(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Tat(Array.from(a))}`,"g");const c=new gy(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let m=r,v=o;m<=v;m++){const _=e.getLineContent(m),y=_.length;c.reset(0);do if(h=c.next(_),h){let S=h.index,L=h.index+h[0].length;if(S>0){const T=_.charCodeAt(S-1);Do(T)&&S--}if(L+1=T){d=!0;break e}u.push(new W(m,S+1,m,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Iae(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(o),a=Wb.getLocales().filter(l=>!Wb.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Tat(i,e){return`[${vc(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Iae{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Wb.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Of.codePoints)kae(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=hT(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Of.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!kae(e)&&Of.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function kae(i){return i===" "||i===` +`||i===" "}class VM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class dye{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class bn{static addRange(e,t){let n=0;for(;nt)throw new Qi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new bn(this.start+e,this.endExclusive+e)}deltaStart(e){return new bn(this.start+e,this.endExclusive)}deltaEnd(e){return new bn(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=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Qi(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Qi(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function fI(i,e,t){const n=Nat(i,e);if(n!==-1)return i[n]}function Nat(i,e,t=i.length-1){for(let n=t;n>=0;n--){const r=i[n];if(e(r))return n}return-1}function Xw(i,e){const t=gI(i,e);return t===-1?void 0:i[t]}function gI(i,e,t=0,n=i.length){let r=t,o=n;for(;r0&&(t=r)}return t}function Mat(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=r)}return t}function Pat(i,e){return RY(i,(t,n)=>-e(t,n))}function Aat(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function Oat(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}let vn=class Sm{static fromRangeInclusive(e){return new Sm(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Uu(e[0].slice());for(let n=1;nt)throw new Qi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&er.endLineNumberExclusive>=e.startLineNumber),n=gI(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}contains(e){const t=Xw(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=Xw(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,r=0,o=null;for(;n=s.startLineNumber?o=new vn(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new Uu(t)}subtractFrom(e){const t=pI(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=gI(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Uu([e]);const r=[];let o=e.startLineNumber;for(let s=t;so&&r.push(new vn(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let n=0,r=0;for(;nt.delta(e)))}}class el{static inverse(e,t,n){const r=[];let o=1,s=1;for(const l of e){const c=new el(new vn(o,l.original.startLineNumber),new vn(s,l.modified.startLineNumber));c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new el(new vn(o,t+1),new vn(s,n+1));return a.modified.isEmpty||r.push(a),r}static clip(e,t,n){const r=[];for(const o of e){const s=o.original.intersect(t),a=o.modified.intersect(n);s&&!s.isEmpty&&a&&!a.isEmpty&&r.push(new el(s,a))}return r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new el(this.modified,this.original)}join(e){return new el(this.original.join(e.original),this.modified.join(e.modified))}}class mh extends el{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new mh(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class t_{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new t_(this.modifiedRange,this.originalRange)}}const Fat=3;class Bat{computeDiff(e,t,n){var r;const s=new Hat(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new vn(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new vn(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new vn(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new vn(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new mh(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new t_(new W(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new W(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new mh(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Kw(()=>V1e(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(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 ew{constructor(e,t,n,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new ew(r,o,s,a,l,c,u,d)}}function $at(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,r=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=hye(f,g,o,!0).changes;a&&(p=$at(p)),h=[];for(let m=0,v=p.length;m1&&p>1;){const m=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(m!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,p)}{let g=mz(h,1),p=mz(f,1);const m=h.length+1,v=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Eo.fromOffsetPairs(r?r.getEndExclusives():Zc.zero,o?o.getStarts():new Zc(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Eo(new bn(e.offset1,t.offset1),new bn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Eo(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Eo(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Eo(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Eo(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Eo(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Eo(t,n)}getStarts(){return new Zc(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Zc(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Zc{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Zc(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Zc.zero=new Zc(0,0);Zc.max=new Zc(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class mI{isValid(){return!0}}mI.instance=new mI;class Vat{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Qi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=r?r(g,p):1):_=-1;const y=Math.max(m,v,_);if(y===_){const S=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,S+1),s.set(g,p,3)}else y===m?(a.set(g,p,0),s.set(g,p,1)):y===v&&(a.set(g,p,0),s.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new Eo(new bn(g+1,c),new bn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new Cp(l,!1)}}class fye{compute(e,t,n=mI.instance){if(e.length===0||t.length===0)return Cp.trivial(e,t);const r=e,o=t;function s(p,m){for(;pr.length||S>o.length)continue;const L=s(y,S);l.set(u,L);const E=y===v?c.get(u+1):c.get(u-1);if(c.set(u,L!==y?new Rae(E,y,S,L-y):E),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const p=d?d.x+d.length:0,m=d?d.y+d.length:0;if((p!==f||m!==g)&&h.push(new Eo(new bn(p,f),new bn(m,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new Cp(h,!1)}}class Rae{constructor(e,t,n,r){this.prev=e,this.x=t,this.y=n,this.length=r}}class Uat{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class jat{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var Mae,Pae;class Kat{constructor(e,t){this.uri=e,this.value=t}}function Gat(i){return Array.isArray(i)}class Mr{constructor(e,t){if(this[Mae]="ResourceMap",e instanceof Mr)this.map=new Map(e.map),this.toKey=t??Mr.defaultToKey;else if(Gat(e)){this.map=new Map,this.toKey=t??Mr.defaultToKey;for(const[n,r]of e)this.set(n,r)}else this.map=new Map,this.toKey=e??Mr.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Kat(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[n,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]}*[(Mae=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Mr.defaultToKey=i=>i.toString();class qat{constructor(){this[Pae]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let r=this._map.get(e);if(r)r.value=t,n!==0&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){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 n=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!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:[n.key,n.value],done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}[(Pae=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),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 n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class R_ extends qat{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class Xat{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}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 MY{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);n&&n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class YA{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new bn(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=Oae(e>0?this.elements[e-1]:-1),n=Oae(en<=e);return new le(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return W.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!B9(this.elements[e]))return;let t=e;for(;t>0&&B9(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,o=(n=Rat(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new bn(r,o)}}function B9(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Yat={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:30,[6]:3,[7]:10,[8]:10};function Aae(i){return Yat[i]}function Oae(i){return i===10?8:i===13?7:vz(i)?6:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:i===44||i===59?5:4}function Zat(i,e,t,n,r,o){let{moves:s,excludedChanges:a}=Jat(i,e,t,o);if(!o.isValid())return[];const l=i.filter(u=>!a.has(u)),c=elt(l,n,r,e,t,o);return QH(s,c),s=tlt(s),s=s.filter(u=>{const d=u.original.toOffsetRange().slice(e).map(f=>f.trim());return d.join(` `).length>=15&&Qat(d,f=>f.length>=2)>=2}),s=nlt(i,s),s}function Qat(i,e){let t=0;for(const n of i)e(n)&&t++;return t}function Jat(i,e,t,n){const r=[],o=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Yw(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Yw(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),r.push(new el(l.range,u.range)),a.add(l.source),a.add(u.source)),!n.isValid())return{moves:r,excludedChanges:a}}return{moves:r,excludedChanges:a}}function elt(i,e,t,n,r,o){const s=[],a=new MY;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,mp));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const S of f)if(S.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&S.modifiedLineRange.endLineNumberExclusive+1===m.endLineNumberExclusive){S.originalLineRange=new vn(S.originalLineRange.startLineNumber,_.endLineNumberExclusive),S.modifiedLineRange=new vn(S.modifiedLineRange.startLineNumber,m.endLineNumberExclusive),v.push(S);return}const y={modifiedLineRange:m,originalLineRange:_};l.push(y),v.push(y)}),f=v}if(!o.isValid())return[]}l.sort(kCe(nu(h=>h.modifiedLineRange.length,mp)));const c=new Uu,u=new Uu;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=u.subtractFrom(h.originalLineRange).getWithDelta(f),m=g.getIntersection(p);for(const v of m.ranges){if(v.length<3)continue;const _=v,y=v.delta(-f);s.push(new el(y,_)),c.addRange(_),u.addRange(y)}}s.sort(nu(h=>h.original.startLineNumber,mp));const d=new vT(i);for(let h=0;hE.original.startLineNumber<=f.original.startLineNumber),p=Xw(i,E=>E.modified.startLineNumber<=f.modified.startLineNumber),m=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),v=d.findLastMonotonous(E=>E.original.startLineNumberE.modified.startLineNumbern.length||D>r.length||c.contains(D)||u.contains(E)||!Fae(n[E-1],r[D-1],o))break}S>0&&(u.addRange(new vn(f.original.startLineNumber-S,f.original.startLineNumber)),c.addRange(new vn(f.modified.startLineNumber-S,f.modified.startLineNumber)));let L;for(L=0;Ln.length||D>r.length||c.contains(D)||u.contains(E)||!Fae(n[E-1],r[D-1],o))break}L>0&&(u.addRange(new vn(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new vn(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(S>0||L>0)&&(s[h]=new el(new vn(f.original.startLineNumber-S,f.original.endLineNumberExclusive+L),new vn(f.modified.startLineNumber-S,f.modified.endLineNumberExclusive+L)))}return s}function Fae(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const r=new fye().compute(new YA([i],new bn(0,1),!1),new YA([e],new bn(0,1),!1),t);let o=0;const s=Eo.invert(r.diffs,i.length);for(const u of s)u.seq1Range.forEach(d=>{vz(i.charCodeAt(d))||o++});function a(u){let d=0;for(let h=0;he.length?i:e);return o/l>.6&&l>10}function tlt(i){if(i.length===0)return i;i.sort(nu(t=>t.original.startLineNumber,mp));const e=[i[0]];for(let t=1;t=0&&s>=0&&o+s<=2){e[e.length-1]=n.join(r);continue}e.push(r)}return e}function nlt(i,e){const t=new vT(i);return e=e.filter(n=>{const r=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}r.push(a)}return n.length>0&&r.push(n[n.length-1]),r}function ilt(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,o=t[n],s=n+1=n.start&&i.seq2Range.start-s>=r.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=u)}return i.delta(l)}function rlt(i,e,t){const n=[];for(const r of t){const o=n[n.length-1];if(!o){n.push(r);continue}r.seq1Range.start-o.seq1Range.endExclusive<=2||r.seq2Range.start-o.seq2Range.endExclusive<=2?n[n.length-1]=new Eo(o.seq1Range.join(r.seq1Range),o.seq2Range.join(r.seq2Range)):n.push(r)}return n}function olt(i,e,t){const n=Eo.invert(t,i.length),r=[];let o=new Zc(0,0);function s(l,c){if(l.offset10;){const m=n[0];if(!(m.seq1Range.intersects(u)||m.seq2Range.intersects(d)))break;const _=i.findWordContaining(m.seq1Range.start),y=e.findWordContaining(m.seq2Range.start),S=new Eo(_,y),L=S.intersect(m);if(g+=L.seq1Range.length,p+=L.seq2Range.length,h=h.join(S),h.seq1Range.endExclusive>=m.seq1Range.endExclusive)n.shift();else break}g+p<(h.seq1Range.length+h.seq2Range.length)*2/3&&r.push(h),o=h.getEndExclusives()}for(;n.length>0;){const l=n.shift();l.seq1Range.isEmpty||(s(l.getStarts(),l),s(l.getEndExclusives().delta(-1),l))}return slt(t,r)}function slt(i,e){const t=[];for(;i.length>0||e.length>0;){const n=i[0],r=e[0];let o;n&&(!r||n.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function alt(i,e,t){let n=t;if(n.length===0)return n;let r=0,o;do{o=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];u(c,l)?(o=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(r++<10&&o);return n}function llt(i,e,t){let n=t;if(n.length===0)return n;let r=0,o;do{o=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const v=i.getText(p).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),y=f.seq1Range.length,S=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,E=i.countLinesIn(g.seq1Range),D=g.seq1Range.length,k=e.countLinesIn(g.seq2Range),T=g.seq2Range.length,M=2*40+50;function P(N){return Math.min(N,M)}return Math.pow(Math.pow(P(_*40+y),1.5)+Math.pow(P(S*40+L),1.5),1.5)+Math.pow(Math.pow(P(E*40+D),1.5)+Math.pow(P(k*40+T),1.5),1.5)>(M**1.5)**1.5*1.3};const c=n[l],u=a[a.length-1];d(u,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(r++<10&&o);const s=[];return snt(n,(a,l,c)=>{let u=l;function d(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new bn(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=i.getText(new bn(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const p=Eo.fromOffsetPairs(a?a.getEndExclusives():Zc.zero,c?c.getStarts():Zc.max),m=u.intersect(p);s.length>0&&m.getStarts().equals(s[s.length-1].getEndExclusives())?s[s.length-1]=s[s.length-1].join(m):s.push(m)}),s}class $ae{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:Hae(this.lines[e-1]),n=e===this.lines.length?0:Hae(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function Hae(i){let e=0;for(;eL===E))return new VM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new VM([new mh(new vn(1,e.length+1),new vn(1,t.length+1),[new e_(new W(1,1,e.length,e[0].length+1),new W(1,1,t.length,t[0].length+1))])],[],!1);const r=n.maxComputationTimeMs===0?mI.instance:new Vat(n.maxComputationTimeMs),o=!n.ignoreTrimWhitespace,s=new Map;function a(L){let E=s.get(L);return E===void 0&&(E=s.size,s.set(L,E)),E}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new $ae(l,e),d=new $ae(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(L,E)=>e[L]===t[E]?t[E].length===0?.1:1+Math.log(1+t[E].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=_z(u,d,f),f=alt(u,d,f);const p=[],m=L=>{if(o)for(let E=0;EL.seq1Range.start-v===L.seq2Range.start-_);const E=L.seq1Range.start-v;m(E),v=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const D=this.refineDiff(e,t,L,r,o);D.hitTimeout&&(g=!0);for(const k of D.mappings)p.push(k)}m(e.length-v);const y=Vae(p,e,t);let S=[];return n.computeMoves&&(S=this.computeMoves(y,e,t,l,c,r,o)),Kw(()=>{function L(D,k){if(D.lineNumber<1||D.lineNumber>k.length)return!1;const T=k[D.lineNumber-1];return!(D.column<1||D.column>T.length+1)}function E(D,k){return!(D.startLineNumber<1||D.startLineNumber>k.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>k.length+1)}for(const D of y){if(!D.innerChanges)return!1;for(const k of D.innerChanges)if(!(L(k.modifiedRange.getStartPosition(),t)&&L(k.modifiedRange.getEndPosition(),t)&&L(k.originalRange.getStartPosition(),e)&&L(k.originalRange.getEndPosition(),e)))return!1;if(!E(D.modified,t)||!E(D.original,e))return!1}return!0}),new VM(y,S,g)}computeMoves(e,t,n,r,o,s,a){return Zat(e,t,n,r,o,s).map(u=>{const d=this.refineDiff(t,n,new Eo(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=Vae(d.mappings,t,n,!0);return new dye(u,h)})}refineDiff(e,t,n,r,o){const s=new YA(e,n.seq1Range,o),a=new YA(t,n.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=_z(s,a,c),c=olt(s,a,c),c=rlt(s,a,c),c=llt(s,a,c),{mappings:c.map(d=>new e_(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function Vae(i,e,t,n=!1){const r=[];for(const o of KX(i.map(s=>clt(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new mh(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Kw(()=>!n&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:V1e(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+r&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+r&&(n=1);const o=new vn(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+r),s=new vn(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+r);return new mh(o,s,[i])}const zae={getLegacy:()=>new Bat,getDefault:()=>new gye};function Ev(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Rn{constructor(e,t,n,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,n))|0,this.a=Ev(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 zu{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ev(Math.max(Math.min(1,t),0),3),this.l=Ev(Math.max(Math.min(1,n),0),3),this.a=Ev(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,n=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-r)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:r,a:o}=e;let s,a,l;if(n===0)s=a=l=r;else{const c=r<.5?r*(1+n):r+n-r*n,u=2*r-c;s=zu._hue2rgb(u,c,t+1/3),a=zu._hue2rgb(u,c,t),l=zu._hue2rgb(u,c,t-1/3)}return new Rn(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class Sf{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ev(Math.max(Math.min(1,t),0),3),this.v=Ev(Math.max(Math.min(1,n),0),3),this.a=Ev(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,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((n-r)/a%6+6)%6:o===n?c=(r-t)/a+2:c=(t-n)/a+4,new Sf(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:n,v:r,a:o}=e,s=r*n,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Rn(c,u,d,o)}}class Ce{static fromHex(e){return Ce.Format.CSS.parseHex(e)||Ce.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:zu.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Sf.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Rn)this.rgba=e;else if(e instanceof zu)this._hsla=e,this.rgba=zu.toRGBA(e);else if(e instanceof Sf)this._hsva=e,this.rgba=Sf.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Rn.equals(this.rgba,e.rgba)&&zu.equals(this.hsla,e.hsla)&&Sf.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Ce._relativeLuminanceForComponent(this.rgba.r),t=Ce._relativeLuminanceForComponent(this.rgba.g),n=Ce._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*n;return Ev(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(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const r of n){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Uae(oL(i,r),sL(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Uae(oL(i,r),sL(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=jae(oL(i,r),sL(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=jae(oL(i,r),sL(a,c),!0)}else s==="#"&&(l=ult(oL(i,r),s+a));l&&e.push(l)}return e}function hlt(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:dlt(i)}class flt extends pat{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>o&&(n=o,r=!0)}return r?{lineNumber:t,column:n}:e}}class Dv{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new flt(Ft.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]}async computeUnicodeHighlights(e,t,n){const r=this._getModel(e);return r?TY.computeUnicodeHighlights(r,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,n,r){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:Dv.computeDiff(o,s,n,r)}static computeDiff(e,t,n,r){const o=r==="advanced"?zae.getDefault():zae.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(let o=1;o<=n;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,n){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return W.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;lDv._diffLimit){o.push({range:l,text:c});continue}const h=hat(d,c,n),f=r.offsetAt(W.lift(l).getStartPosition());for(const g of h){const p=r.positionAt(f+g.originalStart),m=r.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:m.lineNumber,endColumn:m.column}};r.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?Cat(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?hlt(t):null}async textualSuggest(e,t,n,r){const o=new Fs,s=new RegExp(n,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>Dv._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,n,r){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(n,r),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(XX(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(n){return Promise.reject(n)}}}Dv._diffLimit=1e5;Dv._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=r1e());const AY=Sn("textResourceConfigurationService"),mye=Sn("textResourcePropertiesService"),yt=Sn("ILanguageFeaturesService");var glt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},aL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Kae=60*1e3,Gae=5*60*1e3;function I0(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let bz=class extends me{constructor(e,t,n,r,o){super(),this._modelService=e,this._workerManager=this._register(new mlt(this._modelService,r)),this._logService=n,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>I0(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new plt(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return I0(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,n))}async computeDiff(e,t,n,r){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new dye(new el(new vn(l[0],l[1]),new vn(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new mh(new vn(c[0],c[1]),new vn(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new e_(new W(d[0],d[1],d[2],d[3]),new W(d[4],d[5],d[6],d[7]))))})}}computeMoreMinimalEdits(e,t,n=!1){if(Ms(t)){if(!I0(this._modelService,e))return Promise.resolve(t);const r=Fs.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,Yv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return I0(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,n))}canComputeWordRanges(e){return I0(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};bz=glt([aL(0,rr),aL(1,AY),aL(2,Ra),aL(3,Ti),aL(4,yt)],bz);class plt{constructor(e,t,n,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}async provideCompletionItems(e,t){const n=this._configurationService.getValue(e.uri,t,"editor");if(n.wordBasedSuggestions==="off")return;const r=[];if(n.wordBasedSuggestions==="currentDocument")I0(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())I0(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(n.wordBasedSuggestions==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new W(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):W.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=await(await this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}}}class mlt extends me{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new CY).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Gae/2),ort),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>Gae&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new OY(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class vlt extends me{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const r=new vY;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Kae/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const r=n.toString();this._syncedModels[r]||this._beginModelSync(n,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>Kae&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const o=new Fe;o.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(n.onWillDispose(()=>{this._stopModelSync(r)})),o.add(Ot(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class qae{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class W9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class OY extends me{constructor(e,t,n,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new S3(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Lst(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new W9(this)))}catch(e){uz(e),this._worker=new qae(new Dv(new W9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(uz(e),this._worker=new qae(new Dv(new W9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new vlt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Cit()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),n,r))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,n){const r=await this._withSyncedResources(e),o=n.source,s=n.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function _lt(i,e,t){return new blt(i,e,t)}class blt extends OY{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?XX(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const _T={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Zw=new class{clone(){return this}equals(i){return this===i}};function FY(i,e){return new aY([new iI(0,"",i)],e)}function k3(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new o3(t,e===null?Zw:e)}class fs{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 n="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(n+=" mtki"),r&2&&(n+=" mtkb"),r&4&&(n+=" mtku"),r&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[n]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:!!(n&1),bold:!!(n&2),underline:!!(n&4),strikethrough:!!(n&8)}}}class Io{static createEmpty(e,t){const n=Io.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=n,new Io(r,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof Io?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(n<<1);for(let s=r;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=fs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return fs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return fs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return fs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return fs.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return fs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Io.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new BY(this,e,t,n)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;nt&&(r=o)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,r="";const o=new Array;let s=0;for(;;){const a=ts){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),n++}else break}return new Io(new Uint32Array(o),r,this._languageIdCodec)}}Io.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class BY{constructor(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o=n);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof BY?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class wa{constructor(e,t,n,r){this.startColumn=e,this.endColumn=t,this.className=n,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 n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o=o||(a[l++]=new wa(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,n,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new wa(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const n=wa._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,n);break}this.count++}}class Clt{static normalize(e,t){if(t.length===0)return[];const n=[],r=new ZA;let o=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);Do(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);Do(p)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,n),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,n),n}}class $o{constructor(e,t,n,r){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class vye{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class R_{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m,v,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(wa.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=m==="all"?4:m==="boundary"?1:m==="selection"?2:m==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((E,D)=>E.startOffset>>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,n,r){const o=(t<<16|n<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),n=cf.getPartIndex(t),r=cf.getCharIndex(t);return new _ye(n,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const r=(e<<16|n<<0)>>>0;let o=0,s=this.length-1;for(;o+1>>1,m=this._data[p];if(m===r)return p;m>r?s=p:o=p}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=cf.getPartIndex(a),u=cf.getCharIndex(a),d=cf.getPartIndex(l);let h;c!==d?h=t:h=cf.getCharIndex(l);const f=n-u,g=h-n;return f<=g?o:s}}class Cz{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function bT(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,r=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,n++));e.appendString("");const o=new cf(1,t+n);return o.setColumnInfo(1,t,0,0),new Cz(o,!1,r)}return e.appendString(""),new Cz(new cf(0,0),!1,0)}return klt(Slt(i),e)}class ylt{constructor(e,t,n,r){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=r}}function T3(i){const e=new KS(1e4),t=bT(i,e);return new ylt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class wlt{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=m}}function Slt(i){const e=i.lineContent;let t,n,r;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(o[s++]=new $o(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=r){const f=e?Uw(i.substring(a,r)):!1;o[s++]=new $o(r,d,0,f);break}const h=e?Uw(i.substring(a,u)):!1;o[s++]=new $o(u,d,0,h),a=u}return o}function Llt(i,e,t){let n=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s=50&&(r[o++]=new $o(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new $o(c,u,d,h))}else r[o++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function Elt(i,e){const t=[];let n=new $o(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;rn.endIndex&&(n=new $o(r,o.type,o.metadata,o.containsRTL),t.push(n)),n=new $o(r+1,"mtkcontrol",o.metadata,!1),t.push(n))}r>n.endIndex&&(n=new $o(s,o.type,o.metadata,o.containsRTL),t.push(n))}return t}function Dlt(i,e,t,n){const r=i.continuesWithWrappedLine,o=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,m=n[p].type,v=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let S=!1,L=Js(e),E;L===-1?(S=!0,L=t,E=t):E=rh(e);let D=!1,k=0,T=c&&c[k],M=a%s;for(let N=o;N=T.endOffset&&(k++,T=c&&c[k]);let O;if(NE)O=!0;else if(R===9)O=!0;else if(R===32)if(u)if(D)O=!0;else{const B=N+1N),O&&d&&(O=S||N>E),O&&v&&N>=L&&N<=E&&(O=!1),D){if(!O||!l&&M>=s){if(h){const B=g>0?f[g-1].endIndex:o;for(let $=B+1;$<=N;$++)f[g++]=new $o($,"mtkw",1,!1)}else f[g++]=new $o(N,"mtkw",1,!1);M=M%s}}else(N===_||O&&N>o)&&(f[g++]=new $o(N,m,0,v),M=M%s);for(R===9?M=s:Xv(R)?M+=2:M++,D=O;N===_&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;N===32&&R!==32&&R!==9||(P=!0)}else P=!0;if(P)if(h){const N=g>0?f[g-1].endIndex:o;for(let R=N+1;R<=t;R++)f[g++]=new $o(R,"mtkw",1,!1)}else f[g++]=new $o(t,"mtkw",1,!1);else f[g++]=new $o(t,m,0,v);return f}function Ilt(i,e,t,n){n.sort(wa.compare);const r=Clt.normalize(i,n),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new $o(c,p,m,v)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new $o(c,p+" "+_.className,m|_.metadata,v),s++;else{c=g,a[l++]=new $o(c,p+" "+_.className,m|_.metadata,v);break}}g>c&&(c=g,a[l++]=new $o(c,p,m,v))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let T=0,M=c.length;T=u&&(ie+=J)}}for($&&(e.appendString(' style="width:'),e.appendString(String(g*U)),e.appendString('px"')),e.appendASCIICharCode(62);S1?e.appendCharCode(8594):e.appendCharCode(65515);for(let J=2;J<=Y;J++)e.appendCharCode(160)}else ie=2,Y=1,e.appendCharCode(p),e.appendCharCode(8204);E+=ie,D+=Y,S>=u&&(L+=Y)}}else for(e.appendASCIICharCode(62);S=u&&(L+=ie)}G?k++:k=0,S>=s&&!y&&P.isPseudoAfter()&&(y=!0,_.setColumnInfo(S+1,T,E,D)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,E,D),a&&(e.appendString(''),e.appendString(w("showMore","Show more ({0})",Nlt(l))),e.appendString("")),e.appendString(""),new Cz(_,f,r)}function Tlt(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Nlt(i){return i<1024?w("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class Yae{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}}class Rlt{constructor(e,t){this.tabSize=e,this.data=t}}class WY{constructor(e,t,n,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class yc{constructor(e,t,n,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=r,this.isBasicASCII=yc.isBasicASCII(n,s),this.containsRTL=yc.containsRTL(n,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?hT(e):!0}static containsRTL(e,t,n){return!t&&n?Uw(e):!1}}class BE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class Mlt{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new BE(new W(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Cye{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class vI{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&lr(e.data,t.data)}static equalsArr(e,t){return lr(e,t,vI.equals)}}function Plt(i){return Array.isArray(i)}function Alt(i){return!Plt(i)}function yye(i){return typeof i=="string"}function Zae(i){return!yye(i)}function B1(i){return!i}function Iv(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function Qae(i){return i.replace(/[&<>'"_]/g,"-")}function Olt(i,e){console.log(`${i.languageId}: ${e}`)}function Ui(i,e){return new Error(`${i.languageId}: ${e}`)}function Wm(i,e,t,n,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,f,g,p){return B1(c)?B1(u)?!B1(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function Flt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var Blt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yz;const wye=5;class _I{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 tw(e,t);let n=tw.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let r=this._entries[n];return r||(r=new tw(e,t),this._entries[n]=r,r)}}_I._INSTANCE=new _I(wye);class tw{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 tw._equals(this,e)}push(e){return _I.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return _I.create(this.parent,e)}}class py{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 py(this.languageId,this.state)}}class $m{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 WE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new WE(e,t);const n=tw.getStackElementId(e);let r=this._entries[n];return r||(r=new WE(e,null),this._entries[n]=r,r)}}$m._INSTANCE=new $m(wye);class WE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:$m.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof WE)||!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 $lt{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 iI(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,r){const o=n.languageId,s=n.state,a=gr.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new iI(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 aY(this._tokens,e)}}class QA{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const r=e!==null?e.length:0,o=t.length,s=n!==null?n.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return n;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=gr.get(t);if(n){if(n instanceof yz){const r=n.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}gr.isResolved(t)||e.push(gr.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=_I.create(null,this._lexer.start);return $m.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return FY(this._languageId,n);const r=new $lt,o=this._tokenize(e,t,n,r);return r.finalize(o)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return k3(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const r=new QA(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,n,r);return r.finalize(o)}_tokenize(e,t,n,r){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,r):this._myTokenize(e,t,n,0,r)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=jR(this._lexer,t.stack.state),!n))throw Ui(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of n){if(!Zae(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c0&&o.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,n,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let T=this._lexer.tokenizer[v];if(!T&&(T=jR(this._lexer,v),!T))throw Ui(this._lexer,"tokenizer state is not defined: "+v);const M=a.substr(d);for(const P of T)if((d===0||!P.matchOnlyAtLineStart)&&(_=M.match(P.regex),_)){y=_[0],S=P.action;break}}if(_||(_=[""],y=""),S||(d=this._lexer.maxStack)throw Ui(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(v)}else if(S.next==="@pop"){if(u.depth<=1)throw Ui(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(S.next==="@popall")u=u.popall();else{let T=Wm(this._lexer,S.next,y,_,v);if(T[0]==="@"&&(T=T.substr(1)),jR(this._lexer,T))u=u.push(T);else throw Ui(this._lexer,"trying to set a next state '"+T+"' that is undefined in rule: "+this._safeRuleName(L))}}S.log&&typeof S.log=="string"&&Olt(this._lexer,this._lexer.languageId+": "+Wm(this._lexer,S.log,y,_,v))}if(D===null)throw Ui(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const k=T=>{const M=this._languageService.getLanguageIdByLanguageName(T)||this._languageService.getLanguageIdByMimeType(T)||T,P=this._getNestedEmbeddedLanguageData(M);if(d0)throw Ui(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==D.length+1)throw Ui(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let T=0;for(let M=1;M<_.length;M++)T+=_[M].length;if(T!==y.length)throw Ui(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let M=0;Mi});class $Y{static colorizeElement(e,t,n,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;const c=u=>{var d;const h=(d=$9==null?void 0:$9.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static async colorize(e,t,n,r){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),gY(t)&&(t=t.substr(1));const a=ng(t);if(!e.isRegisteredLanguageId(n))return Jae(a,s,o);const l=await gr.getOrCreate(n);return l?Vlt(a,s,l,o):Jae(a,s,o)}static colorizeLine(e,t,n,r,o=4){const s=yc.isBasicASCII(e,t),a=yc.containsRTL(e,s,n);return T3(new R_(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Vlt(i,e,t,n){return new Promise((r,o)=>{const s=()=>{const a=zlt(i,e,t,n);if(t instanceof bI){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function Jae(i,e,t){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function zlt(i,e,t,n){let r=[],o=t.getInitialState();for(let s=0,a=i.length;s"),o=c.endState}return r.join("")}const ele=2e4;let k0,zM,wz,UM,Sz;function Ult(i){k0=document.createElement("div"),k0.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),k0.appendChild(n),n};zM=e(),wz=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),k0.appendChild(n),n};UM=t(),Sz=t(),i.appendChild(k0)}function Pl(i){k0&&(zM.textContent!==i?(Ps(wz),JA(zM,i)):(Ps(zM),JA(wz,i)))}function jf(i){k0&&(UM.textContent!==i?(Ps(Sz),JA(UM,i)):(Ps(UM),JA(Sz,i)))}function JA(i,e){Ps(i),e.length>ele&&(e=e.substr(0,ele)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const HY=Sn("markerDecorationsService");var jlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Klt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let CI=class{constructor(e,t){}dispose(){}};CI.ID="editor.contrib.markerDecorations";CI=jlt([Klt(1,HY)],CI);Kn(CI.ID,CI,0);class Sye extends me{constructor(e,t){super(),this._onDidChange=this._register(new ae),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 n=!1,r=!1;const o=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{Ml(Bt(this._referenceDomElement),()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{s&&s[0]&&s[0].contentRect?e={width:s[0].contentRect.width,height:s[0].contentRect.height}:e=null,n=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}}class kv{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=kv._read(e,this.key),n=o=>kv._read(e,o),r=(o,s)=>kv._write(e,o,s);this.migrate(t,n,r)}static _read(e,t){if(typeof e>"u")return;const n=t.indexOf(".");if(n>=0){const r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),n);return}e[t]=n}}kv.items=[];function Mh(i,e){kv.items.push(new kv(i,e))}function Bl(i,e){Mh(i,(t,n,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(i,s);return}}})}function Glt(i){kv.items.forEach(e=>e.apply(i))}Bl("wordWrap",[[!0,"on"],[!1,"off"]]);Bl("lineNumbers",[[!0,"on"],[!1,"off"]]);Bl("cursorBlinking",[["visible","solid"]]);Bl("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Bl("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Bl("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Bl("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Bl("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Bl("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Bl("autoIndent",[[!1,"advanced"],[!0,"full"]]);Bl("matchBrackets",[[!0,"always"],[!1,"never"]]);Bl("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Bl("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Bl("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);Bl("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Mh("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Mh("renderIndentGuides",(i,e,t)=>{typeof i<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!i))});Mh("highlightActiveIndentGuide",(i,e,t)=>{typeof i<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!i))});const qlt={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"};Mh("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(qlt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)>"u"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Mh("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Mh("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",i))});Mh("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",i))});Mh("codeActionsOnSave",(i,e,t)=>{if(i&&typeof i=="object"){let n=!1;const r={};for(const o of Object.entries(i))typeof o[1]=="boolean"?(n=!0,r[o[0]]=o[1]?"explicit":"never"):r[o[0]]=o[1];n&&t("codeActionsOnSave",r)}});Mh("codeActionWidget.includeNearbyQuickfixes",(i,e,t)=>{typeof i=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",i))});Mh("lightbulb.enabled",(i,e,t)=>{typeof i=="boolean"&&t("lightbulb.enabled",i?void 0:"off")});class Xlt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new ae,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Qw=new Xlt,pd=Sn("accessibilityService"),CT=new ct("accessibilityModeEnabled",!1);var Ylt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xz=class extends me{constructor(e,t,n,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new ae),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new zCe,this.isSimpleWidget=e,this._containerObserver=this._register(new Sye(n,t.dimension)),this._targetWindowId=Bt(n).vscodeWindowId,this._rawOptions=tle(t),this._validatedOptions=Hm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Kc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Qw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(sz.onDidChange(()=>this._recomputeOptions())),this._register(cI.getInstance(Bt(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Hm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=hb.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Qw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Hm.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:Jlt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:db||lu,pixelRatio:cI.getInstance(tae(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return sz.readFontInfo(tae(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=tle(e);Hm.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Hm.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=Qlt(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())}};xz=Ylt([Zlt(3,pd)],xz);function Qlt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function Jlt(){let i="";return!Fp&&!g1e&&(i+="no-user-select "),Fp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Dn&&(i+="mac "),i}class ect{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class tct{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 Hm{static validateOptions(e){const t=new ect;for(const n of uy){const r=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){const n=new tct;for(const r of uy)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}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)?lr(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Hm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let r=!1;for(const o of uy){const s=!Hm._deepEquals(e._read(o.id),t._read(o.id));n[o.id]=s,s&&(r=!0)}return r?new VCe(n):null}static applyUpdate(e,t){let n=!1;for(const r of uy)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,n=n||o.didChange}return n}}function tle(i){const e=Fg(i);return Glt(e),e}var Jm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},n={...e},r={...e};let o=0;const s={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,m()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){v()}i.onKeyUp=h;function f(){v()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),m())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function m(){setTimeout(v)}function v(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",r),o++,y())}function _(D,k){const T=performance.getEntriesByName(D)[0].duration;k.total+=T,k.min=Math.min(k.min,T),k.max=Math.max(k.max,T)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function S(){if(o===0)return;const D={keydown:L(e),input:L(t),render:L(n),total:L(r),sampleCount:o};return E(e),E(t),E(n),E(r),o=0,D}i.getAndClearMeasurements=S;function L(D){return{average:D.total/o,max:D.max,min:D.min}}function E(D){D.total=0,D.min=Number.MAX_VALUE,D.max=0}})(Jm||(Jm={}));class qS{constructor(){this._hooks=new Fe,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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Ot(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Bt(e)}this._hooks.add(xe(s,Je.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(xe(s,Je.POINTER_UP,a=>this.stopMonitoring(!0)))}}function VY(i){return`--vscode-${i.replace(/\./g,"-")}`}function ft(i){return`var(${VY(i)})`}function nct(i,e){return`var(${VY(i)}, ${e})`}const xye={ColorContribution:"base.contributions.colors"};class ict{constructor(){this._onDidChangeSchema=new ae,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,o){const s={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),r&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const r=n.defaults[t.type];return Dd(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const r=t.indexOf(".")===-1?0:1,o=n.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const N3=new ict;ur.add(xye.ColorContribution,N3);function X(i,e,t,n,r){return N3.registerColor(i,e,t,n,r)}const et=X("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},w("foreground","Overall foreground color. This color is only used if not overridden by a component."));X("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},w("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));X("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},w("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));X("descriptionForeground",{light:"#717171",dark:Mt(et,.7),hcDark:Mt(et,.7),hcLight:Mt(et,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const xf=X("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),Qc=X("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},w("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=X("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Ki=X("contrastActiveBorder",{light:null,dark:null,hcDark:Qc,hcLight:Qc},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));X("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},w("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."));X("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Ce.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));const rct=X("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));X("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));X("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));X("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));X("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));X("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Ce.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));X("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Ce.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));const np=X("widget.shadow",{dark:Mt(Ce.black,.36),light:Mt(Ce.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Lye=X("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Eye=X("input.background",{dark:"#3C3C3C",light:Ce.white,hcDark:Ce.black,hcLight:Ce.white},w("inputBoxBackground","Input box background.")),Dye=X("input.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("inputBoxForeground","Input box foreground.")),Iye=X("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("inputBoxBorder","Input box border.")),zY=X("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},w("inputBoxActiveOptionBorder","Border color of activated options in input fields."));X("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields."));const G0=X("inputOption.activeBackground",{dark:Mt(Qc,.4),light:Mt(Qc,.2),hcDark:Ce.transparent,hcLight:Ce.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),UY=X("inputOption.activeForeground",{dark:Ce.white,light:Ce.black,hcDark:et,hcLight:et},w("inputOption.activeForeground","Foreground color of activated options in input fields."));X("input.placeholderForeground",{light:Mt(et,.5),dark:Mt(et,.5),hcDark:Mt(et,.7),hcLight:Mt(et,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const oct=X("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),sct=X("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),act=X("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},w("inputValidationInfoBorder","Input validation border color for information severity.")),lct=X("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),cct=X("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),uct=X("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},w("inputValidationWarningBorder","Input validation border color for warning severity.")),dct=X("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),hct=X("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),fct=X("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},w("inputValidationErrorBorder","Input validation border color for error severity.")),Lf=X("dropdown.background",{dark:"#3C3C3C",light:Ce.white,hcDark:Ce.black,hcLight:Ce.white},w("dropdownBackground","Dropdown background.")),gct=X("dropdown.listBackground",{dark:null,light:null,hcDark:Ce.black,hcLight:Ce.white},w("dropdownListBackground","Dropdown list background.")),ip=X("dropdown.foreground",{dark:"#F0F0F0",light:et,hcDark:Ce.white,hcLight:et},w("dropdownForeground","Dropdown foreground.")),my=X("dropdown.border",{dark:Lf,light:"#CECECE",hcDark:Ln,hcLight:Ln},w("dropdownBorder","Dropdown border.")),zL=X("button.foreground",{dark:Ce.white,light:Ce.white,hcDark:Ce.white,hcLight:Ce.white},w("buttonForeground","Button foreground color.")),pct=X("button.separator",{dark:Mt(zL,.4),light:Mt(zL,.4),hcDark:Mt(zL,.4),hcLight:Mt(zL,.4)},w("buttonSeparator","Button separator color.")),UL=X("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),mct=X("button.hoverBackground",{dark:oh(UL,.2),light:yC(UL,.2),hcDark:UL,hcLight:UL},w("buttonHoverBackground","Button background color when hovering.")),vct=X("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},w("buttonBorder","Button border color.")),_ct=X("button.secondaryForeground",{dark:Ce.white,light:Ce.white,hcDark:Ce.white,hcLight:et},w("buttonSecondaryForeground","Secondary button foreground color.")),Lz=X("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Ce.white},w("buttonSecondaryBackground","Secondary button background color.")),bct=X("button.secondaryHoverBackground",{dark:oh(Lz,.2),light:yC(Lz,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),jM=X("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Ce.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Cct=X("badge.foreground",{dark:Ce.white,light:"#333",hcDark:Ce.white,hcLight:Ce.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),jL=X("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),KL=X("scrollbarSlider.background",{dark:Ce.fromHex("#797979").transparent(.4),light:Ce.fromHex("#646464").transparent(.4),hcDark:Mt(Ln,.6),hcLight:Mt(Ln,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),GL=X("scrollbarSlider.hoverBackground",{dark:Ce.fromHex("#646464").transparent(.7),light:Ce.fromHex("#646464").transparent(.7),hcDark:Mt(Ln,.8),hcLight:Mt(Ln,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),qL=X("scrollbarSlider.activeBackground",{dark:Ce.fromHex("#BFBFBF").transparent(.4),light:Ce.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),yct=X("progressBar.background",{dark:Ce.fromHex("#0E70C0"),light:Ce.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},w("progressBarBackground","Background color of the progress bar that can show for long running operations."));X("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},w("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 Ef=X("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),wct=X("editorError.border",{dark:null,light:null,hcDark:Ce.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),KR=X("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zs=X("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),yI=X("editorWarning.border",{dark:null,light:null,hcDark:Ce.fromHex("#FFCC00").transparent(.8),hcLight:Ce.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));X("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},w("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 tl=X("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),wI=X("editorInfo.border",{dark:null,light:null,hcDark:Ce.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),Sct=X("editorHint.foreground",{dark:Ce.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));X("editorHint.border",{dark:null,light:null,hcDark:Ce.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));X("sash.hoverBorder",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},w("sashActiveBorder","Border color of active sashes."));const ko=X("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Ce.black,hcLight:Ce.white},w("editorBackground","Editor background color.")),Xu=X("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Ce.white,hcLight:et},w("editorForeground","Editor default foreground color."));X("editorStickyScroll.background",{light:ko,dark:ko,hcDark:ko,hcLight:ko},w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));X("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));X("editorStickyScroll.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));X("editorStickyScroll.shadow",{dark:jL,light:jL,hcDark:jL,hcLight:jL},w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Pr=X("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Ce.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),rp=X("editorWidget.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),op=X("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},w("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."));X("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},w("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."));const nle=X("quickInput.background",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),xct=X("quickInput.foreground",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Lct=X("quickInputTitle.background",{dark:new Ce(new Rn(255,255,255,.105)),light:new Ce(new Rn(0,0,0,.06)),hcDark:"#000000",hcLight:Ce.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),kye=X("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Ce.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),Ect=X("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Ce.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),Dct=X("keybindingLabel.background",{dark:new Ce(new Rn(128,128,128,.17)),light:new Ce(new Rn(221,221,221,.4)),hcDark:Ce.transparent,hcLight:Ce.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Ict=X("keybindingLabel.foreground",{dark:Ce.fromHex("#CCCCCC"),light:Ce.fromHex("#555555"),hcDark:Ce.white,hcLight:et},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),kct=X("keybindingLabel.border",{dark:new Ce(new Rn(51,51,51,.6)),light:new Ce(new Rn(204,204,204,.4)),hcDark:new Ce(new Rn(111,195,223)),hcLight:Ln},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Tct=X("keybindingLabel.bottomBorder",{dark:new Ce(new Rn(68,68,68,.6)),light:new Ce(new Rn(187,187,187,.4)),hcDark:new Ce(new Rn(111,195,223)),hcLight:et},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ev=X("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),Nct=X("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Ce.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),Tye=X("editor.inactiveSelectionBackground",{light:Mt(ev,.5),dark:Mt(ev,.5),hcDark:Mt(ev,.7),hcLight:Mt(ev,.5)},w("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),jY=X("editor.selectionHighlightBackground",{light:ule(ev,ko,.3,.6),dark:ule(ev,ko,.3,.6),hcDark:null,hcLight:null},w("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);X("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));X("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const sp=X("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},w("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},w("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findMatchBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("editorFindMatchBorder","Border color of the current search match."));const tv=X("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("findMatchHighlightBorder","Border color of the other search matches.")),Rct=X("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Mt(Ki,.4),hcLight:Mt(Ki,.4)},w("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("searchEditor.findMatchBackground",{light:Mt(sp,.66),dark:Mt(sp,.66),hcDark:sp,hcLight:sp},w("searchEditor.queryMatch","Color of the Search Editor query matches."));X("searchEditor.findMatchBorder",{light:Mt(tv,.66),dark:Mt(tv,.66),hcDark:tv,hcLight:tv},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));X("search.resultsInfoForeground",{light:et,dark:Mt(et,.65),hcDark:et,hcLight:et},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));X("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},w("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 eO=X("editorHoverWidget.background",{light:Pr,dark:Pr,hcDark:Pr,hcLight:Pr},w("hoverBackground","Background color of the editor hover."));X("editorHoverWidget.foreground",{light:rp,dark:rp,hcDark:rp,hcLight:rp},w("hoverForeground","Foreground color of the editor hover."));const Nye=X("editorHoverWidget.border",{light:op,dark:op,hcDark:op,hcLight:op},w("hoverBorder","Border color of the editor hover."));X("editorHoverWidget.statusBarBackground",{dark:oh(eO,.2),light:yC(eO,.05),hcDark:Pr,hcLight:Pr},w("statusBarBackground","Background color of the editor hover status bar."));const Mct=X("editorLink.activeForeground",{dark:"#4E94CE",light:Ce.blue,hcDark:Ce.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),ap=X("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Ce.white,hcLight:Ce.black},w("editorInlayHintForeground","Foreground color of inline hints")),lp=X("editorInlayHint.background",{dark:Mt(jM,.1),light:Mt(jM,.1),hcDark:Mt(Ce.white,.1),hcLight:Mt(jM,.1)},w("editorInlayHintBackground","Background color of inline hints")),Pct=X("editorInlayHint.typeForeground",{dark:ap,light:ap,hcDark:ap,hcLight:ap},w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Act=X("editorInlayHint.typeBackground",{dark:lp,light:lp,hcDark:lp,hcLight:lp},w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Oct=X("editorInlayHint.parameterForeground",{dark:ap,light:ap,hcDark:ap,hcLight:ap},w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Fct=X("editorInlayHint.parameterBackground",{dark:lp,light:lp,hcDark:lp,hcLight:lp},w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),GR=X("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));X("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));X("editorLightBulbAi.foreground",{dark:GR,light:GR,hcDark:GR,hcLight:GR},w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));const Ez=new Ce(new Rn(155,185,85,.2)),Dz=new Ce(new Rn(255,0,0,.2)),Bct=X("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},w("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Wct=X("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},w("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.insertedLineBackground",{dark:Ez,light:Ez,hcDark:null,hcLight:null},w("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.removedLineBackground",{dark:Dz,light:Dz,hcDark:null,hcLight:null},w("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));X("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const $ct=X("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Hct=X("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));X("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));X("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));X("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("diffEditorBorder","Border color between the two text editors."));X("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},w("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));X("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));X("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));X("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Vct=X("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),zct=X("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Uct=X("list.focusOutline",{dark:Qc,light:Qc,hcDark:Ki,hcLight:Ki},w("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.")),jct=X("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),cp=X("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("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.")),Df=X("list.activeSelectionForeground",{dark:Ce.white,light:Ce.white,hcDark:null,hcLight:null},w("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.")),XL=X("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Kct=X("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("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.")),Gct=X("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),qct=X("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Xct=X("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Yct=X("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Rye=X("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Ce.white.transparent(.1),hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Mye=X("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Zct=X("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},w("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),Qct=X("list.dropBetweenBackground",{dark:xf,light:xf,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),Yu=X("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Qc,hcLight:Qc},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),qR=X("list.focusHighlightForeground",{dark:Yu,light:Iut(cp,Yu,"#BBE7FF"),hcDark:Yu,hcLight:Yu},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));X("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},w("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));X("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));X("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const Jct=X("listFilterWidget.background",{light:yC(Pr,0),dark:oh(Pr,0),hcDark:Pr,hcLight:Pr},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),eut=X("listFilterWidget.outline",{dark:Ce.transparent,light:Ce.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),tut=X("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),nut=X("listFilterWidget.shadow",{dark:np,light:np,hcDark:np,hcLight:np},w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));X("list.filterMatchBackground",{dark:sp,light:sp,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));X("list.filterMatchBorder",{dark:tv,light:tv,hcDark:Ln,hcLight:Ki},w("listFilterMatchHighlightBorder","Border color of the filtered match."));const YL=X("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),iut=X("tree.inactiveIndentGuidesStroke",{dark:Mt(YL,.4),light:Mt(YL,.4),hcDark:Mt(YL,.4),hcLight:Mt(YL,.4)},w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),rut=X("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),out=X("tree.tableOddRowsBackground",{dark:Mt(et,.04),light:Mt(et,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));X("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const sut=X("checkbox.background",{dark:Lf,light:Lf,hcDark:Lf,hcLight:Lf},w("checkbox.background","Background color of checkbox widget."));X("checkbox.selectBackground",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const aut=X("checkbox.foreground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("checkbox.foreground","Foreground color of checkbox widget.")),lut=X("checkbox.border",{dark:my,light:my,hcDark:my,hcLight:my},w("checkbox.border","Border color of checkbox widget."));X("checkbox.selectBorder",{dark:xf,light:xf,hcDark:xf,hcLight:xf},w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const ile=X("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),q0=X("quickInputList.focusForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),vy=X("quickInputList.focusIconForeground",{dark:XL,light:XL,hcDark:XL,hcLight:XL},w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),X0=X("quickInputList.focusBackground",{dark:SI(ile,cp),light:SI(ile,cp),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item.")),cut=X("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("menuBorder","Border color of menus.")),uut=X("menu.foreground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("menuForeground","Foreground color of menu items.")),dut=X("menu.background",{dark:Lf,light:Lf,hcDark:Lf,hcLight:Lf},w("menuBackground","Background color of menu items.")),hut=X("menu.selectionForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),fut=X("menu.selectionBackground",{dark:cp,light:cp,hcDark:cp,hcLight:cp},w("menuSelectionBackground","Background color of the selected menu item in menus.")),gut=X("menu.selectionBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("menuSelectionBorder","Border color of the selected menu item in menus.")),put=X("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},w("menuSeparatorBackground","Color of a separator menu item in menus.")),rle=X("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));X("toolbar.hoverOutline",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));X("toolbar.activeBackground",{dark:oh(rle,.1),light:yC(rle,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));X("editor.snippetTabstopHighlightBackground",{dark:new Ce(new Rn(124,124,124,.3)),light:new Ce(new Rn(10,50,100,.2)),hcDark:new Ce(new Rn(124,124,124,.3)),hcLight:new Ce(new Rn(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));X("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));X("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));X("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Ce(new Rn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const mut=X("breadcrumb.foreground",{light:Mt(et,.8),dark:Mt(et,.8),hcDark:Mt(et,.8),hcLight:Mt(et,.8)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),vut=X("breadcrumb.background",{light:ko,dark:ko,hcDark:ko,hcLight:ko},w("breadcrumbsBackground","Background color of breadcrumb items.")),ole=X("breadcrumb.focusForeground",{light:yC(et,.2),dark:oh(et,.1),hcDark:oh(et,.1),hcLight:oh(et,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),_ut=X("breadcrumb.activeSelectionForeground",{light:yC(et,.2),dark:oh(et,.1),hcDark:oh(et,.1),hcLight:oh(et,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));X("breadcrumbPicker.background",{light:Pr,dark:Pr,hcDark:Pr,hcLight:Pr},w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const Pye=.5,sle=Ce.fromHex("#40C8AE").transparent(Pye),ale=Ce.fromHex("#40A6FF").transparent(Pye),lle=Ce.fromHex("#606060").transparent(.4),Zu=.4,Jw=1,_y=X("merge.currentHeaderBackground",{dark:sle,light:sle,hcDark:null,hcLight:null},w("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.currentContentBackground",{dark:Mt(_y,Zu),light:Mt(_y,Zu),hcDark:Mt(_y,Zu),hcLight:Mt(_y,Zu)},w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const by=X("merge.incomingHeaderBackground",{dark:ale,light:ale,hcDark:null,hcLight:null},w("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.incomingContentBackground",{dark:Mt(by,Zu),light:Mt(by,Zu),hcDark:Mt(by,Zu),hcLight:Mt(by,Zu)},w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Cy=X("merge.commonHeaderBackground",{dark:lle,light:lle,hcDark:null,hcLight:null},w("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.commonContentBackground",{dark:Mt(Cy,Zu),light:Mt(Cy,Zu),hcDark:Mt(Cy,Zu),hcLight:Mt(Cy,Zu)},w("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const eS=X("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));X("editorOverviewRuler.currentContentForeground",{dark:Mt(_y,Jw),light:Mt(_y,Jw),hcDark:eS,hcLight:eS},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.incomingContentForeground",{dark:Mt(by,Jw),light:Mt(by,Jw),hcDark:eS,hcLight:eS},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.commonContentForeground",{dark:Mt(Cy,Jw),light:Mt(Cy,Jw),hcDark:eS,hcLight:eS},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const KY=X("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),ZL=X("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),yy=X("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),R3=X("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),cle=X("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),but=X("minimap.infoHighlight",{dark:tl,light:tl,hcDark:wI,hcLight:wI},w("minimapInfo","Minimap marker color for infos.")),Cut=X("minimap.warningHighlight",{dark:Zs,light:Zs,hcDark:yI,hcLight:yI},w("overviewRuleWarning","Minimap marker color for warnings.")),yut=X("minimap.errorHighlight",{dark:new Ce(new Rn(255,18,18,.7)),light:new Ce(new Rn(255,18,18,.7)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),wut=X("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},w("minimapBackground","Minimap background color.")),Sut=X("minimap.foregroundOpacity",{dark:Ce.fromHex("#000f"),light:Ce.fromHex("#000f"),hcDark:Ce.fromHex("#000f"),hcLight:Ce.fromHex("#000f")},w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));X("minimapSlider.background",{light:Mt(KL,.5),dark:Mt(KL,.5),hcDark:Mt(KL,.5),hcLight:Mt(KL,.5)},w("minimapSliderBackground","Minimap slider background color."));X("minimapSlider.hoverBackground",{light:Mt(GL,.5),dark:Mt(GL,.5),hcDark:Mt(GL,.5),hcLight:Mt(GL,.5)},w("minimapSliderHoverBackground","Minimap slider background color when hovering."));X("minimapSlider.activeBackground",{light:Mt(qL,.5),dark:Mt(qL,.5),hcDark:Mt(qL,.5),hcLight:Mt(qL,.5)},w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const xut=X("problemsErrorIcon.foreground",{dark:Ef,light:Ef,hcDark:Ef,hcLight:Ef},w("problemsErrorIconForeground","The color used for the problems error icon.")),Lut=X("problemsWarningIcon.foreground",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("problemsWarningIconForeground","The color used for the problems warning icon.")),Eut=X("problemsInfoIcon.foreground",{dark:tl,light:tl,hcDark:tl,hcLight:tl},w("problemsInfoIconForeground","The color used for the problems info icon."));X("charts.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("chartsForeground","The foreground color used in charts."));X("charts.lines",{dark:Mt(et,.5),light:Mt(et,.5),hcDark:Mt(et,.5),hcLight:Mt(et,.5)},w("chartsLines","The color used for horizontal lines in charts."));X("charts.red",{dark:Ef,light:Ef,hcDark:Ef,hcLight:Ef},w("chartsRed","The red color used in chart visualizations."));X("charts.blue",{dark:tl,light:tl,hcDark:tl,hcLight:tl},w("chartsBlue","The blue color used in chart visualizations."));X("charts.yellow",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("chartsYellow","The yellow color used in chart visualizations."));X("charts.orange",{dark:yy,light:yy,hcDark:yy,hcLight:yy},w("chartsOrange","The orange color used in chart visualizations."));X("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));X("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));function Dut(i,e){var t,n,r,o;switch(i.op){case 0:return(t=Dd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=Dd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(r=Dd(i.value,e))===null||r===void 0?void 0:r.transparent(i.factor);case 3:{const s=Dd(i.background,e);return s?(o=Dd(i.value,e))===null||o===void 0?void 0:o.makeOpaque(s):Dd(i.value,e)}case 4:for(const s of i.values){const a=Dd(s,e);if(a)return a}return;case 6:return Dd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=Dd(i.value,e);if(!s)return;const a=Dd(i.background,e);return a?s.isDarkerThan(a)?Ce.getLighterColor(s,a,i.factor).transparent(i.transparency):Ce.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw y3()}}function yC(i,e){return{op:0,value:i,factor:e}}function oh(i,e){return{op:1,value:i,factor:e}}function Mt(i,e){return{op:2,value:i,factor:e}}function SI(...i){return{op:4,values:i}}function Iut(i,e,t){return{op:6,if:i,then:e,else:t}}function ule(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function Dd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?Ce.fromHex(i):e.getColor(i);if(i instanceof Ce)return i;if(typeof i=="object")return Dut(i,e)}}const Aye="vscode://schemas/workbench-colors",Oye=ur.as(I3.JSONContribution);Oye.registerSchema(Aye,N3.getColorSchema());const dle=new mi(()=>Oye.notifySchemaChanged(Aye),200);N3.onDidChangeSchema(()=>{dle.isScheduled()||dle.schedule()});class M3{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new Fye(this.x-e.scrollX,this.y-e.scrollY)}}class Fye{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new M3(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class kut{constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this._editorPagePositionBrand=void 0}}class Tut{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function GY(i){const e=Hr(i);return new kut(e.left,e.top,e.width,e.height)}function qY(i,e,t){const n=e.width/i.offsetWidth,r=e.height/i.offsetHeight,o=(t.x-e.x)/n,s=(t.y-e.y)/r;return new Tut(o,s)}class t_ extends Gu{constructor(e,t,n){super(Bt(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new M3(this.posx,this.posy),this.editorPos=GY(n),this.relativePos=qY(n,this.editorPos,this.pos)}}class Nut{constructor(e){this._editorViewDomNode=e}_create(e){return new t_(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return xe(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return xe(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return xe(e,Je.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return xe(e,Je.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return xe(e,Je.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return xe(e,"mousemove",n=>t(this._create(n)))}}class Rut{constructor(e){this._editorViewDomNode=e}_create(e){return new t_(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return xe(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return xe(e,Je.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return xe(e,Je.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return xe(e,"pointermove",n=>t(this._create(n)))}}class Mut extends me{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new qS),this._keydownListener=null}startMonitoring(e,t,n,r,o){this._keydownListener=Lr(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{r(new t_(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class yT{constructor(e){this._editor=e,this._instanceId=++yT._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new mi(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let n=this._rules.get(t);if(!n){const r=this._counter++;n=new Put(t,`dyn-rule-${this._instanceId}-${r}`,VA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}yT._idPool=0;class Put{constructor(e,t,n,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new Fe,this._styleElement=_c(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=ft(o.id):s=o;const a=Aut(r);n+=` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function Hae(i){let e=0;for(;eL===E))return new VM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new VM([new mh(new vn(1,e.length+1),new vn(1,t.length+1),[new t_(new W(1,1,e.length,e[0].length+1),new W(1,1,t.length,t[0].length+1))])],[],!1);const r=n.maxComputationTimeMs===0?mI.instance:new Vat(n.maxComputationTimeMs),o=!n.ignoreTrimWhitespace,s=new Map;function a(L){let E=s.get(L);return E===void 0&&(E=s.size,s.set(L,E)),E}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new $ae(l,e),d=new $ae(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(L,E)=>e[L]===t[E]?t[E].length===0?.1:1+Math.log(1+t[E].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=_z(u,d,f),f=alt(u,d,f);const p=[],m=L=>{if(o)for(let E=0;EL.seq1Range.start-v===L.seq2Range.start-_);const E=L.seq1Range.start-v;m(E),v=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const D=this.refineDiff(e,t,L,r,o);D.hitTimeout&&(g=!0);for(const k of D.mappings)p.push(k)}m(e.length-v);const y=Vae(p,e,t);let S=[];return n.computeMoves&&(S=this.computeMoves(y,e,t,l,c,r,o)),Kw(()=>{function L(D,k){if(D.lineNumber<1||D.lineNumber>k.length)return!1;const T=k[D.lineNumber-1];return!(D.column<1||D.column>T.length+1)}function E(D,k){return!(D.startLineNumber<1||D.startLineNumber>k.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>k.length+1)}for(const D of y){if(!D.innerChanges)return!1;for(const k of D.innerChanges)if(!(L(k.modifiedRange.getStartPosition(),t)&&L(k.modifiedRange.getEndPosition(),t)&&L(k.originalRange.getStartPosition(),e)&&L(k.originalRange.getEndPosition(),e)))return!1;if(!E(D.modified,t)||!E(D.original,e))return!1}return!0}),new VM(y,S,g)}computeMoves(e,t,n,r,o,s,a){return Zat(e,t,n,r,o,s).map(u=>{const d=this.refineDiff(t,n,new Eo(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=Vae(d.mappings,t,n,!0);return new dye(u,h)})}refineDiff(e,t,n,r,o){const s=new YA(e,n.seq1Range,o),a=new YA(t,n.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=_z(s,a,c),c=olt(s,a,c),c=rlt(s,a,c),c=llt(s,a,c),{mappings:c.map(d=>new t_(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function Vae(i,e,t,n=!1){const r=[];for(const o of KX(i.map(s=>clt(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new mh(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Kw(()=>!n&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:V1e(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+r&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+r&&(n=1);const o=new vn(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+r),s=new vn(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+r);return new mh(o,s,[i])}const zae={getLegacy:()=>new Bat,getDefault:()=>new gye};function Ev(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Rn{constructor(e,t,n,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,n))|0,this.a=Ev(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 zu{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ev(Math.max(Math.min(1,t),0),3),this.l=Ev(Math.max(Math.min(1,n),0),3),this.a=Ev(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,n=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-r)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:r,a:o}=e;let s,a,l;if(n===0)s=a=l=r;else{const c=r<.5?r*(1+n):r+n-r*n,u=2*r-c;s=zu._hue2rgb(u,c,t+1/3),a=zu._hue2rgb(u,c,t),l=zu._hue2rgb(u,c,t-1/3)}return new Rn(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class Sf{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ev(Math.max(Math.min(1,t),0),3),this.v=Ev(Math.max(Math.min(1,n),0),3),this.a=Ev(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,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((n-r)/a%6+6)%6:o===n?c=(r-t)/a+2:c=(t-n)/a+4,new Sf(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:n,v:r,a:o}=e,s=r*n,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Rn(c,u,d,o)}}class Ce{static fromHex(e){return Ce.Format.CSS.parseHex(e)||Ce.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:zu.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Sf.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Rn)this.rgba=e;else if(e instanceof zu)this._hsla=e,this.rgba=zu.toRGBA(e);else if(e instanceof Sf)this._hsva=e,this.rgba=Sf.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Rn.equals(this.rgba,e.rgba)&&zu.equals(this.hsla,e.hsla)&&Sf.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Ce._relativeLuminanceForComponent(this.rgba.r),t=Ce._relativeLuminanceForComponent(this.rgba.g),n=Ce._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*n;return Ev(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(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const r of n){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Uae(oL(i,r),sL(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Uae(oL(i,r),sL(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=jae(oL(i,r),sL(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=jae(oL(i,r),sL(a,c),!0)}else s==="#"&&(l=ult(oL(i,r),s+a));l&&e.push(l)}return e}function hlt(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:dlt(i)}class flt extends pat{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>o&&(n=o,r=!0)}return r?{lineNumber:t,column:n}:e}}class Dv{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new flt(Ft.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]}async computeUnicodeHighlights(e,t,n){const r=this._getModel(e);return r?TY.computeUnicodeHighlights(r,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,n,r){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:Dv.computeDiff(o,s,n,r)}static computeDiff(e,t,n,r){const o=r==="advanced"?zae.getDefault():zae.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(let o=1;o<=n;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,n){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return W.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;lDv._diffLimit){o.push({range:l,text:c});continue}const h=hat(d,c,n),f=r.offsetAt(W.lift(l).getStartPosition());for(const g of h){const p=r.positionAt(f+g.originalStart),m=r.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:m.lineNumber,endColumn:m.column}};r.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?Cat(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?hlt(t):null}async textualSuggest(e,t,n,r){const o=new Fs,s=new RegExp(n,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>Dv._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,n,r){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(n,r),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(XX(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(n){return Promise.reject(n)}}}Dv._diffLimit=1e5;Dv._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=r1e());const AY=Sn("textResourceConfigurationService"),mye=Sn("textResourcePropertiesService"),yt=Sn("ILanguageFeaturesService");var glt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},aL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Kae=60*1e3,Gae=5*60*1e3;function k0(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let bz=class extends me{constructor(e,t,n,r,o){super(),this._modelService=e,this._workerManager=this._register(new mlt(this._modelService,r)),this._logService=n,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>k0(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new plt(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return k0(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,n))}async computeDiff(e,t,n,r){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new dye(new el(new vn(l[0],l[1]),new vn(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new mh(new vn(c[0],c[1]),new vn(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new t_(new W(d[0],d[1],d[2],d[3]),new W(d[4],d[5],d[6],d[7]))))})}}computeMoreMinimalEdits(e,t,n=!1){if(Ms(t)){if(!k0(this._modelService,e))return Promise.resolve(t);const r=Fs.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,Zv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return k0(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,n))}canComputeWordRanges(e){return k0(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};bz=glt([aL(0,or),aL(1,AY),aL(2,Ra),aL(3,Ti),aL(4,yt)],bz);class plt{constructor(e,t,n,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}async provideCompletionItems(e,t){const n=this._configurationService.getValue(e.uri,t,"editor");if(n.wordBasedSuggestions==="off")return;const r=[];if(n.wordBasedSuggestions==="currentDocument")k0(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())k0(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(n.wordBasedSuggestions==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new W(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):W.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=await(await this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}}}class mlt extends me{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new CY).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Gae/2),ort),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>Gae&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new OY(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class vlt extends me{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const r=new vY;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Kae/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const r=n.toString();this._syncedModels[r]||this._beginModelSync(n,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>Kae&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const o=new Fe;o.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(n.onWillDispose(()=>{this._stopModelSync(r)})),o.add(Ot(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class qae{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class W9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class OY extends me{constructor(e,t,n,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new S3(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Lst(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new W9(this)))}catch(e){uz(e),this._worker=new qae(new Dv(new W9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(uz(e),this._worker=new qae(new Dv(new W9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new vlt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Cit()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),n,r))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,n){const r=await this._withSyncedResources(e),o=n.source,s=n.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function _lt(i,e,t){return new blt(i,e,t)}class blt extends OY{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?XX(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const _T={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Zw=new class{clone(){return this}equals(i){return this===i}};function FY(i,e){return new aY([new iI(0,"",i)],e)}function k3(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new o3(t,e===null?Zw:e)}class fs{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 n="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(n+=" mtki"),r&2&&(n+=" mtkb"),r&4&&(n+=" mtku"),r&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[n]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:!!(n&1),bold:!!(n&2),underline:!!(n&4),strikethrough:!!(n&8)}}}class Io{static createEmpty(e,t){const n=Io.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=n,new Io(r,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof Io?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(n<<1);for(let s=r;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=fs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return fs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return fs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return fs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return fs.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return fs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Io.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new BY(this,e,t,n)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;nt&&(r=o)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,r="";const o=new Array;let s=0;for(;;){const a=ts){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),n++}else break}return new Io(new Uint32Array(o),r,this._languageIdCodec)}}Io.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class BY{constructor(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o=n);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof BY?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class wa{constructor(e,t,n,r){this.startColumn=e,this.endColumn=t,this.className=n,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 n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o=o||(a[l++]=new wa(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,n,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new wa(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const n=wa._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,n);break}this.count++}}class Clt{static normalize(e,t){if(t.length===0)return[];const n=[],r=new ZA;let o=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);Do(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);Do(p)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,n),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,n),n}}class $o{constructor(e,t,n,r){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class vye{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class M_{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m,v,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(wa.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=m==="all"?4:m==="boundary"?1:m==="selection"?2:m==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((E,D)=>E.startOffset>>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,n,r){const o=(t<<16|n<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),n=cf.getPartIndex(t),r=cf.getCharIndex(t);return new _ye(n,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const r=(e<<16|n<<0)>>>0;let o=0,s=this.length-1;for(;o+1>>1,m=this._data[p];if(m===r)return p;m>r?s=p:o=p}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=cf.getPartIndex(a),u=cf.getCharIndex(a),d=cf.getPartIndex(l);let h;c!==d?h=t:h=cf.getCharIndex(l);const f=n-u,g=h-n;return f<=g?o:s}}class Cz{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function bT(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,r=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,n++));e.appendString("");const o=new cf(1,t+n);return o.setColumnInfo(1,t,0,0),new Cz(o,!1,r)}return e.appendString(""),new Cz(new cf(0,0),!1,0)}return klt(Slt(i),e)}class ylt{constructor(e,t,n,r){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=r}}function T3(i){const e=new KS(1e4),t=bT(i,e);return new ylt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class wlt{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=m}}function Slt(i){const e=i.lineContent;let t,n,r;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(o[s++]=new $o(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=r){const f=e?Uw(i.substring(a,r)):!1;o[s++]=new $o(r,d,0,f);break}const h=e?Uw(i.substring(a,u)):!1;o[s++]=new $o(u,d,0,h),a=u}return o}function Llt(i,e,t){let n=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s=50&&(r[o++]=new $o(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new $o(c,u,d,h))}else r[o++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function Elt(i,e){const t=[];let n=new $o(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;rn.endIndex&&(n=new $o(r,o.type,o.metadata,o.containsRTL),t.push(n)),n=new $o(r+1,"mtkcontrol",o.metadata,!1),t.push(n))}r>n.endIndex&&(n=new $o(s,o.type,o.metadata,o.containsRTL),t.push(n))}return t}function Dlt(i,e,t,n){const r=i.continuesWithWrappedLine,o=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,m=n[p].type,v=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let S=!1,L=Js(e),E;L===-1?(S=!0,L=t,E=t):E=rh(e);let D=!1,k=0,T=c&&c[k],M=a%s;for(let N=o;N=T.endOffset&&(k++,T=c&&c[k]);let O;if(NE)O=!0;else if(R===9)O=!0;else if(R===32)if(u)if(D)O=!0;else{const B=N+1N),O&&d&&(O=S||N>E),O&&v&&N>=L&&N<=E&&(O=!1),D){if(!O||!l&&M>=s){if(h){const B=g>0?f[g-1].endIndex:o;for(let $=B+1;$<=N;$++)f[g++]=new $o($,"mtkw",1,!1)}else f[g++]=new $o(N,"mtkw",1,!1);M=M%s}}else(N===_||O&&N>o)&&(f[g++]=new $o(N,m,0,v),M=M%s);for(R===9?M=s:Yv(R)?M+=2:M++,D=O;N===_&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;N===32&&R!==32&&R!==9||(P=!0)}else P=!0;if(P)if(h){const N=g>0?f[g-1].endIndex:o;for(let R=N+1;R<=t;R++)f[g++]=new $o(R,"mtkw",1,!1)}else f[g++]=new $o(t,"mtkw",1,!1);else f[g++]=new $o(t,m,0,v);return f}function Ilt(i,e,t,n){n.sort(wa.compare);const r=Clt.normalize(i,n),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new $o(c,p,m,v)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new $o(c,p+" "+_.className,m|_.metadata,v),s++;else{c=g,a[l++]=new $o(c,p+" "+_.className,m|_.metadata,v);break}}g>c&&(c=g,a[l++]=new $o(c,p,m,v))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let T=0,M=c.length;T=u&&(ie+=J)}}for($&&(e.appendString(' style="width:'),e.appendString(String(g*U)),e.appendString('px"')),e.appendASCIICharCode(62);S1?e.appendCharCode(8594):e.appendCharCode(65515);for(let J=2;J<=Y;J++)e.appendCharCode(160)}else ie=2,Y=1,e.appendCharCode(p),e.appendCharCode(8204);E+=ie,D+=Y,S>=u&&(L+=Y)}}else for(e.appendASCIICharCode(62);S=u&&(L+=ie)}G?k++:k=0,S>=s&&!y&&P.isPseudoAfter()&&(y=!0,_.setColumnInfo(S+1,T,E,D)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,E,D),a&&(e.appendString(''),e.appendString(w("showMore","Show more ({0})",Nlt(l))),e.appendString("")),e.appendString(""),new Cz(_,f,r)}function Tlt(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Nlt(i){return i<1024?w("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class Yae{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}}class Rlt{constructor(e,t){this.tabSize=e,this.data=t}}class WY{constructor(e,t,n,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class yc{constructor(e,t,n,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=r,this.isBasicASCII=yc.isBasicASCII(n,s),this.containsRTL=yc.containsRTL(n,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?hT(e):!0}static containsRTL(e,t,n){return!t&&n?Uw(e):!1}}class BE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class Mlt{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new BE(new W(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Cye{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class vI{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&lr(e.data,t.data)}static equalsArr(e,t){return lr(e,t,vI.equals)}}function Plt(i){return Array.isArray(i)}function Alt(i){return!Plt(i)}function yye(i){return typeof i=="string"}function Zae(i){return!yye(i)}function B1(i){return!i}function Iv(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function Qae(i){return i.replace(/[&<>'"_]/g,"-")}function Olt(i,e){console.log(`${i.languageId}: ${e}`)}function Ui(i,e){return new Error(`${i.languageId}: ${e}`)}function Wm(i,e,t,n,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,f,g,p){return B1(c)?B1(u)?!B1(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function Flt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var Blt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yz;const wye=5;class _I{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 tw(e,t);let n=tw.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let r=this._entries[n];return r||(r=new tw(e,t),this._entries[n]=r,r)}}_I._INSTANCE=new _I(wye);class tw{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 tw._equals(this,e)}push(e){return _I.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return _I.create(this.parent,e)}}class py{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 py(this.languageId,this.state)}}class $m{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 WE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new WE(e,t);const n=tw.getStackElementId(e);let r=this._entries[n];return r||(r=new WE(e,null),this._entries[n]=r,r)}}$m._INSTANCE=new $m(wye);class WE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:$m.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof WE)||!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 $lt{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 iI(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,r){const o=n.languageId,s=n.state,a=gr.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new iI(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 aY(this._tokens,e)}}class QA{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const r=e!==null?e.length:0,o=t.length,s=n!==null?n.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return n;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=gr.get(t);if(n){if(n instanceof yz){const r=n.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}gr.isResolved(t)||e.push(gr.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=_I.create(null,this._lexer.start);return $m.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return FY(this._languageId,n);const r=new $lt,o=this._tokenize(e,t,n,r);return r.finalize(o)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return k3(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const r=new QA(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,n,r);return r.finalize(o)}_tokenize(e,t,n,r){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,r):this._myTokenize(e,t,n,0,r)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=jR(this._lexer,t.stack.state),!n))throw Ui(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of n){if(!Zae(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c0&&o.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,n,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let T=this._lexer.tokenizer[v];if(!T&&(T=jR(this._lexer,v),!T))throw Ui(this._lexer,"tokenizer state is not defined: "+v);const M=a.substr(d);for(const P of T)if((d===0||!P.matchOnlyAtLineStart)&&(_=M.match(P.regex),_)){y=_[0],S=P.action;break}}if(_||(_=[""],y=""),S||(d=this._lexer.maxStack)throw Ui(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(v)}else if(S.next==="@pop"){if(u.depth<=1)throw Ui(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(S.next==="@popall")u=u.popall();else{let T=Wm(this._lexer,S.next,y,_,v);if(T[0]==="@"&&(T=T.substr(1)),jR(this._lexer,T))u=u.push(T);else throw Ui(this._lexer,"trying to set a next state '"+T+"' that is undefined in rule: "+this._safeRuleName(L))}}S.log&&typeof S.log=="string"&&Olt(this._lexer,this._lexer.languageId+": "+Wm(this._lexer,S.log,y,_,v))}if(D===null)throw Ui(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const k=T=>{const M=this._languageService.getLanguageIdByLanguageName(T)||this._languageService.getLanguageIdByMimeType(T)||T,P=this._getNestedEmbeddedLanguageData(M);if(d0)throw Ui(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==D.length+1)throw Ui(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let T=0;for(let M=1;M<_.length;M++)T+=_[M].length;if(T!==y.length)throw Ui(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let M=0;Mi});class $Y{static colorizeElement(e,t,n,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;const c=u=>{var d;const h=(d=$9==null?void 0:$9.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static async colorize(e,t,n,r){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),gY(t)&&(t=t.substr(1));const a=ng(t);if(!e.isRegisteredLanguageId(n))return Jae(a,s,o);const l=await gr.getOrCreate(n);return l?Vlt(a,s,l,o):Jae(a,s,o)}static colorizeLine(e,t,n,r,o=4){const s=yc.isBasicASCII(e,t),a=yc.containsRTL(e,s,n);return T3(new M_(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Vlt(i,e,t,n){return new Promise((r,o)=>{const s=()=>{const a=zlt(i,e,t,n);if(t instanceof bI){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function Jae(i,e,t){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function zlt(i,e,t,n){let r=[],o=t.getInitialState();for(let s=0,a=i.length;s"),o=c.endState}return r.join("")}const ele=2e4;let T0,zM,wz,UM,Sz;function Ult(i){T0=document.createElement("div"),T0.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),T0.appendChild(n),n};zM=e(),wz=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),T0.appendChild(n),n};UM=t(),Sz=t(),i.appendChild(T0)}function Pl(i){T0&&(zM.textContent!==i?(Ps(wz),JA(zM,i)):(Ps(zM),JA(wz,i)))}function jf(i){T0&&(UM.textContent!==i?(Ps(Sz),JA(UM,i)):(Ps(UM),JA(Sz,i)))}function JA(i,e){Ps(i),e.length>ele&&(e=e.substr(0,ele)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const HY=Sn("markerDecorationsService");var jlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Klt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let CI=class{constructor(e,t){}dispose(){}};CI.ID="editor.contrib.markerDecorations";CI=jlt([Klt(1,HY)],CI);Kn(CI.ID,CI,0);class Sye extends me{constructor(e,t){super(),this._onDidChange=this._register(new ae),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 n=!1,r=!1;const o=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{Ml(Bt(this._referenceDomElement),()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{s&&s[0]&&s[0].contentRect?e={width:s[0].contentRect.width,height:s[0].contentRect.height}:e=null,n=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}}class kv{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=kv._read(e,this.key),n=o=>kv._read(e,o),r=(o,s)=>kv._write(e,o,s);this.migrate(t,n,r)}static _read(e,t){if(typeof e>"u")return;const n=t.indexOf(".");if(n>=0){const r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),n);return}e[t]=n}}kv.items=[];function Mh(i,e){kv.items.push(new kv(i,e))}function Bl(i,e){Mh(i,(t,n,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(i,s);return}}})}function Glt(i){kv.items.forEach(e=>e.apply(i))}Bl("wordWrap",[[!0,"on"],[!1,"off"]]);Bl("lineNumbers",[[!0,"on"],[!1,"off"]]);Bl("cursorBlinking",[["visible","solid"]]);Bl("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Bl("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Bl("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Bl("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Bl("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Bl("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Bl("autoIndent",[[!1,"advanced"],[!0,"full"]]);Bl("matchBrackets",[[!0,"always"],[!1,"never"]]);Bl("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Bl("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Bl("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);Bl("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Mh("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Mh("renderIndentGuides",(i,e,t)=>{typeof i<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!i))});Mh("highlightActiveIndentGuide",(i,e,t)=>{typeof i<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!i))});const qlt={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"};Mh("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(qlt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)>"u"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Mh("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Mh("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",i))});Mh("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",i))});Mh("codeActionsOnSave",(i,e,t)=>{if(i&&typeof i=="object"){let n=!1;const r={};for(const o of Object.entries(i))typeof o[1]=="boolean"?(n=!0,r[o[0]]=o[1]?"explicit":"never"):r[o[0]]=o[1];n&&t("codeActionsOnSave",r)}});Mh("codeActionWidget.includeNearbyQuickfixes",(i,e,t)=>{typeof i=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",i))});Mh("lightbulb.enabled",(i,e,t)=>{typeof i=="boolean"&&t("lightbulb.enabled",i?void 0:"off")});class Xlt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new ae,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Qw=new Xlt,pd=Sn("accessibilityService"),CT=new ct("accessibilityModeEnabled",!1);var Ylt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xz=class extends me{constructor(e,t,n,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new ae),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new zCe,this.isSimpleWidget=e,this._containerObserver=this._register(new Sye(n,t.dimension)),this._targetWindowId=Bt(n).vscodeWindowId,this._rawOptions=tle(t),this._validatedOptions=Hm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Kc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Qw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(sz.onDidChange(()=>this._recomputeOptions())),this._register(cI.getInstance(Bt(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Hm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=fb.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Qw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Hm.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:Jlt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:hb||lu,pixelRatio:cI.getInstance(tae(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return sz.readFontInfo(tae(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=tle(e);Hm.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Hm.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=Qlt(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())}};xz=Ylt([Zlt(3,pd)],xz);function Qlt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function Jlt(){let i="";return!Fp&&!g1e&&(i+="no-user-select "),Fp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Dn&&(i+="mac "),i}class ect{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class tct{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 Hm{static validateOptions(e){const t=new ect;for(const n of uy){const r=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){const n=new tct;for(const r of uy)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}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)?lr(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Hm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let r=!1;for(const o of uy){const s=!Hm._deepEquals(e._read(o.id),t._read(o.id));n[o.id]=s,s&&(r=!0)}return r?new VCe(n):null}static applyUpdate(e,t){let n=!1;for(const r of uy)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,n=n||o.didChange}return n}}function tle(i){const e=Fg(i);return Glt(e),e}var Jm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},n={...e},r={...e};let o=0;const s={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,m()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){v()}i.onKeyUp=h;function f(){v()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),m())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function m(){setTimeout(v)}function v(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",r),o++,y())}function _(D,k){const T=performance.getEntriesByName(D)[0].duration;k.total+=T,k.min=Math.min(k.min,T),k.max=Math.max(k.max,T)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function S(){if(o===0)return;const D={keydown:L(e),input:L(t),render:L(n),total:L(r),sampleCount:o};return E(e),E(t),E(n),E(r),o=0,D}i.getAndClearMeasurements=S;function L(D){return{average:D.total/o,max:D.max,min:D.min}}function E(D){D.total=0,D.min=Number.MAX_VALUE,D.max=0}})(Jm||(Jm={}));class qS{constructor(){this._hooks=new Fe,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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Ot(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Bt(e)}this._hooks.add(xe(s,Je.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(xe(s,Je.POINTER_UP,a=>this.stopMonitoring(!0)))}}function VY(i){return`--vscode-${i.replace(/\./g,"-")}`}function ft(i){return`var(${VY(i)})`}function nct(i,e){return`var(${VY(i)}, ${e})`}const xye={ColorContribution:"base.contributions.colors"};class ict{constructor(){this._onDidChangeSchema=new ae,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,o){const s={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),r&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const r=n.defaults[t.type];return Dd(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const r=t.indexOf(".")===-1?0:1,o=n.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const N3=new ict;ur.add(xye.ColorContribution,N3);function X(i,e,t,n,r){return N3.registerColor(i,e,t,n,r)}const et=X("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},w("foreground","Overall foreground color. This color is only used if not overridden by a component."));X("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},w("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));X("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},w("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));X("descriptionForeground",{light:"#717171",dark:Mt(et,.7),hcDark:Mt(et,.7),hcLight:Mt(et,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const xf=X("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),Qc=X("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},w("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=X("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Ki=X("contrastActiveBorder",{light:null,dark:null,hcDark:Qc,hcLight:Qc},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));X("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},w("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."));X("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Ce.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));const rct=X("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));X("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));X("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));X("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));X("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));X("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Ce.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));X("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Ce.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));const np=X("widget.shadow",{dark:Mt(Ce.black,.36),light:Mt(Ce.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Lye=X("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Eye=X("input.background",{dark:"#3C3C3C",light:Ce.white,hcDark:Ce.black,hcLight:Ce.white},w("inputBoxBackground","Input box background.")),Dye=X("input.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("inputBoxForeground","Input box foreground.")),Iye=X("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("inputBoxBorder","Input box border.")),zY=X("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},w("inputBoxActiveOptionBorder","Border color of activated options in input fields."));X("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields."));const q0=X("inputOption.activeBackground",{dark:Mt(Qc,.4),light:Mt(Qc,.2),hcDark:Ce.transparent,hcLight:Ce.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),UY=X("inputOption.activeForeground",{dark:Ce.white,light:Ce.black,hcDark:et,hcLight:et},w("inputOption.activeForeground","Foreground color of activated options in input fields."));X("input.placeholderForeground",{light:Mt(et,.5),dark:Mt(et,.5),hcDark:Mt(et,.7),hcLight:Mt(et,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const oct=X("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),sct=X("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),act=X("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},w("inputValidationInfoBorder","Input validation border color for information severity.")),lct=X("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),cct=X("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),uct=X("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},w("inputValidationWarningBorder","Input validation border color for warning severity.")),dct=X("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Ce.black,hcLight:Ce.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),hct=X("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:et},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),fct=X("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},w("inputValidationErrorBorder","Input validation border color for error severity.")),Lf=X("dropdown.background",{dark:"#3C3C3C",light:Ce.white,hcDark:Ce.black,hcLight:Ce.white},w("dropdownBackground","Dropdown background.")),gct=X("dropdown.listBackground",{dark:null,light:null,hcDark:Ce.black,hcLight:Ce.white},w("dropdownListBackground","Dropdown list background.")),ip=X("dropdown.foreground",{dark:"#F0F0F0",light:et,hcDark:Ce.white,hcLight:et},w("dropdownForeground","Dropdown foreground.")),my=X("dropdown.border",{dark:Lf,light:"#CECECE",hcDark:Ln,hcLight:Ln},w("dropdownBorder","Dropdown border.")),zL=X("button.foreground",{dark:Ce.white,light:Ce.white,hcDark:Ce.white,hcLight:Ce.white},w("buttonForeground","Button foreground color.")),pct=X("button.separator",{dark:Mt(zL,.4),light:Mt(zL,.4),hcDark:Mt(zL,.4),hcLight:Mt(zL,.4)},w("buttonSeparator","Button separator color.")),UL=X("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),mct=X("button.hoverBackground",{dark:oh(UL,.2),light:yC(UL,.2),hcDark:UL,hcLight:UL},w("buttonHoverBackground","Button background color when hovering.")),vct=X("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},w("buttonBorder","Button border color.")),_ct=X("button.secondaryForeground",{dark:Ce.white,light:Ce.white,hcDark:Ce.white,hcLight:et},w("buttonSecondaryForeground","Secondary button foreground color.")),Lz=X("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Ce.white},w("buttonSecondaryBackground","Secondary button background color.")),bct=X("button.secondaryHoverBackground",{dark:oh(Lz,.2),light:yC(Lz,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),jM=X("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Ce.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Cct=X("badge.foreground",{dark:Ce.white,light:"#333",hcDark:Ce.white,hcLight:Ce.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),jL=X("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),KL=X("scrollbarSlider.background",{dark:Ce.fromHex("#797979").transparent(.4),light:Ce.fromHex("#646464").transparent(.4),hcDark:Mt(Ln,.6),hcLight:Mt(Ln,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),GL=X("scrollbarSlider.hoverBackground",{dark:Ce.fromHex("#646464").transparent(.7),light:Ce.fromHex("#646464").transparent(.7),hcDark:Mt(Ln,.8),hcLight:Mt(Ln,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),qL=X("scrollbarSlider.activeBackground",{dark:Ce.fromHex("#BFBFBF").transparent(.4),light:Ce.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),yct=X("progressBar.background",{dark:Ce.fromHex("#0E70C0"),light:Ce.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},w("progressBarBackground","Background color of the progress bar that can show for long running operations."));X("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},w("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 Ef=X("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),wct=X("editorError.border",{dark:null,light:null,hcDark:Ce.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),KR=X("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zs=X("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),yI=X("editorWarning.border",{dark:null,light:null,hcDark:Ce.fromHex("#FFCC00").transparent(.8),hcLight:Ce.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));X("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},w("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 tl=X("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),wI=X("editorInfo.border",{dark:null,light:null,hcDark:Ce.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),Sct=X("editorHint.foreground",{dark:Ce.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));X("editorHint.border",{dark:null,light:null,hcDark:Ce.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));X("sash.hoverBorder",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},w("sashActiveBorder","Border color of active sashes."));const ko=X("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Ce.black,hcLight:Ce.white},w("editorBackground","Editor background color.")),Xu=X("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Ce.white,hcLight:et},w("editorForeground","Editor default foreground color."));X("editorStickyScroll.background",{light:ko,dark:ko,hcDark:ko,hcLight:ko},w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));X("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));X("editorStickyScroll.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));X("editorStickyScroll.shadow",{dark:jL,light:jL,hcDark:jL,hcLight:jL},w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Pr=X("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Ce.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),rp=X("editorWidget.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),op=X("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},w("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."));X("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},w("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."));const nle=X("quickInput.background",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),xct=X("quickInput.foreground",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Lct=X("quickInputTitle.background",{dark:new Ce(new Rn(255,255,255,.105)),light:new Ce(new Rn(0,0,0,.06)),hcDark:"#000000",hcLight:Ce.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),kye=X("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Ce.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),Ect=X("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Ce.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),Dct=X("keybindingLabel.background",{dark:new Ce(new Rn(128,128,128,.17)),light:new Ce(new Rn(221,221,221,.4)),hcDark:Ce.transparent,hcLight:Ce.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Ict=X("keybindingLabel.foreground",{dark:Ce.fromHex("#CCCCCC"),light:Ce.fromHex("#555555"),hcDark:Ce.white,hcLight:et},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),kct=X("keybindingLabel.border",{dark:new Ce(new Rn(51,51,51,.6)),light:new Ce(new Rn(204,204,204,.4)),hcDark:new Ce(new Rn(111,195,223)),hcLight:Ln},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Tct=X("keybindingLabel.bottomBorder",{dark:new Ce(new Rn(68,68,68,.6)),light:new Ce(new Rn(187,187,187,.4)),hcDark:new Ce(new Rn(111,195,223)),hcLight:et},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ev=X("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),Nct=X("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Ce.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),Tye=X("editor.inactiveSelectionBackground",{light:Mt(ev,.5),dark:Mt(ev,.5),hcDark:Mt(ev,.7),hcLight:Mt(ev,.5)},w("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),jY=X("editor.selectionHighlightBackground",{light:ule(ev,ko,.3,.6),dark:ule(ev,ko,.3,.6),hcDark:null,hcLight:null},w("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);X("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));X("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const sp=X("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},w("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},w("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findMatchBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("editorFindMatchBorder","Border color of the current search match."));const tv=X("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("findMatchHighlightBorder","Border color of the other search matches.")),Rct=X("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Mt(Ki,.4),hcLight:Mt(Ki,.4)},w("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("searchEditor.findMatchBackground",{light:Mt(sp,.66),dark:Mt(sp,.66),hcDark:sp,hcLight:sp},w("searchEditor.queryMatch","Color of the Search Editor query matches."));X("searchEditor.findMatchBorder",{light:Mt(tv,.66),dark:Mt(tv,.66),hcDark:tv,hcLight:tv},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));X("search.resultsInfoForeground",{light:et,dark:Mt(et,.65),hcDark:et,hcLight:et},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));X("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},w("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 eO=X("editorHoverWidget.background",{light:Pr,dark:Pr,hcDark:Pr,hcLight:Pr},w("hoverBackground","Background color of the editor hover."));X("editorHoverWidget.foreground",{light:rp,dark:rp,hcDark:rp,hcLight:rp},w("hoverForeground","Foreground color of the editor hover."));const Nye=X("editorHoverWidget.border",{light:op,dark:op,hcDark:op,hcLight:op},w("hoverBorder","Border color of the editor hover."));X("editorHoverWidget.statusBarBackground",{dark:oh(eO,.2),light:yC(eO,.05),hcDark:Pr,hcLight:Pr},w("statusBarBackground","Background color of the editor hover status bar."));const Mct=X("editorLink.activeForeground",{dark:"#4E94CE",light:Ce.blue,hcDark:Ce.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),ap=X("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Ce.white,hcLight:Ce.black},w("editorInlayHintForeground","Foreground color of inline hints")),lp=X("editorInlayHint.background",{dark:Mt(jM,.1),light:Mt(jM,.1),hcDark:Mt(Ce.white,.1),hcLight:Mt(jM,.1)},w("editorInlayHintBackground","Background color of inline hints")),Pct=X("editorInlayHint.typeForeground",{dark:ap,light:ap,hcDark:ap,hcLight:ap},w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Act=X("editorInlayHint.typeBackground",{dark:lp,light:lp,hcDark:lp,hcLight:lp},w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Oct=X("editorInlayHint.parameterForeground",{dark:ap,light:ap,hcDark:ap,hcLight:ap},w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Fct=X("editorInlayHint.parameterBackground",{dark:lp,light:lp,hcDark:lp,hcLight:lp},w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),GR=X("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));X("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));X("editorLightBulbAi.foreground",{dark:GR,light:GR,hcDark:GR,hcLight:GR},w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));const Ez=new Ce(new Rn(155,185,85,.2)),Dz=new Ce(new Rn(255,0,0,.2)),Bct=X("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},w("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Wct=X("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},w("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.insertedLineBackground",{dark:Ez,light:Ez,hcDark:null,hcLight:null},w("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.removedLineBackground",{dark:Dz,light:Dz,hcDark:null,hcLight:null},w("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));X("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const $ct=X("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Hct=X("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));X("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));X("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));X("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("diffEditorBorder","Border color between the two text editors."));X("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},w("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));X("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));X("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));X("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Vct=X("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),zct=X("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Uct=X("list.focusOutline",{dark:Qc,light:Qc,hcDark:Ki,hcLight:Ki},w("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.")),jct=X("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),cp=X("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("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.")),Df=X("list.activeSelectionForeground",{dark:Ce.white,light:Ce.white,hcDark:null,hcLight:null},w("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.")),XL=X("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Kct=X("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("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.")),Gct=X("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),qct=X("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Xct=X("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Yct=X("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("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.")),Rye=X("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Ce.white.transparent(.1),hcLight:Ce.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Mye=X("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Zct=X("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},w("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),Qct=X("list.dropBetweenBackground",{dark:xf,light:xf,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),Yu=X("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Qc,hcLight:Qc},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),qR=X("list.focusHighlightForeground",{dark:Yu,light:Iut(cp,Yu,"#BBE7FF"),hcDark:Yu,hcLight:Yu},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));X("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},w("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));X("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));X("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const Jct=X("listFilterWidget.background",{light:yC(Pr,0),dark:oh(Pr,0),hcDark:Pr,hcLight:Pr},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),eut=X("listFilterWidget.outline",{dark:Ce.transparent,light:Ce.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),tut=X("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),nut=X("listFilterWidget.shadow",{dark:np,light:np,hcDark:np,hcLight:np},w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));X("list.filterMatchBackground",{dark:sp,light:sp,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));X("list.filterMatchBorder",{dark:tv,light:tv,hcDark:Ln,hcLight:Ki},w("listFilterMatchHighlightBorder","Border color of the filtered match."));const YL=X("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),iut=X("tree.inactiveIndentGuidesStroke",{dark:Mt(YL,.4),light:Mt(YL,.4),hcDark:Mt(YL,.4),hcLight:Mt(YL,.4)},w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),rut=X("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),out=X("tree.tableOddRowsBackground",{dark:Mt(et,.04),light:Mt(et,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));X("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const sut=X("checkbox.background",{dark:Lf,light:Lf,hcDark:Lf,hcLight:Lf},w("checkbox.background","Background color of checkbox widget."));X("checkbox.selectBackground",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const aut=X("checkbox.foreground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("checkbox.foreground","Foreground color of checkbox widget.")),lut=X("checkbox.border",{dark:my,light:my,hcDark:my,hcLight:my},w("checkbox.border","Border color of checkbox widget."));X("checkbox.selectBorder",{dark:xf,light:xf,hcDark:xf,hcLight:xf},w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const ile=X("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),X0=X("quickInputList.focusForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),vy=X("quickInputList.focusIconForeground",{dark:XL,light:XL,hcDark:XL,hcLight:XL},w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),Y0=X("quickInputList.focusBackground",{dark:SI(ile,cp),light:SI(ile,cp),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item.")),cut=X("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},w("menuBorder","Border color of menus.")),uut=X("menu.foreground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("menuForeground","Foreground color of menu items.")),dut=X("menu.background",{dark:Lf,light:Lf,hcDark:Lf,hcLight:Lf},w("menuBackground","Background color of menu items.")),hut=X("menu.selectionForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),fut=X("menu.selectionBackground",{dark:cp,light:cp,hcDark:cp,hcLight:cp},w("menuSelectionBackground","Background color of the selected menu item in menus.")),gut=X("menu.selectionBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("menuSelectionBorder","Border color of the selected menu item in menus.")),put=X("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},w("menuSeparatorBackground","Color of a separator menu item in menus.")),rle=X("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));X("toolbar.hoverOutline",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));X("toolbar.activeBackground",{dark:oh(rle,.1),light:yC(rle,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));X("editor.snippetTabstopHighlightBackground",{dark:new Ce(new Rn(124,124,124,.3)),light:new Ce(new Rn(10,50,100,.2)),hcDark:new Ce(new Rn(124,124,124,.3)),hcLight:new Ce(new Rn(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));X("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));X("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));X("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Ce(new Rn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const mut=X("breadcrumb.foreground",{light:Mt(et,.8),dark:Mt(et,.8),hcDark:Mt(et,.8),hcLight:Mt(et,.8)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),vut=X("breadcrumb.background",{light:ko,dark:ko,hcDark:ko,hcLight:ko},w("breadcrumbsBackground","Background color of breadcrumb items.")),ole=X("breadcrumb.focusForeground",{light:yC(et,.2),dark:oh(et,.1),hcDark:oh(et,.1),hcLight:oh(et,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),_ut=X("breadcrumb.activeSelectionForeground",{light:yC(et,.2),dark:oh(et,.1),hcDark:oh(et,.1),hcLight:oh(et,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));X("breadcrumbPicker.background",{light:Pr,dark:Pr,hcDark:Pr,hcLight:Pr},w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const Pye=.5,sle=Ce.fromHex("#40C8AE").transparent(Pye),ale=Ce.fromHex("#40A6FF").transparent(Pye),lle=Ce.fromHex("#606060").transparent(.4),Zu=.4,Jw=1,_y=X("merge.currentHeaderBackground",{dark:sle,light:sle,hcDark:null,hcLight:null},w("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.currentContentBackground",{dark:Mt(_y,Zu),light:Mt(_y,Zu),hcDark:Mt(_y,Zu),hcLight:Mt(_y,Zu)},w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const by=X("merge.incomingHeaderBackground",{dark:ale,light:ale,hcDark:null,hcLight:null},w("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.incomingContentBackground",{dark:Mt(by,Zu),light:Mt(by,Zu),hcDark:Mt(by,Zu),hcLight:Mt(by,Zu)},w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Cy=X("merge.commonHeaderBackground",{dark:lle,light:lle,hcDark:null,hcLight:null},w("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.commonContentBackground",{dark:Mt(Cy,Zu),light:Mt(Cy,Zu),hcDark:Mt(Cy,Zu),hcLight:Mt(Cy,Zu)},w("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const eS=X("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));X("editorOverviewRuler.currentContentForeground",{dark:Mt(_y,Jw),light:Mt(_y,Jw),hcDark:eS,hcLight:eS},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.incomingContentForeground",{dark:Mt(by,Jw),light:Mt(by,Jw),hcDark:eS,hcLight:eS},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.commonContentForeground",{dark:Mt(Cy,Jw),light:Mt(Cy,Jw),hcDark:eS,hcLight:eS},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const KY=X("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),ZL=X("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),yy=X("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),R3=X("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),cle=X("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),but=X("minimap.infoHighlight",{dark:tl,light:tl,hcDark:wI,hcLight:wI},w("minimapInfo","Minimap marker color for infos.")),Cut=X("minimap.warningHighlight",{dark:Zs,light:Zs,hcDark:yI,hcLight:yI},w("overviewRuleWarning","Minimap marker color for warnings.")),yut=X("minimap.errorHighlight",{dark:new Ce(new Rn(255,18,18,.7)),light:new Ce(new Rn(255,18,18,.7)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),wut=X("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},w("minimapBackground","Minimap background color.")),Sut=X("minimap.foregroundOpacity",{dark:Ce.fromHex("#000f"),light:Ce.fromHex("#000f"),hcDark:Ce.fromHex("#000f"),hcLight:Ce.fromHex("#000f")},w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));X("minimapSlider.background",{light:Mt(KL,.5),dark:Mt(KL,.5),hcDark:Mt(KL,.5),hcLight:Mt(KL,.5)},w("minimapSliderBackground","Minimap slider background color."));X("minimapSlider.hoverBackground",{light:Mt(GL,.5),dark:Mt(GL,.5),hcDark:Mt(GL,.5),hcLight:Mt(GL,.5)},w("minimapSliderHoverBackground","Minimap slider background color when hovering."));X("minimapSlider.activeBackground",{light:Mt(qL,.5),dark:Mt(qL,.5),hcDark:Mt(qL,.5),hcLight:Mt(qL,.5)},w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const xut=X("problemsErrorIcon.foreground",{dark:Ef,light:Ef,hcDark:Ef,hcLight:Ef},w("problemsErrorIconForeground","The color used for the problems error icon.")),Lut=X("problemsWarningIcon.foreground",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("problemsWarningIconForeground","The color used for the problems warning icon.")),Eut=X("problemsInfoIcon.foreground",{dark:tl,light:tl,hcDark:tl,hcLight:tl},w("problemsInfoIconForeground","The color used for the problems info icon."));X("charts.foreground",{dark:et,light:et,hcDark:et,hcLight:et},w("chartsForeground","The foreground color used in charts."));X("charts.lines",{dark:Mt(et,.5),light:Mt(et,.5),hcDark:Mt(et,.5),hcLight:Mt(et,.5)},w("chartsLines","The color used for horizontal lines in charts."));X("charts.red",{dark:Ef,light:Ef,hcDark:Ef,hcLight:Ef},w("chartsRed","The red color used in chart visualizations."));X("charts.blue",{dark:tl,light:tl,hcDark:tl,hcLight:tl},w("chartsBlue","The blue color used in chart visualizations."));X("charts.yellow",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("chartsYellow","The yellow color used in chart visualizations."));X("charts.orange",{dark:yy,light:yy,hcDark:yy,hcLight:yy},w("chartsOrange","The orange color used in chart visualizations."));X("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));X("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));function Dut(i,e){var t,n,r,o;switch(i.op){case 0:return(t=Dd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=Dd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(r=Dd(i.value,e))===null||r===void 0?void 0:r.transparent(i.factor);case 3:{const s=Dd(i.background,e);return s?(o=Dd(i.value,e))===null||o===void 0?void 0:o.makeOpaque(s):Dd(i.value,e)}case 4:for(const s of i.values){const a=Dd(s,e);if(a)return a}return;case 6:return Dd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=Dd(i.value,e);if(!s)return;const a=Dd(i.background,e);return a?s.isDarkerThan(a)?Ce.getLighterColor(s,a,i.factor).transparent(i.transparency):Ce.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw y3()}}function yC(i,e){return{op:0,value:i,factor:e}}function oh(i,e){return{op:1,value:i,factor:e}}function Mt(i,e){return{op:2,value:i,factor:e}}function SI(...i){return{op:4,values:i}}function Iut(i,e,t){return{op:6,if:i,then:e,else:t}}function ule(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function Dd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?Ce.fromHex(i):e.getColor(i);if(i instanceof Ce)return i;if(typeof i=="object")return Dut(i,e)}}const Aye="vscode://schemas/workbench-colors",Oye=ur.as(I3.JSONContribution);Oye.registerSchema(Aye,N3.getColorSchema());const dle=new mi(()=>Oye.notifySchemaChanged(Aye),200);N3.onDidChangeSchema(()=>{dle.isScheduled()||dle.schedule()});class M3{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new Fye(this.x-e.scrollX,this.y-e.scrollY)}}class Fye{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new M3(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class kut{constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this._editorPagePositionBrand=void 0}}class Tut{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function GY(i){const e=Hr(i);return new kut(e.left,e.top,e.width,e.height)}function qY(i,e,t){const n=e.width/i.offsetWidth,r=e.height/i.offsetHeight,o=(t.x-e.x)/n,s=(t.y-e.y)/r;return new Tut(o,s)}class n_ extends Gu{constructor(e,t,n){super(Bt(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new M3(this.posx,this.posy),this.editorPos=GY(n),this.relativePos=qY(n,this.editorPos,this.pos)}}class Nut{constructor(e){this._editorViewDomNode=e}_create(e){return new n_(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return xe(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return xe(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return xe(e,Je.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return xe(e,Je.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return xe(e,Je.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return xe(e,"mousemove",n=>t(this._create(n)))}}class Rut{constructor(e){this._editorViewDomNode=e}_create(e){return new n_(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return xe(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return xe(e,Je.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return xe(e,Je.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return xe(e,"pointermove",n=>t(this._create(n)))}}class Mut extends me{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new qS),this._keydownListener=null}startMonitoring(e,t,n,r,o){this._keydownListener=Lr(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{r(new n_(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class yT{constructor(e){this._editor=e,this._instanceId=++yT._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new mi(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let n=this._rules.get(t);if(!n){const r=this._counter++;n=new Put(t,`dyn-rule-${this._instanceId}-${r}`,VA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}yT._idPool=0;class Put{constructor(e,t,n,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new Fe,this._styleElement=_c(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=ft(o.id):s=o;const a=Aut(r);n+=` ${a}: ${s};`}return n+=` -}`,n}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Aut(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class wT extends me{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let n=0,r=e.length;n=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[n++]=r,r=a)}return t[n++]=r,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&n===o&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,n,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Jc;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Jc||(Jc={}));function sh(i){return i===Jc.HIGH_CONTRAST_DARK||i===Jc.HIGH_CONTRAST_LIGHT}function tS(i){return i===Jc.DARK||i===Jc.HIGH_CONTRAST_DARK}const $ut=function(){return nh?!0:!(ka||lu||Fp)}();let nw=!0;class fle{constructor(e,t){this.themeType=t;const n=e.options,r=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(99):this.renderWhitespace="none",this.renderControlCharacters=n.get(94),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(67),this.stopRenderingLineAfter=n.get(117),this.fontLigatures=n.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class pf{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=Jn(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 sh(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),s=this._options,a=wa.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(sh(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const u=bT(c,r);r.appendString("");let d=null;return nw&&$ut&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new XR(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=Wye(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof XR:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof XR?this._renderedViewLine.monospaceAssumptionsAreValid():nw}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof XR&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&n>o+1)return new hle(!0,[new fb(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&n>o+1&&(n=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return s&&s.length>0?new hle(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}pf.CLASS_NAME="view-line";class XR{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),nw=!1)}return nw}toSlowRenderedLine(){return Wye(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,n,r);return[new fb(o,s-o)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,n),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=KM.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return XY(this._characterMapping,e,t)}}class Bye{constructor(e,t,n,r,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,r);return s===-1?null:[new fb(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,o){if(n===r){const s=this._readPixelOffset(e,t,n,o);return s===-1?null:[new fb(s,0)]}else return this._readRawVisibleRangesForRange(e,n,r,o)}_readPixelOffset(e,t,n,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[n];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){const l=KM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(n),s=KM.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,r){if(t===1&&n===this._characterMapping.length)return[new fb(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return KM.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return XY(this._characterMapping,e,t)}}class Hut extends Bye{_readVisibleRangesForRange(e,t,n,r,o){const s=super._readVisibleRangesForRange(e,t,n,r,o);if(!s||s.length===0||n===r||n===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=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 nS{constructor(e,t,n){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(144),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(116),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return nS.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const r=n.verticalOffset+n.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==o&&(l=new le(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new le(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,os._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class YY extends jut{constructor(e,t,n,r,o){super(e,t,n,r),this._ctx=e,o?(this.target=o,this.targetPath=vh.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,n.position,n)}return null}static _hitTestTextArea(e,t){return aa.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return s.glyphMarginLane=l[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,r,n.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,s))}return null}static _hitTestViewLines(e,t,n){if(!aa.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new le(1,1),gle);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new le(o,s),gle)}if(n){if(aa.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=H9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new le(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=H9(t.mouseContentHorizontalOffset-s),l=new le(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=os._doHitTest(e,t);return r.type===1?os.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(aa.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new le(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(aa.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new le(r,o))}}return null}static _hitTestScrollbar(e,t){if(aa.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new le(n,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(144),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return os._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const v=H9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,v)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(s,a-1);v&&d.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(av.offset-_.offset);const f=t.pos.toClientCoordinates(Bt(e.viewDomNode)),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let m=null;for(let v=1;vo)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new M3(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Bt(e.viewDomNode)));if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Bt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=$b(e.viewDomNode);let r;if(n?typeof n.caretRangeFromPoint>"u"?r=Kut(n,t.clientX,t.clientY):r=n.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new xm;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===pf.CLASS_NAME?T0.createFromDOMInfo(e,s,r.startOffset):new xm(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===pf.CLASS_NAME?T0.createFromDOMInfo(e,o,o.textContent.length):new xm(o)}return new xm}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const r=n.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===pf.CLASS_NAME?T0.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new xm(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const r=n.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===pf.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return T0.createFromDOMInfo(e,l,0)}else if(a===pf.CLASS_NAME)return T0.createFromDOMInfo(e,n.offsetNode,0)}return new xm(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=xI.atomicPosition(n,e.column-1,r,2);return o!==-1?new le(e.lineNumber,o+1):e}static _doHitTest(e,t){let n=new xm;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Bt(e.viewDomNode)))),n.type===1){const r=e.viewModel.getInjectedTextAt(n.position),o=e.viewModel.normalizePosition(n.position,2);(r||!o.equals(n.position))&&(n=new $ye(o,n.spanNode,r))}return n}}function Kut(i,e,t){const n=document.createRange();let r=i.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=Bt(r),a=s.getComputedStyle(r,null).getPropertyValue("font-style"),l=s.getComputedStyle(r,null).getPropertyValue("font-variant"),c=s.getComputedStyle(r,null).getPropertyValue("font-weight"),u=s.getComputedStyle(r,null).getPropertyValue("font-size"),d=s.getComputedStyle(r,null).getPropertyValue("line-height"),h=s.getComputedStyle(r,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${u}/${d} ${h}`,g=r.innerText;let p=o.left,m=0,v;if(e>o.left+o.width)m=g.length;else{const _=Y0.getInstance();for(let y=0;y=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ei;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Ei||(Ei={}));class Li extends me{constructor(){super(),this.dispatched=!1,this.targets=new Ca,this.ignoreTargets=new Ca,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ot.runAndSubscribe(u3,({window:e,disposables:t})=>{t.add(xe(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),t.add(xe(e.document,"touchend",n=>this.onTouchEnd(e,n))),t.add(xe(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:hi,disposables:this._store}))}static addTarget(e){if(!Li.isTouchDevice())return me.None;Li.INSTANCE||(Li.INSTANCE=new Li);const t=Li.INSTANCE.targets.push(e);return Ot(t)}static ignoreTarget(e){if(!Li.isTouchDevice())return me.None;Li.INSTANCE||(Li.INSTANCE=new Li);const t=Li.INSTANCE.ignoreTargets.push(e);return Ot(t)}static isTouchDevice(){return"ontouchstart"in hi||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 n=0,r=e.targetTouches.length;n=Li.HOLD_DELAY&&Math.abs(l.initialPageX-Wc(l.rollingPageX))<30&&Math.abs(l.initialPageY-Wc(l.rollingPageY))<30){const u=this.newGestureEvent(Ei.Contextmenu,l.initialTarget);u.pageX=Wc(l.rollingPageX),u.pageY=Wc(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Wc(l.rollingPageX),d=Wc(l.rollingPageY),h=Wc(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],g=d-l.rollingPageY[0],p=[...this.targets].filter(m=>l.initialTarget instanceof Node&&m.contains(l.initialTarget));this.inertia(e,p,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(g)/h,g>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Ei.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Ei.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Li.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Ei.Change||e.type===Ei.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,r,o,s,a,l,c){this.handle=Ml(e,()=>{const u=Date.now(),d=u-n;let h=0,f=0,g=!0;r+=Li.SCROLL_FRICTION*d,a+=Li.SCROLL_FRICTION*d,r>0&&(g=!1,h=o*r*d),a>0&&(g=!1,f=l*a*d);const p=this.newGestureEvent(Ei.Change);p.translationX=h,p.translationY=f,t.forEach(m=>m.dispatchEvent(p)),g||this.inertia(e,t,u,r,o,s+h,a,l,c+f)})}onTouchMove(e){const t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Li.SCROLL_FRICTION=-.005;Li.HOLD_DELAY=700;Li.CLEAR_TAP_COUNT_TIME=400;Gut([Ar],Li,"isTouchDevice",null);let Lc=class extends me{onclick(e,t){this._register(xe(e,Je.CLICK,n=>t(new Gu(Bt(e),n))))}onmousedown(e,t){this._register(xe(e,Je.MOUSE_DOWN,n=>t(new Gu(Bt(e),n))))}onmouseover(e,t){this._register(xe(e,Je.MOUSE_OVER,n=>t(new Gu(Bt(e),n))))}onmouseleave(e,t){this._register(xe(e,Je.MOUSE_LEAVE,n=>t(new Gu(Bt(e),n))))}onkeydown(e,t){this._register(xe(e,Je.KEY_DOWN,n=>t(new Oi(n))))}onkeyup(e,t){this._register(xe(e,Je.KEY_UP,n=>t(new Oi(n))))}oninput(e,t){this._register(xe(e,Je.INPUT,t))}onblur(e,t){this._register(xe(e,Je.BLUR,t))}onfocus(e,t){this._register(xe(e,Je.FOCUS,t))}ignoreGesture(e){return Li.ignoreTarget(e)}};const iS=11;class qut extends Lc{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(...Vt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=iS+"px",this.domNode.style.height=iS+"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 qS),this._register(Lr(this.bgDomNode,Je.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Lr(this.domNode,Je.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new CY),this._pointerdownScheduleRepeatTimer=this._register(new gd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Bt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Xut extends me{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new gd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Yut=140;class Hye extends Lc{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 Xut(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new qS),this._shouldRender=!0,this.domNode=Jn(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(xe(this.domNode.domNode,Je.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new qut(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Jn(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(xe(this.slider.domNode,Je.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const o=Hr(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,n);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),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-n);if(Os&&a>Yut){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Zut=20;class rS{constructor(e,t,n,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new rS(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,n,r,o){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=r>0&&r>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Zut,Math.floor(n*a/r))),u=(a-c)/(r-n),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=rS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let n=this._scrollPosition;return tthis._host.onMouseWheel(new Wb(null,1,0))}),this._createArrow({className:"scra",icon:tt.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Wb(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 Jut extends Hye{constructor(e,t,n){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new rS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-iS)/2,a=(t.verticalScrollbarSize-iS)/2;this._createArrow({className:"scra",icon:tt.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Wb(null,0,1))}),this._createArrow({className:"scra",icon:tt.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Wb(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 tO{constructor(e,t,n,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new tO(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 tO(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 n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class XS extends me{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ae),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new tO(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 n;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)===null||n===void 0||n.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 n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new LI(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=LI.start(this._state,n,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 n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class ple{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function V9(i,e){const t=e-i;return function(n){return i+t*ndt(n)}}function edt(i,e,t){return function(n){return n2.5*n){let o,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}nO.INSTANCE=new nO;class ZY extends Lc{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new ae),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ae),e.style.overflow="hidden",this._options=odt(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Jut(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Qut(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=Jn(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Jn(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Jn(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new gd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Dn&&(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 Wb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=r=>{this._onMouseWheel(new Wb(r))};this._mouseWheelToDispose.push(xe(this._listenOnDomNode,Je.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=nO.INSTANCE;n.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Dn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=mle*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=mle*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",o=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),idt)}}class Vye extends ZY{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Ml(Bt(e),r)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class A3 extends ZY{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class ST extends ZY{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Ml(Bt(e),r)});super(e,t,n),this._register(n),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 odt(i){const e={lazyRender:typeof i.lazyRender<"u"?i.lazyRender:!1,className:typeof i.className<"u"?i.className:"",useShadows:typeof i.useShadows<"u"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel<"u"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes<"u"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded<"u"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel<"u"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX<"u"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity<"u"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity<"u"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis<"u"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll<"u"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize<"u"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode<"u"?i.listenOnDomNode:null,horizontal:typeof i.horizontal<"u"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize<"u"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows<"u"?i.horizontalHasArrows:!1,vertical:typeof i.vertical<"u"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize<"u"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows<"u"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize<"u"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage<"u"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize<"u"?i.verticalSliderSize:e.verticalScrollbarSize,Dn&&(e.className+=" mac"),e}class QY extends wT{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new os(this._context,n),this._mouseDownOperation=this._register(new sdt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(144).height;const r=new Nut(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=xe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new t_(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(xe(this.viewHelper.viewDomNode,Je.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=nO.INSTANCE;let t=0,n=Kc.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new Wb(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Kc.getZoomLevel(),d=c.deltaY>0?1:-1;Kc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=Kc.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(Kc.setZoomLevel(n+o/5),c.preventDefault(),c.stopPropagation())};this._register(xe(this.viewHelper.viewDomNode,Je.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Dn?(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(144)){const t=this._context.configuration.options.get(144).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 Fye(e,t).toPageCoordinates(Bt(this.viewHelper.viewDomNode)),o=GY(this.viewHelper.viewDomNode);if(r.yo.y+o.height||r.xo.x+o.width)return null;const s=qY(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const r=$b(this.viewHelper.viewDomNode);r&&(n=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(o)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class sdt extends me{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Mut(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new adt(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new O3,this._currentSelection=new Et(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,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);SY(s)?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,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=nS.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return qs.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return qs.createOutsideEditor(o,new le(u,n.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return qs.createOutsideEditor(o,new le(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return qs.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new le(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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 adt extends me{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new ldt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class ldt extends me{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Ml(Bt(s.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(144).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),n=this._tick(),r=t*(n/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=GY(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(144).horizontalScrollbarHeight,d=new M3(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=qY(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=qs.createOutsideEditor(this._position.mouseColumn,new le(a,1),"above",this._position.outsideDistance):l=qs.createOutsideEditor(this._position.mouseColumn,new le(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Ml(Bt(l.element),()=>this._execute())}}class O3{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>O3.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}O3.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const r=o=>this.emitter.fire(o);this.emitter=new ae({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}}class Yo{constructor(e,t,n,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=n.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Yo(n,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Yo(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(qv(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(FA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const n=Math.min(qv(e.value,t.value),e.selectionEnd),r=Math.min(FA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(n,e.value.length-r),s=t.value.substring(n,t.value.length-r);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}Yo.EMPTY=new Yo("",0,0,null,void 0);class wy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,r=n+1,o=n+t;return new W(r,1,o+1,1)}static fromEditorSelection(e,t,n,r){const s=wy._getPageOfLine(t.startLineNumber,n),a=wy._getRangeForPage(s,n),l=wy._getPageOfLine(t.endLineNumber,n),c=wy._getRangeForPage(l,n);let u=a.intersectRanges(new W(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const v=e.modifyPosition(u.getEndPosition(),-500);u=W.fromPositions(v,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new W(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=W.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let m;if(s===l||s+1===l)m=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),_=c.intersectRanges(t);m=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return r&&m.length>2*500&&(m=m.substring(0,500)+String.fromCharCode(8230)+m.substring(m.length-500,m.length)),new Yo(d+m+p,d.length,d.length+m.length,t,u.endLineNumber-u.startLineNumber)}}var cdt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},iO;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(iO||(iO={}));const Iz={forceCopyWithSyntaxHighlighting:!1};class EI{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)}}EI.INSTANCE=new EI;class udt{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 kz=class extends me{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,o,s){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new ae),this.onFocus=this._onFocus.event,this._onBlur=this._register(new ae),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new ae),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new ae),this.onCut=this._onCut.event,this._onPaste=this._register(new ae),this.onPaste=this._onPaste.event,this._onType=this._register(new ae),this.onType=this._onType.event,this._onCompositionStart=this._register(new ae),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new ae),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new ae),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new ae),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Vo),this._asyncTriggerCut=this._register(new mi(()=>this._onCut.fire(),0)),this._textAreaState=Yo.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(ot.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new mi(()=>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 Oi(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 Oi(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new udt;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=Yo.readFromTextArea(this._textArea,this._textAreaState),h=Yo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Yo.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=Yo.readFromTextArea(this._textArea,this._textAreaState),h=Yo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionEnd.fire();return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Yo.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=Yo.readFromTextArea(this._textArea,this._textAreaState),u=Yo.deduceInput(this._textAreaState,c,this._OS===2);u.replacePrevCharCnt===0&&u.text.length===1&&(Do(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]=Tz.getTextData(l.clipboardData);c&&(u=u||EI.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 mi(()=>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 xe(this._textArea.ownerDocument,"selectionchange",t=>{if(Jm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),r=n-e;if(e=n,r<5)return;const o=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new Et(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.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(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};EI.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +}`,n}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Aut(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class wT extends me{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let n=0,r=e.length;n=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[n++]=r,r=a)}return t[n++]=r,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&n===o&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,n,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Jc;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Jc||(Jc={}));function sh(i){return i===Jc.HIGH_CONTRAST_DARK||i===Jc.HIGH_CONTRAST_LIGHT}function tS(i){return i===Jc.DARK||i===Jc.HIGH_CONTRAST_DARK}const $ut=function(){return nh?!0:!(ka||lu||Fp)}();let nw=!0;class fle{constructor(e,t){this.themeType=t;const n=e.options,r=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(99):this.renderWhitespace="none",this.renderControlCharacters=n.get(94),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(67),this.stopRenderingLineAfter=n.get(117),this.fontLigatures=n.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class pf{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=Jn(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 sh(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),s=this._options,a=wa.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(sh(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const u=bT(c,r);r.appendString("");let d=null;return nw&&$ut&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new XR(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=Wye(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof XR:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof XR?this._renderedViewLine.monospaceAssumptionsAreValid():nw}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof XR&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&n>o+1)return new hle(!0,[new gb(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&n>o+1&&(n=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return s&&s.length>0?new hle(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}pf.CLASS_NAME="view-line";class XR{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),nw=!1)}return nw}toSlowRenderedLine(){return Wye(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,n,r);return[new gb(o,s-o)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,n),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=KM.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return XY(this._characterMapping,e,t)}}class Bye{constructor(e,t,n,r,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,r);return s===-1?null:[new gb(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,o){if(n===r){const s=this._readPixelOffset(e,t,n,o);return s===-1?null:[new gb(s,0)]}else return this._readRawVisibleRangesForRange(e,n,r,o)}_readPixelOffset(e,t,n,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[n];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){const l=KM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(n),s=KM.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,r){if(t===1&&n===this._characterMapping.length)return[new gb(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return KM.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return XY(this._characterMapping,e,t)}}class Hut extends Bye{_readVisibleRangesForRange(e,t,n,r,o){const s=super._readVisibleRangesForRange(e,t,n,r,o);if(!s||s.length===0||n===r||n===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=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 nS{constructor(e,t,n){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(144),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(116),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return nS.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const r=n.verticalOffset+n.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==o&&(l=new le(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new le(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,os._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class YY extends jut{constructor(e,t,n,r,o){super(e,t,n,r),this._ctx=e,o?(this.target=o,this.targetPath=vh.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,n.position,n)}return null}static _hitTestTextArea(e,t){return aa.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return s.glyphMarginLane=l[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,r,n.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,s))}return null}static _hitTestViewLines(e,t,n){if(!aa.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new le(1,1),gle);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new le(o,s),gle)}if(n){if(aa.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=H9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new le(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=H9(t.mouseContentHorizontalOffset-s),l=new le(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=os._doHitTest(e,t);return r.type===1?os.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(aa.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new le(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(aa.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new le(r,o))}}return null}static _hitTestScrollbar(e,t){if(aa.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new le(n,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(144),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return os._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const v=H9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,v)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(s,a-1);v&&d.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(av.offset-_.offset);const f=t.pos.toClientCoordinates(Bt(e.viewDomNode)),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let m=null;for(let v=1;vo)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new M3(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Bt(e.viewDomNode)));if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Bt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=Hb(e.viewDomNode);let r;if(n?typeof n.caretRangeFromPoint>"u"?r=Kut(n,t.clientX,t.clientY):r=n.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new xm;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===pf.CLASS_NAME?N0.createFromDOMInfo(e,s,r.startOffset):new xm(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===pf.CLASS_NAME?N0.createFromDOMInfo(e,o,o.textContent.length):new xm(o)}return new xm}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const r=n.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===pf.CLASS_NAME?N0.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new xm(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const r=n.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===pf.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return N0.createFromDOMInfo(e,l,0)}else if(a===pf.CLASS_NAME)return N0.createFromDOMInfo(e,n.offsetNode,0)}return new xm(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=xI.atomicPosition(n,e.column-1,r,2);return o!==-1?new le(e.lineNumber,o+1):e}static _doHitTest(e,t){let n=new xm;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Bt(e.viewDomNode)))),n.type===1){const r=e.viewModel.getInjectedTextAt(n.position),o=e.viewModel.normalizePosition(n.position,2);(r||!o.equals(n.position))&&(n=new $ye(o,n.spanNode,r))}return n}}function Kut(i,e,t){const n=document.createRange();let r=i.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=Bt(r),a=s.getComputedStyle(r,null).getPropertyValue("font-style"),l=s.getComputedStyle(r,null).getPropertyValue("font-variant"),c=s.getComputedStyle(r,null).getPropertyValue("font-weight"),u=s.getComputedStyle(r,null).getPropertyValue("font-size"),d=s.getComputedStyle(r,null).getPropertyValue("line-height"),h=s.getComputedStyle(r,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${u}/${d} ${h}`,g=r.innerText;let p=o.left,m=0,v;if(e>o.left+o.width)m=g.length;else{const _=Z0.getInstance();for(let y=0;y=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ei;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Ei||(Ei={}));class Li extends me{constructor(){super(),this.dispatched=!1,this.targets=new Ca,this.ignoreTargets=new Ca,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ot.runAndSubscribe(u3,({window:e,disposables:t})=>{t.add(xe(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),t.add(xe(e.document,"touchend",n=>this.onTouchEnd(e,n))),t.add(xe(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:hi,disposables:this._store}))}static addTarget(e){if(!Li.isTouchDevice())return me.None;Li.INSTANCE||(Li.INSTANCE=new Li);const t=Li.INSTANCE.targets.push(e);return Ot(t)}static ignoreTarget(e){if(!Li.isTouchDevice())return me.None;Li.INSTANCE||(Li.INSTANCE=new Li);const t=Li.INSTANCE.ignoreTargets.push(e);return Ot(t)}static isTouchDevice(){return"ontouchstart"in hi||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 n=0,r=e.targetTouches.length;n=Li.HOLD_DELAY&&Math.abs(l.initialPageX-Wc(l.rollingPageX))<30&&Math.abs(l.initialPageY-Wc(l.rollingPageY))<30){const u=this.newGestureEvent(Ei.Contextmenu,l.initialTarget);u.pageX=Wc(l.rollingPageX),u.pageY=Wc(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Wc(l.rollingPageX),d=Wc(l.rollingPageY),h=Wc(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],g=d-l.rollingPageY[0],p=[...this.targets].filter(m=>l.initialTarget instanceof Node&&m.contains(l.initialTarget));this.inertia(e,p,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(g)/h,g>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Ei.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Ei.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Li.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Ei.Change||e.type===Ei.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,r,o,s,a,l,c){this.handle=Ml(e,()=>{const u=Date.now(),d=u-n;let h=0,f=0,g=!0;r+=Li.SCROLL_FRICTION*d,a+=Li.SCROLL_FRICTION*d,r>0&&(g=!1,h=o*r*d),a>0&&(g=!1,f=l*a*d);const p=this.newGestureEvent(Ei.Change);p.translationX=h,p.translationY=f,t.forEach(m=>m.dispatchEvent(p)),g||this.inertia(e,t,u,r,o,s+h,a,l,c+f)})}onTouchMove(e){const t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Li.SCROLL_FRICTION=-.005;Li.HOLD_DELAY=700;Li.CLEAR_TAP_COUNT_TIME=400;Gut([Ar],Li,"isTouchDevice",null);let Lc=class extends me{onclick(e,t){this._register(xe(e,Je.CLICK,n=>t(new Gu(Bt(e),n))))}onmousedown(e,t){this._register(xe(e,Je.MOUSE_DOWN,n=>t(new Gu(Bt(e),n))))}onmouseover(e,t){this._register(xe(e,Je.MOUSE_OVER,n=>t(new Gu(Bt(e),n))))}onmouseleave(e,t){this._register(xe(e,Je.MOUSE_LEAVE,n=>t(new Gu(Bt(e),n))))}onkeydown(e,t){this._register(xe(e,Je.KEY_DOWN,n=>t(new Oi(n))))}onkeyup(e,t){this._register(xe(e,Je.KEY_UP,n=>t(new Oi(n))))}oninput(e,t){this._register(xe(e,Je.INPUT,t))}onblur(e,t){this._register(xe(e,Je.BLUR,t))}onfocus(e,t){this._register(xe(e,Je.FOCUS,t))}ignoreGesture(e){return Li.ignoreTarget(e)}};const iS=11;class qut extends Lc{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(...Vt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=iS+"px",this.domNode.style.height=iS+"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 qS),this._register(Lr(this.bgDomNode,Je.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Lr(this.domNode,Je.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new CY),this._pointerdownScheduleRepeatTimer=this._register(new gd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Bt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Xut extends me{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new gd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Yut=140;class Hye extends Lc{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 Xut(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new qS),this._shouldRender=!0,this.domNode=Jn(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(xe(this.domNode.domNode,Je.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new qut(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Jn(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(xe(this.slider.domNode,Je.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const o=Hr(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,n);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),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-n);if(Os&&a>Yut){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Zut=20;class rS{constructor(e,t,n,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new rS(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,n,r,o){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=r>0&&r>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Zut,Math.floor(n*a/r))),u=(a-c)/(r-n),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=rS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let n=this._scrollPosition;return tthis._host.onMouseWheel(new $b(null,1,0))}),this._createArrow({className:"scra",icon:tt.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new $b(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 Jut extends Hye{constructor(e,t,n){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new rS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-iS)/2,a=(t.verticalScrollbarSize-iS)/2;this._createArrow({className:"scra",icon:tt.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new $b(null,0,1))}),this._createArrow({className:"scra",icon:tt.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new $b(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 tO{constructor(e,t,n,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new tO(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 tO(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 n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class XS extends me{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ae),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new tO(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 n;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)===null||n===void 0||n.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 n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new LI(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=LI.start(this._state,n,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 n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class ple{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function V9(i,e){const t=e-i;return function(n){return i+t*ndt(n)}}function edt(i,e,t){return function(n){return n2.5*n){let o,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}nO.INSTANCE=new nO;class ZY extends Lc{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new ae),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ae),e.style.overflow="hidden",this._options=odt(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Jut(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Qut(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=Jn(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Jn(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Jn(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new gd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Dn&&(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 $b(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=r=>{this._onMouseWheel(new $b(r))};this._mouseWheelToDispose.push(xe(this._listenOnDomNode,Je.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=nO.INSTANCE;n.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Dn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=mle*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=mle*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",o=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),idt)}}class Vye extends ZY{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Ml(Bt(e),r)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class A3 extends ZY{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class ST extends ZY{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Ml(Bt(e),r)});super(e,t,n),this._register(n),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 odt(i){const e={lazyRender:typeof i.lazyRender<"u"?i.lazyRender:!1,className:typeof i.className<"u"?i.className:"",useShadows:typeof i.useShadows<"u"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel<"u"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes<"u"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded<"u"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel<"u"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX<"u"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity<"u"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity<"u"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis<"u"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll<"u"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize<"u"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode<"u"?i.listenOnDomNode:null,horizontal:typeof i.horizontal<"u"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize<"u"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows<"u"?i.horizontalHasArrows:!1,vertical:typeof i.vertical<"u"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize<"u"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows<"u"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize<"u"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage<"u"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize<"u"?i.verticalSliderSize:e.verticalScrollbarSize,Dn&&(e.className+=" mac"),e}class QY extends wT{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new os(this._context,n),this._mouseDownOperation=this._register(new sdt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(144).height;const r=new Nut(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=xe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new n_(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(xe(this.viewHelper.viewDomNode,Je.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=nO.INSTANCE;let t=0,n=Kc.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new $b(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Kc.getZoomLevel(),d=c.deltaY>0?1:-1;Kc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=Kc.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(Kc.setZoomLevel(n+o/5),c.preventDefault(),c.stopPropagation())};this._register(xe(this.viewHelper.viewDomNode,Je.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Dn?(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(144)){const t=this._context.configuration.options.get(144).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 Fye(e,t).toPageCoordinates(Bt(this.viewHelper.viewDomNode)),o=GY(this.viewHelper.viewDomNode);if(r.yo.y+o.height||r.xo.x+o.width)return null;const s=qY(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const r=Hb(this.viewHelper.viewDomNode);r&&(n=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(o)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class sdt extends me{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Mut(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new adt(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new O3,this._currentSelection=new Et(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,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);SY(s)?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,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=nS.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return qs.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return qs.createOutsideEditor(o,new le(u,n.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return qs.createOutsideEditor(o,new le(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return qs.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new le(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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 adt extends me{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new ldt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class ldt extends me{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Ml(Bt(s.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(144).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),n=this._tick(),r=t*(n/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=GY(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(144).horizontalScrollbarHeight,d=new M3(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=qY(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=qs.createOutsideEditor(this._position.mouseColumn,new le(a,1),"above",this._position.outsideDistance):l=qs.createOutsideEditor(this._position.mouseColumn,new le(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Ml(Bt(l.element),()=>this._execute())}}class O3{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>O3.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}O3.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const r=o=>this.emitter.fire(o);this.emitter=new ae({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}}class Yo{constructor(e,t,n,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=n.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Yo(n,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Yo(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(Xv(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(FA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const n=Math.min(Xv(e.value,t.value),e.selectionEnd),r=Math.min(FA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(n,e.value.length-r),s=t.value.substring(n,t.value.length-r);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}Yo.EMPTY=new Yo("",0,0,null,void 0);class wy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,r=n+1,o=n+t;return new W(r,1,o+1,1)}static fromEditorSelection(e,t,n,r){const s=wy._getPageOfLine(t.startLineNumber,n),a=wy._getRangeForPage(s,n),l=wy._getPageOfLine(t.endLineNumber,n),c=wy._getRangeForPage(l,n);let u=a.intersectRanges(new W(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const v=e.modifyPosition(u.getEndPosition(),-500);u=W.fromPositions(v,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new W(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=W.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let m;if(s===l||s+1===l)m=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),_=c.intersectRanges(t);m=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return r&&m.length>2*500&&(m=m.substring(0,500)+String.fromCharCode(8230)+m.substring(m.length-500,m.length)),new Yo(d+m+p,d.length,d.length+m.length,t,u.endLineNumber-u.startLineNumber)}}var cdt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},iO;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(iO||(iO={}));const Iz={forceCopyWithSyntaxHighlighting:!1};class EI{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)}}EI.INSTANCE=new EI;class udt{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 kz=class extends me{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,o,s){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new ae),this.onFocus=this._onFocus.event,this._onBlur=this._register(new ae),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new ae),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new ae),this.onCut=this._onCut.event,this._onPaste=this._register(new ae),this.onPaste=this._onPaste.event,this._onType=this._register(new ae),this.onType=this._onType.event,this._onCompositionStart=this._register(new ae),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new ae),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new ae),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new ae),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Vo),this._asyncTriggerCut=this._register(new mi(()=>this._onCut.fire(),0)),this._textAreaState=Yo.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(ot.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new mi(()=>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 Oi(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 Oi(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new udt;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=Yo.readFromTextArea(this._textArea,this._textAreaState),h=Yo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Yo.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=Yo.readFromTextArea(this._textArea,this._textAreaState),h=Yo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionEnd.fire();return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Yo.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=Yo.readFromTextArea(this._textArea,this._textAreaState),u=Yo.deduceInput(this._textAreaState,c,this._OS===2);u.replacePrevCharCnt===0&&u.text.length===1&&(Do(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]=Tz.getTextData(l.clipboardData);c&&(u=u||EI.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 mi(()=>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 xe(this._textArea.ownerDocument,"selectionchange",t=>{if(Jm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),r=n-e;if(e=n,r<5)return;const o=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new Et(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.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(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};EI.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,n),e.preventDefault(),e.clipboardData&&Tz.setTextData(e.clipboardData,t.text,t.html,n)}};kz=cdt([vle(4,pd),vle(5,Ra)],kz);const Tz={getTextData(i){const e=i.getData(wr.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(i,e,t,n){i.setData(wr.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class ddt extends me{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new ae),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Jm.onKeyDown())),this._register(this.onBeforeInput(()=>Jm.onBeforeInput())),this._register(this.onInput(()=>Jm.onInput())),this._register(this.onKeyUp(()=>Jm.onKeyUp())),this._register(xe(this._actual,iO.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=$b(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?ps()===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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const r=this._actual;let o=null;const s=$b(r);s?o=s.activeElement:o=ps();const a=Bt(o),l=o===r,c=r.selectionStart,u=r.selectionEnd;if(l&&c===t&&u===n){lu&&a.parent!==a&&r.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),lu&&a.parent!==a&&r.focus();return}try{const d=Tot(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),Not(r,d)}catch{}}}class hdt extends QY{constructor(e,t,n){super(e,t,n),this._register(Li.addTarget(this.viewHelper.linesContentDomNode)),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Tap,o=>this.onTap(o))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Change,o=>this.onChange(o))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Contextmenu,o=>this._onContextMenu(new t_(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(xe(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new Rut(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){!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 n=this._createMouseTarget(new t_(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class fdt extends QY{constructor(e,t,n){super(e,t,n),this._register(Li.addTarget(this.viewHelper.linesContentDomNode)),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Tap,r=>this.onTap(r))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Change,r=>this.onChange(r))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Contextmenu,r=>this._onContextMenu(new t_(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new t_(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(iO.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class gdt extends me{constructor(e,t,n){super(),(fh||Dnt&&OCe)&&pY.pointerEvents?this.handler=this._register(new hdt(e,t,n)):hi.TouchEvent?this.handler=this._register(new fdt(e,t,n)):this.handler=this._register(new QY(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class wC extends wT{}const Mo=Sn("themeService");function pr(i){return{id:i}}function Nz(i){switch(i){case Jc.DARK:return"vs-dark";case Jc.HIGH_CONTRAST_DARK:return"hc-black";case Jc.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const zye={ThemingContribution:"base.contributions.theming"};class pdt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ae}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ot(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Uye=new pdt;ur.add(zye.ThemingContribution,Uye);function vu(i){return Uye.onColorThemeChange(i)}class mdt extends me{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const jye=X("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("lineHighlight","Background color for the highlight of line at the cursor position.")),_le=X("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},w("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));X("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},w("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);X("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);X("editor.symbolHighlightBackground",{dark:sp,light:sp,hcDark:null,hcLight:null},w("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);X("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Kye=X("editorCursor.foreground",{dark:"#AEAFAD",light:Ce.black,hcDark:Ce.white,hcLight:"#0F4A85"},w("caret","Color of the editor cursor.")),vdt=X("editorCursor.background",null,w("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),up=X("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},w("editorWhitespaces","Color of whitespace characters in the editor.")),_dt=X("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Ce.white,hcLight:"#292929"},w("editorLineNumbers","Color of editor line numbers.")),YR=X("editorIndentGuide.background",{dark:up,light:up,hcDark:up,hcLight:up},w("editorIndentGuides","Color of the editor indentation guides."),!1,w("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),ZR=X("editorIndentGuide.activeBackground",{dark:up,light:up,hcDark:up,hcLight:up},w("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,w("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),xT=X("editorIndentGuide.background1",{dark:YR,light:YR,hcDark:YR,hcLight:YR},w("editorIndentGuides1","Color of the editor indentation guides (1).")),bdt=X("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides2","Color of the editor indentation guides (2).")),Cdt=X("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides3","Color of the editor indentation guides (3).")),ydt=X("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides4","Color of the editor indentation guides (4).")),wdt=X("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides5","Color of the editor indentation guides (5).")),Sdt=X("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides6","Color of the editor indentation guides (6).")),LT=X("editorIndentGuide.activeBackground1",{dark:ZR,light:ZR,hcDark:ZR,hcLight:ZR},w("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),xdt=X("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Ldt=X("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Edt=X("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Ddt=X("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Idt=X("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),QR=X("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Ki,hcLight:Ki},w("editorActiveLineNumber","Color of editor active line number"),!1,w("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));X("editorLineNumber.activeForeground",{dark:QR,light:QR,hcDark:QR,hcLight:QR},w("editorActiveLineNumber","Color of editor active line number"));const kdt=X("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));X("editorRuler.foreground",{dark:"#5A5A5A",light:Ce.lightgrey,hcDark:Ce.white,hcLight:"#292929"},w("editorRuler","Color of the editor rulers."));X("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},w("editorCodeLensForeground","Foreground color of editor CodeLens"));X("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},w("editorBracketMatchBackground","Background color behind matching brackets"));X("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},w("editorBracketMatchBorder","Color for matching brackets boxes"));const Tdt=X("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},w("editorOverviewRulerBorder","Color of the overview ruler border.")),Ndt=X("editorOverviewRuler.background",null,w("editorOverviewRulerBackground","Background color of the editor overview ruler."));X("editorGutter.background",{dark:ko,light:ko,hcDark:ko,hcLight:ko},w("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));X("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Ce.fromHex("#fff").transparent(.8),hcLight:Ln},w("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Rdt=X("editorUnnecessaryCode.opacity",{dark:Ce.fromHex("#000a"),light:Ce.fromHex("#0007"),hcDark:null,hcLight:null},w("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.`));X("editorGhostText.border",{dark:null,light:null,hcDark:Ce.fromHex("#fff").transparent(.8),hcLight:Ce.fromHex("#292929").transparent(.8)},w("editorGhostTextBorder","Border color of ghost text in the editor."));X("editorGhostText.foreground",{dark:Ce.fromHex("#ffffff56"),light:Ce.fromHex("#0007"),hcDark:null,hcLight:null},w("editorGhostTextForeground","Foreground color of the ghost text in the editor."));X("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorGhostTextBackground","Background color of the ghost text in the editor."));const JR=new Ce(new Rn(0,122,204,.6)),Gye=X("editorOverviewRuler.rangeHighlightForeground",{dark:JR,light:JR,hcDark:JR,hcLight:JR},w("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Mdt=X("editorOverviewRuler.errorForeground",{dark:new Ce(new Rn(255,18,18,.7)),light:new Ce(new Rn(255,18,18,.7)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:"#B5200D"},w("overviewRuleError","Overview ruler marker color for errors.")),Pdt=X("editorOverviewRuler.warningForeground",{dark:Zs,light:Zs,hcDark:yI,hcLight:yI},w("overviewRuleWarning","Overview ruler marker color for warnings.")),Adt=X("editorOverviewRuler.infoForeground",{dark:tl,light:tl,hcDark:wI,hcLight:wI},w("overviewRuleInfo","Overview ruler marker color for infos.")),qye=X("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},w("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Xye=X("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},w("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Yye=X("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},w("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Zye=X("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Qye=X("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Jye=X("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Odt=X("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Ce(new Rn(255,18,18,.8)),light:new Ce(new Rn(255,18,18,.8)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:""},w("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Fdt=X("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Bdt=X("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Wdt=X("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),$dt=X("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Hdt=X("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Vdt=X("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),zdt=X("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Udt=X("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),jdt=X("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Kdt=X("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Gdt=X("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),qdt=X("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));X("editorUnicodeHighlight.border",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));X("editorUnicodeHighlight.background",{dark:KR,light:KR,hcDark:KR,hcLight:KR},w("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));vu((i,e)=>{const t=i.getColor(ko),n=i.getColor(jye),r=n&&!n.isTransparent()?n:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class ET extends wC{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new le(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(95);const n=e.get(144);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-n);return r===0?''+n+"":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=ka?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);o.sort((c,u)=>W.compareRangesUsingEnds(c.range,u.range));let s=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=n;c<=r;c++){const u=c-n;let d=this._getLineRenderLineNumber(c),h="";for(;s${d}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}ET.CLASS_NAME="line-numbers";vu((i,e)=>{const t=i.getColor(_dt),n=i.getColor(kdt);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Vb extends Wl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=Jn(document.createElement("div")),this._domNode.setClassName(Vb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Jn(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Vb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}Vb.CLASS_NAME="glyph-margin";Vb.OUTER_CLASS_NAME="margin";const iw="monaco-mouse-cursor-text";class Xdt{constructor(){this._onDidChange=new ae,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 $E=new Xdt,ci=Sn("keybindingService");var Ydt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ble=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Zdt{constructor(e,t,n,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=r,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new le(this.modelLineNumber,this.distanceToModelLineStart+1),n=new le(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const z9=lu;let Rz=class extends Wl{constructor(e,t,n,r,o){super(e),this._keybindingService=r,this._instantiationService=o,this._primaryCursorPosition=new le(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,a=s.get(144);this._setAccessibilityOptions(s),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=s.get(50),this._lineHeight=s.get(67),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new Et(1,1,1,1)],this._modelSelections=[new Et(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Jn(document.createElement("textarea")),vh.write(this.textArea,7),this.textArea.setClassName(`inputarea ${iw}`),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(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",w("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Jn(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},u={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Os),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),p=Array.isArray(h)?h:null,m=Array.isArray(h)?h.join(f):h;let v,_=null;if(Iz.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(v=y.html,_=y.mode)}return{isFromEmptySelection:g,multicursorText:p,text:m,html:v,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(Dn&&h.isEmpty()){const g=h.getStartPosition();let p=this._getWordBeforePosition(g);if(p.length===0&&(p=this._getCharacterBeforePosition(g)),p.length>0)return new Yo(p,p.length,p.length,W.fromPositions(g),0)}const f=500;if(Dn&&!h.isEmpty()&&c.getValueLengthInRange(h,0)0)return new Yo(g,p,p,W.fromPositions(f),0)}return Yo.EMPTY}return wy.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,g)},d=this._register(new ddt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(kz,u,d,Ll,{isAndroid:zse,isChrome:fT,isFirefox:lu,isSafari:Fp})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,g=null,p=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,g=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,p=h.metadata.mode),this._viewController.paste(h.text,f,g,p)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:p,widthOfHiddenTextBefore:m}=(()=>{const _=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=_.lastIndexOf(` +`),null]:[e,t]},setTextData(i,e,t,n){i.setData(wr.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class ddt extends me{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new ae),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Jm.onKeyDown())),this._register(this.onBeforeInput(()=>Jm.onBeforeInput())),this._register(this.onInput(()=>Jm.onInput())),this._register(this.onKeyUp(()=>Jm.onKeyUp())),this._register(xe(this._actual,iO.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Hb(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?ps()===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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const r=this._actual;let o=null;const s=Hb(r);s?o=s.activeElement:o=ps();const a=Bt(o),l=o===r,c=r.selectionStart,u=r.selectionEnd;if(l&&c===t&&u===n){lu&&a.parent!==a&&r.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),lu&&a.parent!==a&&r.focus();return}try{const d=Tot(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),Not(r,d)}catch{}}}class hdt extends QY{constructor(e,t,n){super(e,t,n),this._register(Li.addTarget(this.viewHelper.linesContentDomNode)),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Tap,o=>this.onTap(o))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Change,o=>this.onChange(o))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Contextmenu,o=>this._onContextMenu(new n_(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(xe(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new Rut(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){!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 n=this._createMouseTarget(new n_(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class fdt extends QY{constructor(e,t,n){super(e,t,n),this._register(Li.addTarget(this.viewHelper.linesContentDomNode)),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Tap,r=>this.onTap(r))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Change,r=>this.onChange(r))),this._register(xe(this.viewHelper.linesContentDomNode,Ei.Contextmenu,r=>this._onContextMenu(new n_(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new n_(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(iO.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class gdt extends me{constructor(e,t,n){super(),(fh||Dnt&&OCe)&&pY.pointerEvents?this.handler=this._register(new hdt(e,t,n)):hi.TouchEvent?this.handler=this._register(new fdt(e,t,n)):this.handler=this._register(new QY(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class wC extends wT{}const Mo=Sn("themeService");function pr(i){return{id:i}}function Nz(i){switch(i){case Jc.DARK:return"vs-dark";case Jc.HIGH_CONTRAST_DARK:return"hc-black";case Jc.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const zye={ThemingContribution:"base.contributions.theming"};class pdt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ae}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ot(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Uye=new pdt;ur.add(zye.ThemingContribution,Uye);function vu(i){return Uye.onColorThemeChange(i)}class mdt extends me{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const jye=X("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("lineHighlight","Background color for the highlight of line at the cursor position.")),_le=X("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},w("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));X("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},w("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);X("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);X("editor.symbolHighlightBackground",{dark:sp,light:sp,hcDark:null,hcLight:null},w("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);X("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Kye=X("editorCursor.foreground",{dark:"#AEAFAD",light:Ce.black,hcDark:Ce.white,hcLight:"#0F4A85"},w("caret","Color of the editor cursor.")),vdt=X("editorCursor.background",null,w("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),up=X("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},w("editorWhitespaces","Color of whitespace characters in the editor.")),_dt=X("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Ce.white,hcLight:"#292929"},w("editorLineNumbers","Color of editor line numbers.")),YR=X("editorIndentGuide.background",{dark:up,light:up,hcDark:up,hcLight:up},w("editorIndentGuides","Color of the editor indentation guides."),!1,w("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),ZR=X("editorIndentGuide.activeBackground",{dark:up,light:up,hcDark:up,hcLight:up},w("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,w("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),xT=X("editorIndentGuide.background1",{dark:YR,light:YR,hcDark:YR,hcLight:YR},w("editorIndentGuides1","Color of the editor indentation guides (1).")),bdt=X("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides2","Color of the editor indentation guides (2).")),Cdt=X("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides3","Color of the editor indentation guides (3).")),ydt=X("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides4","Color of the editor indentation guides (4).")),wdt=X("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides5","Color of the editor indentation guides (5).")),Sdt=X("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides6","Color of the editor indentation guides (6).")),LT=X("editorIndentGuide.activeBackground1",{dark:ZR,light:ZR,hcDark:ZR,hcLight:ZR},w("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),xdt=X("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Ldt=X("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Edt=X("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Ddt=X("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Idt=X("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),QR=X("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Ki,hcLight:Ki},w("editorActiveLineNumber","Color of editor active line number"),!1,w("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));X("editorLineNumber.activeForeground",{dark:QR,light:QR,hcDark:QR,hcLight:QR},w("editorActiveLineNumber","Color of editor active line number"));const kdt=X("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));X("editorRuler.foreground",{dark:"#5A5A5A",light:Ce.lightgrey,hcDark:Ce.white,hcLight:"#292929"},w("editorRuler","Color of the editor rulers."));X("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},w("editorCodeLensForeground","Foreground color of editor CodeLens"));X("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},w("editorBracketMatchBackground","Background color behind matching brackets"));X("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},w("editorBracketMatchBorder","Color for matching brackets boxes"));const Tdt=X("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},w("editorOverviewRulerBorder","Color of the overview ruler border.")),Ndt=X("editorOverviewRuler.background",null,w("editorOverviewRulerBackground","Background color of the editor overview ruler."));X("editorGutter.background",{dark:ko,light:ko,hcDark:ko,hcLight:ko},w("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));X("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Ce.fromHex("#fff").transparent(.8),hcLight:Ln},w("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Rdt=X("editorUnnecessaryCode.opacity",{dark:Ce.fromHex("#000a"),light:Ce.fromHex("#0007"),hcDark:null,hcLight:null},w("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.`));X("editorGhostText.border",{dark:null,light:null,hcDark:Ce.fromHex("#fff").transparent(.8),hcLight:Ce.fromHex("#292929").transparent(.8)},w("editorGhostTextBorder","Border color of ghost text in the editor."));X("editorGhostText.foreground",{dark:Ce.fromHex("#ffffff56"),light:Ce.fromHex("#0007"),hcDark:null,hcLight:null},w("editorGhostTextForeground","Foreground color of the ghost text in the editor."));X("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorGhostTextBackground","Background color of the ghost text in the editor."));const JR=new Ce(new Rn(0,122,204,.6)),Gye=X("editorOverviewRuler.rangeHighlightForeground",{dark:JR,light:JR,hcDark:JR,hcLight:JR},w("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Mdt=X("editorOverviewRuler.errorForeground",{dark:new Ce(new Rn(255,18,18,.7)),light:new Ce(new Rn(255,18,18,.7)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:"#B5200D"},w("overviewRuleError","Overview ruler marker color for errors.")),Pdt=X("editorOverviewRuler.warningForeground",{dark:Zs,light:Zs,hcDark:yI,hcLight:yI},w("overviewRuleWarning","Overview ruler marker color for warnings.")),Adt=X("editorOverviewRuler.infoForeground",{dark:tl,light:tl,hcDark:wI,hcLight:wI},w("overviewRuleInfo","Overview ruler marker color for infos.")),qye=X("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},w("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Xye=X("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},w("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Yye=X("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},w("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Zye=X("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Qye=X("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Jye=X("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Odt=X("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Ce(new Rn(255,18,18,.8)),light:new Ce(new Rn(255,18,18,.8)),hcDark:new Ce(new Rn(255,50,50,1)),hcLight:""},w("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Fdt=X("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Bdt=X("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Wdt=X("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),$dt=X("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Hdt=X("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Vdt=X("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),zdt=X("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Udt=X("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),jdt=X("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Kdt=X("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Gdt=X("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),qdt=X("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));X("editorUnicodeHighlight.border",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},w("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));X("editorUnicodeHighlight.background",{dark:KR,light:KR,hcDark:KR,hcLight:KR},w("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));vu((i,e)=>{const t=i.getColor(ko),n=i.getColor(jye),r=n&&!n.isTransparent()?n:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class ET extends wC{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new le(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(95);const n=e.get(144);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-n);return r===0?''+n+"":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=ka?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);o.sort((c,u)=>W.compareRangesUsingEnds(c.range,u.range));let s=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=n;c<=r;c++){const u=c-n;let d=this._getLineRenderLineNumber(c),h="";for(;s${d}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}ET.CLASS_NAME="line-numbers";vu((i,e)=>{const t=i.getColor(_dt),n=i.getColor(kdt);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class zb extends Wl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=Jn(document.createElement("div")),this._domNode.setClassName(zb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Jn(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(zb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}zb.CLASS_NAME="glyph-margin";zb.OUTER_CLASS_NAME="margin";const iw="monaco-mouse-cursor-text";class Xdt{constructor(){this._onDidChange=new ae,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 $E=new Xdt,ci=Sn("keybindingService");var Ydt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ble=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Zdt{constructor(e,t,n,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=r,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new le(this.modelLineNumber,this.distanceToModelLineStart+1),n=new le(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const z9=lu;let Rz=class extends Wl{constructor(e,t,n,r,o){super(e),this._keybindingService=r,this._instantiationService=o,this._primaryCursorPosition=new le(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,a=s.get(144);this._setAccessibilityOptions(s),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=s.get(50),this._lineHeight=s.get(67),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new Et(1,1,1,1)],this._modelSelections=[new Et(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Jn(document.createElement("textarea")),vh.write(this.textArea,7),this.textArea.setClassName(`inputarea ${iw}`),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(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",w("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Jn(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},u={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Os),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),p=Array.isArray(h)?h:null,m=Array.isArray(h)?h.join(f):h;let v,_=null;if(Iz.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(v=y.html,_=y.mode)}return{isFromEmptySelection:g,multicursorText:p,text:m,html:v,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(Dn&&h.isEmpty()){const g=h.getStartPosition();let p=this._getWordBeforePosition(g);if(p.length===0&&(p=this._getCharacterBeforePosition(g)),p.length>0)return new Yo(p,p.length,p.length,W.fromPositions(g),0)}const f=500;if(Dn&&!h.isEmpty()&&c.getValueLengthInRange(h,0)0)return new Yo(g,p,p,W.fromPositions(f),0)}return Yo.EMPTY}return wy.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,g)},d=this._register(new ddt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(kz,u,d,Ll,{isAndroid:zse,isChrome:fT,isFirefox:lu,isSafari:Fp})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,g=null,p=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,g=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,p=h.metadata.mode),this._viewController.paste(h.text,f,g,p)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:p,widthOfHiddenTextBefore:m}=(()=>{const _=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=_.lastIndexOf(` `),S=_.substring(y+1),L=S.lastIndexOf(" "),E=S.length-L-1,D=g.getStartPosition(),k=Math.min(D.column-1,E),T=D.column-1-k,M=S.substring(0,S.length-k),{tabSize:P}=this._context.viewModel.model.getOptions(),N=Qdt(this.textArea.domNode.ownerDocument,M,this._fontInfo,P);return{distanceToModelLineStart:T,widthOfHiddenTextBefore:N}})(),{distanceToModelLineEnd:v}=(()=>{const _=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=_.indexOf(` `),S=y===-1?_:_.substring(0,y),L=S.indexOf(" "),E=L===-1?S.length:S.length-L-1,D=g.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,E);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-k}})();this._context.viewModel.revealRange("keyboard",!0,W.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Zdt(this._context,g.startLineNumber,p,m,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${iw} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{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 ${iw}`),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($E.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),r=cu(t);let o=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&s<=1&&(o=!1),o){const u=n.charCodeAt(s-2);r.get(u)!==0?o=!1:s--}if(a&&l>n.length&&(a=!1),a){const u=n.charCodeAt(l-1);r.get(u)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=cu(this._context.configuration.options.get(130));let r=e.column,o=0;for(;r>1;){const s=t.charCodeAt(r-2);if(n.get(s)!==0||o>50)return t.substring(r-1,e.column-1);o++,r--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Do(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,r;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||r===void 0?void 0:r.getAriaLabel(),c=w("accessibilityModeOff","The editor is not accessible at this time.");return s?w("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?w("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?w("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===kh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const r=e.get(144).wrappingColumn;if(r!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(r*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=z9?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.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(124))),(e.hasChanged(34)||e.hasChanged(91))&&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;!$E.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new le(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const r=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&r&&o&&o.left>=this._scrollLeft&&r.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+r.left-this._scrollLeft,h=o.left-r.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),m=g===p,v=this._visibleTextArea.definePresentation(m?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(gr.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Dn||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const r=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=r*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:z9?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` -`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:z9?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;vs(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Ce.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const r=this._context.configuration.options;r.get(57)?n.setClassName("monaco-editor-background textAreaCover "+Vb.OUTER_CLASS_NAME):r.get(68).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+ET.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};Rz=Ydt([ble(3,ci),ble(4,Wt)],Rz);function Qdt(i,e,t,n){if(e.length===0)return 0;const r=i.createElement("div");r.style.position="absolute",r.style.top="-50000px",r.style.width="50000px";const o=i.createElement("span");vs(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${n*t.spaceWidth}px`,o.append(e),r.appendChild(o),i.body.appendChild(r);const s=o.offsetWidth;return i.body.removeChild(r),s}function Jdt(i,e,t){let n=0;for(let o=0;o!0,tht=()=>!1,nht=i=>i===" "||i===" ";class v1{static shouldRecreate(e){return e.hasChanged(144)||e.hasChanged(130)||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(128)||e.hasChanged(50)||e.hasChanged(91)}constructor(e,t,n,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(144),l=s.get(50);this.readOnly=s.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(128),this.wordSeparators=s.get(130),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.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const r=x3(t,n-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,n-r.firstCharOffset):null}normalizeIndentation(e){return rO(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return nht;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return eht;case"never":return tht}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>n.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return _o.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const r=_o.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),o=e.getLineMinColumn(t);if(rs?s:r}}let $n=class ewe{static fromModelState(e){return new iht(e)}static fromViewState(e){return new rht(e)}static fromModelSelection(e){const t=Et.liftSelection(e),n=new Zo(W.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return ewe.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,r=e.length;no,c=r>s,u=rs||vr||m0&&r--,N0.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,r)}static columnSelectRight(e,t,n){let r=0;const o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new le(l,c));r=Math.max(r,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-l1e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new le(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=xI.atomicPosition(o,t.column-1,n,0);if(s!==-1&&s+1>=r)return new le(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const r=e.stickyTabStops?ri.leftPositionAtomicSoftTabs(t,n,e.tabSize):ri.leftPosition(t,n);return new U9(r.lineNumber,r.column,0)}static moveLeft(e,t,n,r,o){let s,a;if(n.hasSelection()&&!r)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(o-1)),c=t.normalizePosition(ri.clipPositionColumn(l,t),0),u=ri.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(r,s,a,0)}static clipPositionColumn(e,t){return new le(e.lineNumber,ri.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?r=t.getLineMaxColumn(n):r=Math.min(t.getLineMaxColumn(n),r)):r=e.columnFromVisibleColumn(t,n,c),f?o=0:o=c-_o.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),l!==void 0){const g=new le(n,r),p=t.normalizePosition(g,l);o=o+(r-p.column),n=p.lineNumber,r=p.column}return new U9(n,r,o)}static down(e,t,n,r,o,s,a){return this.vertical(e,t,n,r,o,n+s,a,4)}static moveDown(e,t,n,r,o){let s,a;n.hasSelection()&&!r?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ri.down(e,t,s+l,a,n.leftoverVisibleColumns,o,!0),t.normalizePosition(new le(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return n.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,n,r){const o=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(Lm(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let m=!1;for(const v of g)v.open===f&&v.close===p&&(m=!0);if(!m)return!1;if(e==="auto"){let v=!1;for(let _=0,y=a.length;_1){const o=t.getLineContent(r.lineNumber),s=Js(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=n.visibleColumnFromColumn(t,r),c=_o.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,r.lineNumber,c);return new W(r.lineNumber,u,r.lineNumber,r.column)}}return W.fromPositions(zb.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=yrt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new le(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const r=[];let o=null;n.sort((s,a)=>le.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new W(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new ls(g,"")}else r[s]=null;else r[s]=new ls(l,"")}return new Ga(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,r,o){return{start:r,end:o,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)}static _doFindPreviousWordOnLine(e,t,n){let r=0;for(let o=n.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,n,r){const o=e.length;for(let s=r;s=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,n,r){let o=n.lineNumber,s=n.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Qn._findPreviousWordOnLine(e,t,new le(o,s));if(r===0)return new le(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1))),new le(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1));return new le(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1))),new le(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===1)return n>1?new le(n-1,e.getLineMaxColumn(n-1)):t;const o=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new le(n,s);if(a===45&&l!==45)return new le(n,s);if((Zm(a)||WR(a))&&af(l))return new le(n,s);if(af(a)&&af(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new le(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new le(o,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Qn._findPreviousWordOnLine(n,r,new le(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new W(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const r=new le(n.positionLineNumber,n.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),r=n.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(n,s))return null;for(;o>0&&this._charAtIsWhitespace(n,o-1);)o--;for(;s+11?new W(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new W(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Qn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),r=Qn._moveWordPartLeft(e,n);return new W(n.lineNumber,n.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let r=t;r=h.start+1&&(h=Qn._findNextWordOnLine(n,r,new le(l,h.end+1))),h?c=h.start+1:c!!e)}class qo{static addCursorDown(e,t,n){const r=[];let o=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),$n.fromModelState(new Zo(new W(s.lineNumber,1,u,d),2,0,new le(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),$n.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return $n.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,r){const o=e.model.validatePosition(r);return $n.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new $n(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,r=t.viewState.position.column;return $n.fromViewState(new Zo(new W(n,r,n,r),0,0,new le(n,r),0))}static moveTo(e,t,n,r,o){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new le(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return $n.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,r,o,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>$n.fromViewState(ri.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>$n.fromModelState(ri.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>$n.fromViewState(ri.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>$n.fromModelState(ri.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,n,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:o$n.fromViewState(ri.moveLeft(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineLeft(e,t,n){const r=[];for(let o=0,s=t.length;o$n.fromViewState(ri.moveRight(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineRight(e,t,n){const r=[];for(let o=0,s=t.length;o!0,tht=()=>!1,nht=i=>i===" "||i===" ";class v1{static shouldRecreate(e){return e.hasChanged(144)||e.hasChanged(130)||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(128)||e.hasChanged(50)||e.hasChanged(91)}constructor(e,t,n,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(144),l=s.get(50);this.readOnly=s.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(128),this.wordSeparators=s.get(130),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.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const r=x3(t,n-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,n-r.firstCharOffset):null}normalizeIndentation(e){return rO(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return nht;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return eht;case"never":return tht}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>n.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return _o.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const r=_o.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),o=e.getLineMinColumn(t);if(rs?s:r}}let $n=class ewe{static fromModelState(e){return new iht(e)}static fromViewState(e){return new rht(e)}static fromModelSelection(e){const t=Et.liftSelection(e),n=new Zo(W.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return ewe.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,r=e.length;no,c=r>s,u=rs||vr||m0&&r--,R0.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,r)}static columnSelectRight(e,t,n){let r=0;const o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new le(l,c));r=Math.max(r,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-l1e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new le(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=xI.atomicPosition(o,t.column-1,n,0);if(s!==-1&&s+1>=r)return new le(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const r=e.stickyTabStops?ri.leftPositionAtomicSoftTabs(t,n,e.tabSize):ri.leftPosition(t,n);return new U9(r.lineNumber,r.column,0)}static moveLeft(e,t,n,r,o){let s,a;if(n.hasSelection()&&!r)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(o-1)),c=t.normalizePosition(ri.clipPositionColumn(l,t),0),u=ri.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(r,s,a,0)}static clipPositionColumn(e,t){return new le(e.lineNumber,ri.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?r=t.getLineMaxColumn(n):r=Math.min(t.getLineMaxColumn(n),r)):r=e.columnFromVisibleColumn(t,n,c),f?o=0:o=c-_o.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),l!==void 0){const g=new le(n,r),p=t.normalizePosition(g,l);o=o+(r-p.column),n=p.lineNumber,r=p.column}return new U9(n,r,o)}static down(e,t,n,r,o,s,a){return this.vertical(e,t,n,r,o,n+s,a,4)}static moveDown(e,t,n,r,o){let s,a;n.hasSelection()&&!r?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ri.down(e,t,s+l,a,n.leftoverVisibleColumns,o,!0),t.normalizePosition(new le(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return n.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,n,r){const o=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(Lm(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let m=!1;for(const v of g)v.open===f&&v.close===p&&(m=!0);if(!m)return!1;if(e==="auto"){let v=!1;for(let _=0,y=a.length;_1){const o=t.getLineContent(r.lineNumber),s=Js(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=n.visibleColumnFromColumn(t,r),c=_o.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,r.lineNumber,c);return new W(r.lineNumber,u,r.lineNumber,r.column)}}return W.fromPositions(Ub.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=yrt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new le(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const r=[];let o=null;n.sort((s,a)=>le.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new W(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new ls(g,"")}else r[s]=null;else r[s]=new ls(l,"")}return new Ga(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,r,o){return{start:r,end:o,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)}static _doFindPreviousWordOnLine(e,t,n){let r=0;for(let o=n.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,n,r){const o=e.length;for(let s=r;s=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,n,r){let o=n.lineNumber,s=n.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Qn._findPreviousWordOnLine(e,t,new le(o,s));if(r===0)return new le(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1))),new le(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1));return new le(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new le(o,a.start+1))),new le(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===1)return n>1?new le(n-1,e.getLineMaxColumn(n-1)):t;const o=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new le(n,s);if(a===45&&l!==45)return new le(n,s);if((Zm(a)||WR(a))&&af(l))return new le(n,s);if(af(a)&&af(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new le(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new le(o,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Qn._findPreviousWordOnLine(n,r,new le(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new W(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const r=new le(n.positionLineNumber,n.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),r=n.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(n,s))return null;for(;o>0&&this._charAtIsWhitespace(n,o-1);)o--;for(;s+11?new W(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new W(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Qn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),r=Qn._moveWordPartLeft(e,n);return new W(n.lineNumber,n.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let r=t;r=h.start+1&&(h=Qn._findNextWordOnLine(n,r,new le(l,h.end+1))),h?c=h.start+1:c!!e)}class qo{static addCursorDown(e,t,n){const r=[];let o=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),$n.fromModelState(new Zo(new W(s.lineNumber,1,u,d),2,0,new le(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),$n.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return $n.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,r){const o=e.model.validatePosition(r);return $n.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new $n(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,r=t.viewState.position.column;return $n.fromViewState(new Zo(new W(n,r,n,r),0,0,new le(n,r),0))}static moveTo(e,t,n,r,o){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new le(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return $n.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,r,o,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>$n.fromViewState(ri.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>$n.fromModelState(ri.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>$n.fromViewState(ri.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>$n.fromModelState(ri.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,n,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:o$n.fromViewState(ri.moveLeft(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineLeft(e,t,n){const r=[];for(let o=0,s=t.length;o$n.fromViewState(ri.moveRight(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineRight(e,t,n){const r=[];for(let o=0,s=t.length;o1&&r.firstCharOffset===0){const p=Qy(e,t.startLineNumber-1);p.languageId===r.languageId&&(c=p.getLineContent())}const u=o.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===Zr.Indent&&(h=" "+h):d===Zr.Indent||d===Zr.IndentOutdent?h=" ":h="";let g=aye(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var sht=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},aht=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qM;const j9=Object.create(null);function n0(i,e){if(e<=0)return"";j9[i]||(j9[i]=["",i]);const t=j9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let qc=qM=class{static unshiftIndent(e,t,n,r,o){const s=_o.visibleColumnFromColumn(e,t,n);if(o){const a=n0(" ",r),c=_o.prevIndentTabStop(s,r)/r;return n0(a,c)}else{const a=" ",c=_o.prevRenderTabStop(s,n)/n;return n0(a,c)}}static shiftIndent(e,t,n,r,o){const s=_o.visibleColumnFromColumn(e,t,n);if(o){const a=n0(" ",r),c=_o.nextIndentTabStop(s,r)/r;return n0(a,c)}else{const a=" ",c=_o.nextRenderTabStop(s,n)/n;return n0(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&n!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=n===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let f=Js(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&_o.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const m=rw(this._opts.autoIndent,e,new W(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(m){if(u=c,m.appendText)for(let v=0,_=m.appendText.length;v<_&&u1){let r,o=-1;for(r=e-1;r>=1;r--){if(i.tokenization.getLanguageIdAtPosition(r,0)!==n)return o;const s=i.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function B3(i,e,t,n=!0,r){if(i<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=uht(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:yi(a),action:Zr.Indent,line:s};if(o.shouldDecrease(a))return{indentation:yi(a),action:null,line:s};{if(s===1)return{indentation:yi(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:yi(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:yi(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:yi(d),action:Zr.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:yi(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:yi(d),action:null,line:u}}return{indentation:yi(e.getLineContent(1)),action:null,line:1}}}function HE(i,e,t,n,r,o){if(i<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=B3(i,e,n,void 0,o),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=Qy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=yi(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=yi(o.getLineContent()),m=B3(i,g,t.startLineNumber+1,void 0,r);if(!m){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let v=l?p:m.indentation;return m.action===Zr.Indent&&(v=n.shiftIndent(v)),d.shouldDecrease(u)&&(v=n.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function hht(i,e,t,n,r,o){if(i<4)return null;const s=Qy(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=Qy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=B3(i,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==Zr.Indent&&(h=r.unshiftIndent(h)),h}return null}function twe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class sr{static indent(e,t,n){if(t===null||n===null)return[];const r=[];for(let o=0,s=n.length;o1){let a;for(a=n-1;a>=1;a--){const u=t.getLineContent(a);if(rh(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=rw(e.autoIndent,t,new W(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===Zr.Indent&&(o=sr.shiftIndent(e,o)),r===Zr.Outdent&&(o=sr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,n,r){let o="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;uthis._compositionType(n,u,o,s,a,l));return new Ga(4,c,{shouldPushStackElementBefore:n2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,r,o,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-r),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),u=new W(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===n&&s===0?null:new GM(u,n,0,s)}static _typeCommand(e,t,n){return n?new e2(e,t,!0):new ls(e,t,!0)}static _enter(e,t,n,r){if(e.autoIndent===0)return sr._typeCommand(r,` -`,n);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=yi(l).substring(0,r.startColumn-1);return sr._typeCommand(r,` -`+e.normalizeIndentation(c),n)}const o=rw(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===Zr.None)return sr._typeCommand(r,` -`+e.normalizeIndentation(o.indentation+o.appendText),n);if(o.indentAction===Zr.Indent)return sr._typeCommand(r,` + `,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}}}}]},i.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"},i.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(n){if(!n.to)return null;let r;switch(n.to){case i.RawDirection.Left:r=0;break;case i.RawDirection.Right:r=1;break;case i.RawDirection.Up:r=2;break;case i.RawDirection.Down:r=3;break;case i.RawDirection.PrevBlankLine:r=4;break;case i.RawDirection.NextBlankLine:r=5;break;case i.RawDirection.WrappedLineStart:r=6;break;case i.RawDirection.WrappedLineFirstNonWhitespaceCharacter:r=7;break;case i.RawDirection.WrappedLineColumnCenter:r=8;break;case i.RawDirection.WrappedLineEnd:r=9;break;case i.RawDirection.WrappedLineLastNonWhitespaceCharacter:r=10;break;case i.RawDirection.ViewPortTop:r=11;break;case i.RawDirection.ViewPortBottom:r=13;break;case i.RawDirection.ViewPortCenter:r=12;break;case i.RawDirection.ViewPortIfOutside:r=14;break;default:return null}let o=0;switch(n.by){case i.RawUnit.Line:o=1;break;case i.RawUnit.WrappedLine:o=2;break;case i.RawUnit.Character:o=3;break;case i.RawUnit.HalfLine:o=4;break}return{direction:r,unit:o,select:!!n.select,value:n.value||1}}i.parse=t})(oO||(oO={}));function rw(i,e,t,n){const r=Qy(e,t.startLineNumber,t.startColumn),o=n.getLanguageConfiguration(r.languageId);if(!o)return null;const s=r.getLineContent(),a=s.substr(0,t.startColumn-1-r.firstCharOffset);let l;t.isEmpty()?l=s.substr(t.startColumn-1-r.firstCharOffset):l=Qy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);let c="";if(t.startLineNumber>1&&r.firstCharOffset===0){const p=Qy(e,t.startLineNumber-1);p.languageId===r.languageId&&(c=p.getLineContent())}const u=o.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===Zr.Indent&&(h=" "+h):d===Zr.Indent||d===Zr.IndentOutdent?h=" ":h="";let g=aye(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var sht=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},aht=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qM;const j9=Object.create(null);function i0(i,e){if(e<=0)return"";j9[i]||(j9[i]=["",i]);const t=j9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let qc=qM=class{static unshiftIndent(e,t,n,r,o){const s=_o.visibleColumnFromColumn(e,t,n);if(o){const a=i0(" ",r),c=_o.prevIndentTabStop(s,r)/r;return i0(a,c)}else{const a=" ",c=_o.prevRenderTabStop(s,n)/n;return i0(a,c)}}static shiftIndent(e,t,n,r,o){const s=_o.visibleColumnFromColumn(e,t,n);if(o){const a=i0(" ",r),c=_o.nextIndentTabStop(s,r)/r;return i0(a,c)}else{const a=" ",c=_o.nextRenderTabStop(s,n)/n;return i0(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&n!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=n===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let f=Js(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&_o.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const m=rw(this._opts.autoIndent,e,new W(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(m){if(u=c,m.appendText)for(let v=0,_=m.appendText.length;v<_&&u1){let r,o=-1;for(r=e-1;r>=1;r--){if(i.tokenization.getLanguageIdAtPosition(r,0)!==n)return o;const s=i.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function B3(i,e,t,n=!0,r){if(i<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=uht(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:yi(a),action:Zr.Indent,line:s};if(o.shouldDecrease(a))return{indentation:yi(a),action:null,line:s};{if(s===1)return{indentation:yi(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:yi(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:yi(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:yi(d),action:Zr.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:yi(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:yi(d),action:null,line:u}}return{indentation:yi(e.getLineContent(1)),action:null,line:1}}}function HE(i,e,t,n,r,o){if(i<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=B3(i,e,n,void 0,o),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=Qy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=yi(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=yi(o.getLineContent()),m=B3(i,g,t.startLineNumber+1,void 0,r);if(!m){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let v=l?p:m.indentation;return m.action===Zr.Indent&&(v=n.shiftIndent(v)),d.shouldDecrease(u)&&(v=n.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function hht(i,e,t,n,r,o){if(i<4)return null;const s=Qy(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=Qy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=B3(i,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==Zr.Indent&&(h=r.unshiftIndent(h)),h}return null}function twe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class ar{static indent(e,t,n){if(t===null||n===null)return[];const r=[];for(let o=0,s=n.length;o1){let a;for(a=n-1;a>=1;a--){const u=t.getLineContent(a);if(rh(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=rw(e.autoIndent,t,new W(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===Zr.Indent&&(o=ar.shiftIndent(e,o)),r===Zr.Outdent&&(o=ar.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,n,r){let o="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;uthis._compositionType(n,u,o,s,a,l));return new Ga(4,c,{shouldPushStackElementBefore:n2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,r,o,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-r),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),u=new W(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===n&&s===0?null:new GM(u,n,0,s)}static _typeCommand(e,t,n){return n?new e2(e,t,!0):new ls(e,t,!0)}static _enter(e,t,n,r){if(e.autoIndent===0)return ar._typeCommand(r,` +`,n);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=yi(l).substring(0,r.startColumn-1);return ar._typeCommand(r,` +`+e.normalizeIndentation(c),n)}const o=rw(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===Zr.None)return ar._typeCommand(r,` +`+e.normalizeIndentation(o.indentation+o.appendText),n);if(o.indentAction===Zr.Indent)return ar._typeCommand(r,` `+e.normalizeIndentation(o.indentation+o.appendText),n);if(o.indentAction===Zr.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),u=` `+c+` -`+l;return n?new e2(r,u,!0):new GM(r,u,-1,c.length-l.length,!0)}else if(o.indentAction===Zr.Outdent){const l=sr.unshiftIndent(e,o.indentation);return sr._typeCommand(r,` -`+e.normalizeIndentation(l+o.appendText),n)}}const s=t.getLineContent(r.startLineNumber),a=yi(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=dht(e.autoIndent,t,r,{unshiftIndent:c=>sr.unshiftIndent(e,c),shiftIndent:c=>sr.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,r.getEndPosition());const u=r.endColumn,d=t.getLineContent(r.endLineNumber),h=Js(d);if(h>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,h+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),n)return new e2(r,` +`+l;return n?new e2(r,u,!0):new GM(r,u,-1,c.length-l.length,!0)}else if(o.indentAction===Zr.Outdent){const l=ar.unshiftIndent(e,o.indentation);return ar._typeCommand(r,` +`+e.normalizeIndentation(l+o.appendText),n)}}const s=t.getLineContent(r.startLineNumber),a=yi(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=dht(e.autoIndent,t,r,{unshiftIndent:c=>ar.unshiftIndent(e,c),shiftIndent:c=>ar.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,r.getEndPosition());const u=r.endColumn,d=t.getLineContent(r.endLineNumber),h=Js(d);if(h>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,h+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),n)return new e2(r,` `+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new GM(r,` -`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return sr._typeCommand(r,` -`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let r=0,o=n.length;rsr.shiftIndent(e,a),unshiftIndent:a=>sr.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?sr._typeCommand(new W(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+r,!1):sr._typeCommand(new W(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,n,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,m=r.length;pt.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new W(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let o=null;for(const s of r)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,n,r,o){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-r.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new le(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(Lm(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:m,afterColumn:v}=g,_=t.getLineContent(p),y=_.substring(0,m-1),S=_.substring(v-1);if(S.startsWith(h)||(f=!1),S.length>0){const k=S.charAt(0);if(!sr._isBeforeClosingBrace(e,S)&&!c(k))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const k=cu(e.wordSeparators);if(y.length>0){const T=y.charCodeAt(y.length-1);if(k.get(T)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),E=x3(L,m-1);if(!a.shouldAutoClose(E,m-E.firstCharOffset))return null;const D=a.findNeutralCharacter();if(D){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,m,D);if(!a.isOK(k))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,r,o,s,a){const l=[];for(let c=0,u=r.length;cnew ls(new W(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Ga(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,o,l,!0,u):null}static typeWithInterceptors(e,t,n,r,o,s,a){if(!e&&a===` -`){const u=[];for(let d=0,h=o.length;d{const r=t.get(jn).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const r=ps();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const r=t.get(jn).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,n)):!1})}_runEditorCommand(e,t,n){const r=this.runEditorCommand(e,t,n);return r||!0}}var Ao;(function(i){class e extends br{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[qo.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=st(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=st(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends br{runCoreEditorCommand(_,y){_.model.pushStackElement();const S=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);S!==null&&(_.setCursorStates(y.source,3,S.viewStates.map(L=>$n.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=st(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,_,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const L=v.model.validatePosition(S.position),E=v.coordinatesConverter.validateViewPosition(new le(S.viewPosition.lineNumber,S.viewPosition.column),L),D=S.doColumnSelect?y.fromViewLineNumber:E.lineNumber,k=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return N0.columnSelect(v.cursorConfig,v,D,k,E.lineNumber,S.mouseColumn-1)}}),i.CursorColumnSelectLeft=st(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,_,y,S){return N0.columnSelectLeft(v.cursorConfig,v,y)}}),i.CursorColumnSelectRight=st(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,_,y,S){return N0.columnSelectRight(v.cursorConfig,v,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return N0.columnSelectUp(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectUp=st(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=st(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return N0.columnSelectDown(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectDown=st(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=st(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends br{constructor(){super({id:"cursorMove",precondition:void 0,metadata:oO.metadata})}runCoreEditorCommand(_,y){const S=oO.parse(y);S&&this._runCursorMove(_,y.source,S)}_runCursorMove(_,y,S){_.model.pushStackElement(),_.setCursorStates(y,3,o._move(_,_.getCursorStates(),S)),_.revealPrimaryCursor(y,!0)}static _move(_,y,S){const L=S.select,E=S.value;switch(S.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return qo.simpleMove(_,y,S.direction,L,E,S.unit);case 11:case 13:case 12:case 14:return qo.viewportMove(_,y,S.direction,L,E);default:return null}}}i.CursorMoveImpl=o,i.CursorMove=st(new o);class s extends br{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let S=this._staticArgs;this._staticArgs.value===-1&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,qo.simpleMove(_,_.getCursorStates(),S.direction,S.select,S.value,S.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=st(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=st(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1039}})),i.CursorRight=st(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=st(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1041}})),i.CursorUp=st(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=st(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=st(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:11}})),i.CursorPageUpSelect=st(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1035}})),i.CursorDown=st(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=st(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=st(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:12}})),i.CursorPageDownSelect=st(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1036}})),i.CreateCursor=st(new class extends br{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,_){if(!_.position)return;let y;_.wholeLine?y=qo.line(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=qo.moveTo(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition);const S=v.getCursorStates();if(S.length>1){const L=y.modelState?y.modelState.position:null,E=y.viewState?y.viewState.position:null;for(let D=0,k=S.length;DE&&(L=E);const D=new W(L,1,L,v.model.getLineMaxColumn(L));let k=0;if(y.at)switch(y.at){case Sy.RawAtArgument.Top:k=3;break;case Sy.RawAtArgument.Center:k=1;break;case Sy.RawAtArgument.Bottom:k=4;break}const T=v.coordinatesConverter.convertModelRangeToViewRange(D);v.revealRange(_.source,!1,T,k,0)}}),i.SelectAll=new class extends Mz{constructor(){super(_st)}runDOMCommand(v){lu&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,_,y){const S=_._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[qo.selectAll(v,v.getPrimaryCursorState())])}},i.SetSelection=st(new class extends br{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,_){_.selection&&(v.model.pushStackElement(),v.setCursorStates(_.source,3,[$n.fromModelSelection(_.selection)]))}})})(Ao||(Ao={}));const ght=Re.and(K.textInputFocus,K.columnSelection);function YS(i,e){sl.registerKeybindingRule({id:i,primary:e,when:ght,weight:Xn+1})}YS(Ao.CursorColumnSelectLeft.id,1039);YS(Ao.CursorColumnSelectRight.id,1041);YS(Ao.CursorColumnSelectUp.id,1040);YS(Ao.CursorColumnSelectPageUp.id,1035);YS(Ao.CursorColumnSelectDown.id,1042);YS(Ao.CursorColumnSelectPageDown.id,1036);function wle(i){return i.register(),i}var ow;(function(i){class e extends zo{runEditorCommand(n,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=st(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,sr.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection)))}}),i.Outdent=st(new class extends e{constructor(){super({id:"outdent",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:Re.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,sr.outdent(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.Tab=st(new class extends e{constructor(){super({id:"tab",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:Re.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,sr.tab(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=st(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,r){const[o,s]=zb.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=st(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,r){const[o,s]=zb.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends Mz{constructor(){super(q1e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().undo()}},i.Redo=new class extends Mz{constructor(){super(X1e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().redo()}}})(ow||(ow={}));class Sle extends w3{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){const n=e.get(jn).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)}}function SC(i,e){wle(new Sle("default:"+i,i)),wle(new Sle(i,i,e))}SC("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});SC("replacePreviousChar");SC("compositionType");SC("compositionStart");SC("compositionEnd");SC("paste");SC("cut");class pht{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ao.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=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){Ao.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ao.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Ao.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Ao.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ao.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ao.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ao.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ao.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ao.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ao.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ao.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ao.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ao.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 iwe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Zi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;let o=0,s=0;for(let l=n;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class rwe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new iwe(()=>this._host.createVisibleLine())}_createDomNode(){const e=Jn(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(144)}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 n=0,r=t.length;nt){const s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){const s=Math.max(0,n-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,n,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,n,r,o){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const r=document.createElement("div");jg._ttPolicy&&(t=jg._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;oi});jg._sb=new KS(1e5);class owe extends Wl{constructor(e){super(e),this._visibleLines=new rwe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);vs(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,r=t.length;n'),r.appendString(o),r.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class vht extends owe{constructor(e){super(e);const n=this._context.configuration.options.get(144);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._contentWidth=n.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 _ht extends owe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),vs(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;vs(this.domNode,t.get(50));const n=t.get(144);return this._contentLeft=n.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class W3{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return W3.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n={...e};return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 le(e.afterLineNumber,1)).lineNumber}}}class bht extends Wl{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Jn(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 n=this._context.configuration.options.get(144),r=n.contentWidth-n.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=n.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let n=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[n];s||(s=this.blocks[n]=Jn(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),n++}for(let o=n;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),fc){const f=h-(c-r);h-=f,n-=f}if(h=v,S=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,v),fitsBelow:S,belowTop:f,left:m}:{fitsAbove:y,aboveTop:a,fitsBelow:S,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new cL(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new xle(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&G9(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"&&G9(this._actual.afterRender,this._actual,this._renderData.position)}}class lL{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class cL{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class xle{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function G9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class swe extends wC{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Et(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 o of this._selections)t.add(o.positionLineNumber);const n=Array.from(t);n.sort((o,s)=>o-s),lr(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);const r=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let s=t;s<=n;s++){const a=s-t;r[a]=""}if(this._wordWrap){const s=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new le(a,1)).lineNumber,u=l.convertModelPositionToViewPosition(new le(c,1)).lineNumber,d=l.convertModelPositionToViewPosition(new le(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,h=Math.max(u,t),f=Math.min(d,n);for(let g=h;g<=f;g++){const p=g-t;r[p]=s}}}const o=this._renderOne(e,!0);for(const s of this._cursorLineNumbers){if(sn)continue;const a=s-t;r[a]=o}this._renderData=r}render(e,t){if(!this._renderData)return"";const n=t-e;return n>=this._renderData.length?"":this._renderData[n]}_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 wht extends swe{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Sht extends swe{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}vu((i,e)=>{const t=i.getColor(jye);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()||i.defines(_le)){const n=i.getColor(_le);n&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),sh(i.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 xht extends wC{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),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 n=[],r=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:W.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-o;n[g]+=u}}}_renderNormalDecorations(e,t,n){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Lht extends Wl{constructor(e,t,n,r){super(e);const o=this._context.configuration.options,s=o.get(103),a=o.get(75),l=o.get(40),c=o.get(106),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+Nz(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new A3(t.domNode,u,this._context.viewLayout.getScrollable())),vh.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Jn(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const m=h.scrollTop;m&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+m,h.scrollTop=0)}if(g){const m=h.scrollLeft;m&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+m,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(xe(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(xe(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(xe(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(xe(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(144);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(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(103),r=t.get(75),o=t.get(40),s=t.get(106),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(144)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Nz(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Pz{constructor(e,t,n,r,o){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Eht{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}}class Dht{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class awe extends wC{_render(e,t,n){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new Dht}if(n.length===0)return r;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamer)continue;const c=Math.max(a,n),u=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(c,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(o.preference.lane);t.push(new Tht(c,d,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,r)=>n.lineNumber===r.lineNumber?n.laneIndex===r.laneIndex?n.zIndex===r.zIndex?r.type===n.type?n.type===0&&r.type===0?n.className0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.laneIndex===r.laneIndex);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(r),n.domNode.setLeft(o),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class kht{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new Nht(this.lineNumber,this.laneIndex,e)}}class Tht{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}}class Nht{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}}class lwe extends me{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function $3(i,e){let t=0,n=0;const r=i.length;for(;nr)throw new Zi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=D=>{if(a!==-1&&(a===-2||a>D-1)){a=-1,l=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){a=k,l=T;break}}}if(c===-2){c=-1,u=-1;for(let k=D;k=0){c=k,u=T;break}}}};let h=-2,f=-1,g=-2,p=-1;const m=D=>{if(h===-2){h=-1,f=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){h=k,f=T;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=T;break}}}};let v=0,_=!0,y=0,S=!0,L=0,E=0;for(let D=0;_||S;D++){const k=e-D,T=e+D;D>1&&(k<1||k1&&(T>r||T>n)&&(S=!1),D>5e4&&(_=!1,S=!1);let M=-1;if(_&&k>=1){const N=this._computeIndentLevel(k-1);N>=0?(c=k-1,u=N,M=Math.ceil(N/this.textModel.getOptions().indentSize)):(d(k),M=this._getIndentLevelForWhitespaceLine(s,l,u))}let P=-1;if(S&&T<=r){const N=this._computeIndentLevel(T-1);N>=0?(h=T-1,f=N,P=Math.ceil(N/this.textModel.getOptions().indentSize)):(m(T),P=this._getIndentLevelForWhitespaceLine(s,f,p))}if(D===0){E=M;continue}if(D===1){if(T<=r&&P>=0&&E+1===P){_=!1,v=T,y=T,L=P;continue}if(k>=1&&M>=0&&M-1===E){S=!1,v=k,y=k,L=M;continue}if(v=e,y=e,L=E,L===0)return{startLineNumber:v,endLineNumber:y,indent:L}}_&&(M>=L?v=k:_=!1),S&&(P>=L?y=T:S=!1)}return{startLineNumber:v,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new W(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(W.fromPositions(n)).toArray()).filter(f=>W.strictContainsPosition(f.range,n));c=(o=fI(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new cwe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=r.horizontalGuides===gb.Enabled||r.horizontalGuides===gb.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&s[h.range.startLineNumber-e].push(new Z0(-1,h.openingBracketRange.getEndPosition().column,g,new VE(!1,m.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(m),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),S=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Js(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>S&&s[p.lineNumber-e].push(new Z0(S,-1,g,new VE(!1,p.column),-1,-1)),m.lineNumber<=t&&_>S&&s[m.lineNumber-e].push(new Z0(S,-1,g,new VE(!L,m.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return _o.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const m=this._computeIndentLevel(p);if(m>=0){l=p,c=m;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=m;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const r=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const S=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((o=(r=e.visibleRangeForPosition(new le(f,_.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;m+=`
`}h[g]=m}this._renderResult=h}getGuidesByLine(e,t,n){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?gb.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?gb.EnabledForActive:gb.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=r?r[d-e]:[],g=new Op(f),p=o?o[d-e]:0;for(let m=1;m<=p;m++){const v=(m-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&m===l;h.push(...g.takeWhile(S=>S.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function _1(i){if(!(i&&i.isTransparent()))return i}vu((i,e)=>{const t=[{bracketColor:qye,guideColor:Fdt,guideColorActive:zdt},{bracketColor:Xye,guideColor:Bdt,guideColorActive:Udt},{bracketColor:Yye,guideColor:Wdt,guideColorActive:jdt},{bracketColor:Zye,guideColor:$dt,guideColorActive:Kdt},{bracketColor:Qye,guideColor:Hdt,guideColorActive:Gdt},{bracketColor:Jye,guideColor:Vdt,guideColorActive:qdt}],n=new cwe,r=[{indentColor:xT,indentColorActive:LT},{indentColor:bdt,indentColorActive:xdt},{indentColor:Cdt,indentColorActive:Ldt},{indentColor:ydt,indentColorActive:Edt},{indentColor:wdt,indentColorActive:Ddt},{indentColor:Sdt,indentColorActive:Idt}],o=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=_1((l=_1(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=_1((c=_1(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(Pf),s=r.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=_1(l),d=_1(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(Pf);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${n.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.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class q9{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 Pht{constructor(){this._currentVisibleRange=new W(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Aht{constructor(e,t,n,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Oht{constructor(e,t,n,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Pht,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(115).enabled,this._maxNumberStickyLines=r.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new pf(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(145)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),r=t.get(145);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,vs(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(144)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new fle(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=n;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Aht(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Oht(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const n=this._getViewLineDomNode(e);if(n===null)return null;const r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new le(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(rs)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return an)return-1;const r=new q9(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,r=W.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new q9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(du)continue;const h=d===r.startLineNumber?r.startColumn:1,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const r=new q9(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Wut(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(),n=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(n);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),ka&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,_=o[0].endLineNumber;for(let y=1,S=o.length;yl){if(!u)return-1;m=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)m=a;else{const v=Math.max(5*this._lineHeight,l*.2),_=d-v,y=h-l;m=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)m=a;else{const v=(d+h)/2;m=Math.max(0,v-l/2)}else m=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return m}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(144),r=t.left,o=r+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-H3.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,r,o,s){e=e|0,t=t|0,n=n|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-nt)return Math.max(0,r-a)}else return n;return e}}H3.HORIZONTAL_EXTRA_PX=30;class Fht extends awe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(144);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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){var t,n;const r=e.getDecorationsInViewport(),o=[];let s=0;for(let a=0,l=r.length;a',l=[];for(let c=t;c<=n;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const f of d){let g='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class eu{constructor(e,t,n,r){this._rgba8Brand=void 0,this.r=eu._clamp(e),this.g=eu._clamp(t),this.b=eu._clamp(n),this.a=eu._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}}eu.Empty=new eu(0,0,0,0);class DT extends me{static getInstance(){return this._INSTANCE||(this._INSTANCE=new DT),this._INSTANCE}constructor(){super(),this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(gr.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=gr.getColorMap();if(!e){this._colors=[eu.Empty],this._backgroundIsLight=!0;return}this._colors=[eu.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}DT._INSTANCE=null;const Wht=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),$ht=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class DI{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=DI.soften(e,12/15),this.charDataLight=DI.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;re.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,m=$ht(r,c),v=e.width*4,_=a.r,y=a.g,S=a.b,L=o.r-_,E=o.g-y,D=o.b-S,k=Math.max(s,l),T=e.data;let M=m*h*f,P=n*v+t*4;for(let N=0;Ne.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=s.r,p=s.g,m=s.b,v=r.r-g,_=r.g-p,y=r.b-m,S=g+v*f,L=p+_*f,E=m+y*f,D=Math.max(o,a),k=e.data;let T=n*h+t*4;for(let M=0;M{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Lle[i[t]]<<4|Lle[i[t+1]]&15;return e},Dle={1:Gv(()=>Ele("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Gv(()=>Ele("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class zE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return Dle[e]?n=new DI(Dle[e](),e):n=zE.createFromSampleData(zE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold 16px ${e}`,n.textBaseline="middle";let r=0;for(const o of Wht)n.fillText(String.fromCharCode(o),r,16/2),r+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=zE._downsample(e,t);return new DI(r,t)}static _downsampleChar(e,t,n,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u0){const c=255/l;for(let u=0;uzE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=II._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=II._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(wut);return n?new eu(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Sut);return t?eu._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class UE{constructor(e,t,n,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,r,o,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let E=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(E+=Math.max(0,o-e.lineHeight-e.paddingBottom));const D=Math.max(1,Math.floor(o*o/E)),k=Math.max(0,e.minimapHeight-D),T=k/(u-o),M=c*T,P=k>0,N=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new UE(c,u,P,T,M,D,R,1,Math.min(a,N))}let m;if(s&&n!==a){const E=n-t+1;m=Math.floor(E*f/h)}else{const E=o/p;m=Math.floor(E*f/h)}const v=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const E=o/p;_=Math.max(_,E-1)}let y;if(_>0){const E=o/p;y=(v+a+_-E-1)*f/h}else y=Math.max(0,(v+a)*f/h-m);y=Math.min(e.minimapHeight-m,y);const S=y/(u-o),L=c*S;if(g>=v+a+_){const E=y>0;return new UE(c,u,E,S,L,m,v,1,a)}else{let E;t>1?E=t+v:E=Math.max(1,c/p);let D,k=Math.max(1,Math.floor(E-L*h/f));kc&&(k=Math.min(k,d.startLineNumber),D=Math.max(D,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?P=(t-k+D+M)*f/h:P=c/e.paddingTop*(D+M)*f/h,new UE(c,u,!0,S,P,m,D,k,T)}}}class sO{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}sO.INVALID=new sO(-1);class Ile{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new iwe(()=>sO.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let r=0,o=n.length;r1){for(let v=0,_=r-1;v<_;v++)m[v]=Math.round(v*o+s);m[r-1]=t}return[new kI(o,m),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let m=0;m0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,r=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,n]=kI.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of n)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,n){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Hr(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new qS,this._sliderPointerDownListener=Lr(this._slider.domNode,Je.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Li.addTarget(this._domNode.domNode),this._sliderTouchStartListener=xe(this._domNode.domNode,Ei.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=xe(this._domNode.domNode,Ei.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=Lr(this._domNode.domNode,Ei.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=Hr(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Os&&c>Hht){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 eZ(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 n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(cle),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 n=UE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(W.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new kle(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new kle(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,n,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,n,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(ym,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(ym,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==kl.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const m=r.getYForLineNumber(d,o);e.fillRect(ym,m,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,n,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,f,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,n,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case kl.Inline:this.renderDecorationOnLine(e,n,c.range,g,r,p,o,o,s,a,l);continue;case kl.Gutter:{const m=r.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,m,Vht,o);continue}}}}renderDecorationOnLine(e,t,n,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,m=g===s?n.endColumn:this._model.getLineMaxColumn(s),v=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,m,c,u,d);this.renderDecoration(e,r,v,h,_-v,a)}getXOffsetForPosition(e,t,n,r,o,s){if(n===1)return ym;if((n-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[ym];let u=ym;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((r-L)/2):0,D=h.a/255,k=new eu(Math.round((h.r-d.r)*D+d.r),Math.round((h.g-d.g)*D+d.g),Math.round((h.b-d.b)*D+d.b),255);let T=e.topPaddingLineCount*r;const M=[];for(let B=0,$=n-t+1;B<$;B++)l[B]&&aO._renderLine(o,k,h.a,p,m,y,g,f,v,T,E,u,c[B],_,r),M[B]=new sO(T),T+=r;const P=s===-1?0:s,R=(a===-1?o.height:a)-P;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,P,o.width,R),new Ile(e,o,M)}static _renderUntouchedLines(e,t,n,r,o,s){const a=[];if(!s){for(let T=0,M=r-n+1;T=0&&P_)return;const N=m.charCodeAt(L);if(N===9){const R=h-(L+E)%h;E+=R-1,S+=R*s}else if(N===32)S+=s;else{const R=Xv(N)?2:1;for(let O=0;O_)return}}}}}class kle{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;rthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Uht extends Wl{constructor(e,t){super(e),this._viewDomNode=t;const r=this._context.configuration.options.get(144);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=Jn(document.createElement("div")),vh.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Jn(document.createElement("div")),vh.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=Jn(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 n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(n===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&Ce.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 Kht extends Wl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Jn(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=gr.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[new le(1,1)]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jht(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,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=Ce.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):(d.clearRect(0,0,n,r),d.fillStyle=Ce.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):d.clearRect(0,0,n,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,m=g.data;d.fillStyle=p;let v=0,_=0,y=0;for(let S=0,L=m.length/3;Sr&&(N=r-u),T=N-u,M=N+u}T>y+1||E!==v?(S!==0&&d.fillRect(h[v],_,f[v],y-_),v=E,_=T,y=M):M>y&&(y=M)}d.fillRect(h[v],_,f[v],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,m=this._settings.x[7],v=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let S=0,L=this._cursorPositions.length;Sr&&(D=r-p);const k=D-p,T=k+g;k>y+1?(S!==0&&d.fillRect(m,_,v,y-_),_=k,y=T):T>y&&(y=T)}d.fillRect(m,_,v,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class Tle{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 uwe{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,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.colorn&&(p=n-m);const v=u.color;let _=this._color2Id[v];_||(_=++this._lastAssignedId,this._color2Id[v]=_,this._id2Color[_]=v);const y=new Tle(p-m,p+m,_);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Tle.compare),a}}class qht extends wT{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=Jn(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Ght(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(67)),this._zoneManager.setPixelRatio(n.get(142)),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(142)&&(this._zoneManager.setPixelRatio(t.get(142)),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(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,r,e),!0}_renderOneLane(e,t,n,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=n[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class Xht extends Wl{constructor(e){super(e),this.domNode=Jn(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(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),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(e0;){const a=Jn(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(144);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 n=this._context.configuration.options.get(103);return this._useShadows=n.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 Zht{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Qht{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Jht(i){return new Zht(i)}function eft(i){return new Qht(i.lineNumber,i.ranges.map(Jht))}class Tr extends wC{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._roundedSelection=t.get(101),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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;i2(u-g)g&&(h.top=1),i2(d-p)'}_actualRenderOneSelection(e,t,n,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Tr.SELECTION_CLASS_NAME="selected-text";Tr.SELECTION_TOP_LEFT="top-left-radius";Tr.SELECTION_BOTTOM_LEFT="bottom-left-radius";Tr.SELECTION_TOP_RIGHT="top-right-radius";Tr.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Tr.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Tr.ROUNDED_PIECE_WIDTH=10;vu((i,e)=>{const t=i.getColor(Nct);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function i2(i){return i<0?-i:i}class Nle{constructor(e,t,n,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class Rle{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Jn(document.createElement("div")),this._domNode.setClassName(`cursor ${iw}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),vs(this._domNode,n),this._domNode.setDisplay("none"),this._position=new le(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),vs(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[r,o]=prt(n,t-1);return[new le(e,r+1),n.substring(r,o)]}_prepareRender(e){let t="",n="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Jo.Line||this._cursorStyle===Jo.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;const f=Bt(this._domNode.domNode);let g;this._cursorStyle===Jo.Line?(g=nae(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,n=this._getTokenClassName(r))):g=nae(f,1);let p=h.left,m=0;g>=2&&p>=1&&(m=1,p-=m);const v=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new Nle(v,p,m,g,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new W(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Jo.Block&&(t=o,n=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Jo.Underline||this._cursorStyle===Jo.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new Nle(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${iw} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class TI extends Wl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),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 Rle(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Jn(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 gd,this._cursorFlatBlinkInterval=new CY,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(91),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 n=0,r=this._secondaryCursors.length;nt.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s{for(let r=0,o=e.ranges.length;r{this._isVisible?this._hide():this._show()},TI.BLINK_INTERVAL,Bt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},TI.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Jo.Line:e+=" cursor-line-style";break;case Jo.Block:e+=" cursor-block-style";break;case Jo.Underline:e+=" cursor-underline-style";break;case Jo.LineThin:e+=" cursor-line-thin-style";break;case Jo.BlockOutline:e+=" cursor-block-outline-style";break;case Jo.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{const t=i.getColor(Kye);if(t){let n=i.getColor(vdt);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),sh(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const X9=()=>{throw new Error("Invalid change accessor")};class tft extends Wl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=Jn(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=Jn(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 n=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s{const r={addZone:o=>(t=!0,this._addZone(n,o)),removeZone:o=>{o&&(t=this._removeZone(n,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(n,o)||t)}};nft(e,r),r.addZone=X9,r.removeZone=X9,r.layoutZone=X9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:Jn(t.domNode),marginDomNode:t.marginDomNode?Jn(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.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(n){nn(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){nn(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=M.endOffset&&(T++,M=n&&n[T]),R!==9&&R!==32||h&&!E&&N<=k)continue;if(d&&N>=D&&N<=k&&R===32){const B=N-1>=0?a.charCodeAt(N-1):0,$=N+1=0?a.charCodeAt(N-1):0;if(R===32&&B!==32&&B!==9)continue}if(n&&(!M||M.startOffset>N||M.endOffset<=N))continue;const O=e.visibleRangeForPosition(new le(t,N+1));O&&(s?(P=Math.max(P,O.left),R===9?L+=this._renderArrow(f,m,O.left):L+=``):R===9?L+=`
${S?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(P=Math.round(P+m),``+L+""):L}_renderArrow(e,t,n){const r=t/7,o=t,s=e/2,a=n,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},m={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Mle{constructor(e){const t=e.options,n=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}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 rft{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new W(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 oft{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 sft{constructor(e,t,n){this.configuration=e,this.theme=new oft(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var aft=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lft=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Az=class extends wT{constructor(e,t,n,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Et(1,1,1,1)],this._renderAnimationFrame=null;const l=new pht(t,r,o,e);this._context=new sft(t,n,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Rz,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Jn(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Jn(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Jn(document.createElement("div")),vh.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Lht(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new H3(this._context,this._linesContent),this._viewZones=new tft(this._context),this._viewParts.push(this._viewZones);const c=new Kht(this._context);this._viewParts.push(c);const u=new Yht(this._context);this._viewParts.push(u);const d=new vht(this._context);this._viewParts.push(d),d.addDynamicOverlay(new wht(this._context)),d.addDynamicOverlay(new Tr(this._context)),d.addDynamicOverlay(new Mht(this._context)),d.addDynamicOverlay(new xht(this._context)),d.addDynamicOverlay(new ift(this._context));const h=new _ht(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Sht(this._context)),h.addDynamicOverlay(new Bht(this._context)),h.addDynamicOverlay(new Fht(this._context)),h.addDynamicOverlay(new ET(this._context)),this._glyphMarginWidgets=new Iht(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Vb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Cht(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new TI(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Uht(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new Xht(this._context);this._viewParts.push(g);const p=new bht(this._context);this._viewParts.push(p);const m=new zht(this._context);if(this._viewParts.push(m),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(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?(s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),s.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new gdt(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],r=0;n=n.concat(e.getAllMarginDecorations().map(o=>{var s,a,l;const c=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:Uf.Center;return r=Math.max(r,o.range.endLineNumber),{range:o.range,lane:c,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const s=e.validateRange(o.preference.range);return r=Math.max(r,s.endLineNumber),{range:s,lane:o.preference.lane}})),n.sort((o,s)=>W.compareRangesUsingStarts(o.range,s.range)),t.reset(r);for(const o of n)t.push(o.lane,o.range,o.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 Uut(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 le(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(144);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(141)+" "+Nz(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(){if(this._store.isDisposed)throw new Zi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Oz.INSTANCE.scheduleCoordinatedRendering({window:Bt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Zi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Zi;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new Zi;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new Zi;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();nv(()=>e.prepareRenderText());const t=nv(()=>e.renderText());if(t){const[n,r]=t;nv(()=>e.prepareRender(n,r)),nv(()=>e.render(n,r))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Jm.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 n=new rft(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new Fut(this._context.viewLayout,n,this._viewLines)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.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 n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new le(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?W3.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new qht(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.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,n,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};Az=aft([lft(6,Wt)],Az);function nv(i){try{return i()}catch(e){return nn(e),null}}class Oz{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[n,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,HA(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)nv(()=>n.prepareRenderText());const t=[];for(let n=0,r=e.length;no.renderText())}for(let n=0,r=e.length;no.prepareRender(a,l))}for(let n=0,r=e.length;no.render(a,l))}}}Oz.INSTANCE=new Oz;class jE{constructor(e,t,n,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=r,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)r0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)n=o+1;else break;else if(e=l)n=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new r2(o,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,n);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new r2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const r=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Ple(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let r=n.offsetInInputWithInjections;if(Ale(this.injectionOptions[n.injectedTextIndex].cursorStops))return r;let o=n.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[n.injectedTextIndex]&&!(Ple(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,Ale(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=n.offsetInInputWithInjections+n.length,o=n.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}y3()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(n);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let r=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function Ple(i){return i==null?!0:i===qu.Right||i===qu.Both}function Ale(i){return i==null?!0:i===qu.Left||i===qu.Both}class r2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new le(e+this.outputLineIndex,this.outputOffset+1)}}class cft{constructor(){this.changeType=1}}class _h{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",r=0;for(const o of t)n+=e.substring(r,o.column-1),r=o.column-1,n+=o.options.content;return n+=e.substring(r),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new _h(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new _h(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,r)=>n.lineNumber===r.lineNumber?n.column===r.column?n.order-r.order:n.column-r.column:n.lineNumber-r.lineNumber),t}constructor(e,t,n,r,o){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=r,this.order=o}}class Ole{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class uft{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class dft{constructor(e,t,n,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class hft{constructor(){this.changeType=5}}class sw{constructor(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;ti});class tZ{static create(e){return new tZ(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>fft(Ym(this.targetWindow.deref()),s,e,t,n,r,o,a)}}}function fft(i,e,t,n,r,o,s,a){var l;function c(M){const P=a[M];if(P){const N=_h.applyInjectedText(e[M],P),R=P.map(B=>B.options),O=P.map(B=>B.column-1);return new jE(O,R,[N.length],[],0)}else return null}if(r===-1){const M=[];for(let P=0,N=e.length;Pu?(N=0,R=0):O=u-G}const B=P.substr(N),$=gft(B,R,n,O,p,f);m[M]=N,v[M]=R,_[M]=B,y[M]=$[0],S[M]=$[1]}const L=p.build(),E=(l=Y9==null?void 0:Y9.createHTML(L))!==null&&l!==void 0?l:L;g.innerHTML=E,g.style.position="absolute",g.style.top="10000",s==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),i.document.body.appendChild(g);const D=document.createRange(),k=Array.prototype.slice.call(g.children,0),T=[];for(let M=0;Mie.options),U=j.map(ie=>ie.column-1)):(G=null,U=null),T[M]=new jE(U,G,N,$,O)}return i.document.body.removeChild(g),T}function gft(i,e,t,n,r,o){if(o!==0){const h=String(o);r.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,r.appendString("
"),[c,u]}function pft(i,e,t,n){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{Fz(i,r,n,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function Fz(i,e,t,n,r,o,s,a){if(n===o||(r=r||Z9(i,e,t[n],t[n+1]),s=s||Z9(i,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(n+1===o){a.push(o);return}const l=n+(o-n)/2|0,c=Z9(i,e,t[l],t[l+1]);Fz(i,e,t,n,r,l,c,a),Fz(i,e,t,l,c,o,s,a)}function Z9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class mft extends me{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new nY),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,n){this._editor=e,this._instantiationService=n;for(const r of t){if(this._pending.has(r.id)){nn(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return HL(Bt((e=this._editor)===null||e===void 0?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 n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){nn(n)}}}}class hwe{constructor(e,t,n,r,o,s,a){this.id=e,this.label=t,this.alias=n,this.metadata=r,this._precondition=o,this._run=s,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function n_(i){let e=0,t=0,n=0,r=0;for(let o=0,s=i.length;o=dc&&(t=t-i%dc),t}function yft(i,e){return i.reduce((t,n)=>mr(t,e(n)),Sa)}function fwe(i,e){return i===e}function RI(i,e){const t=i,n=e;if(n-t<=0)return Sa;const o=Math.floor(t/dc),s=Math.floor(n/dc),a=n-s*dc;if(o===s){const l=t-o*dc;return $r(0,a-l)}else return $r(s-o,a)}function aw(i,e){return i=e}function xy(i){return $r(i.lineNumber-1,i.column-1)}function mb(i,e){const t=i,n=Math.floor(t/dc),r=t-n*dc,o=e,s=Math.floor(o/dc),a=o-s*dc;return new W(n+1,r+1,s+1,a+1)}function wft(i){const e=ng(i);return $r(e.length-1,e[e.length-1].length)}class dp{static fromModelContentChanges(e){return e.map(n=>{const r=W.lift(n.range);return new dp(xy(r.getStartPosition()),xy(r.getEndPosition()),wft(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${ru(this.startOffset)}...${ru(this.endOffset)}) -> ${ru(this.newLength)}`}}class Sft{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>nZ.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:RI(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?$r(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):$r(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=ru(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?$r(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):$r(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(r===0){const s=1<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 n=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const r=bft(e,t,this.lineIdx,this.lineCharOffset);return new Vm(r,0,-1,ao.getEmpty(),new R0(r))}}class kft{constructor(e,t){this.text=e,this._offset=Sa,this.idx=0;const n=t.getRegExpStr(),r=n?new RegExp(n+`| -`,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new Vm($r(0,g),0,-1,ao.getEmpty(),new R0($r(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Vm($r(1,g),0,-1,ao.getEmpty(),new R0($r(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,p=s[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let m;if(u===a){const v=g-c;if(vTft(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Tft(i){let e=vc(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class mwe{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=oZ.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Nft(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?vwe(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),r=t();if(!r)return n;for(let s=t();s;s=t())Wle(n,r)<=Wle(r,s)?(n=Q9(n,r),r=s):r=Q9(r,s);return Q9(n,r)}function vwe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let r=0;r=3?i[2]:null,e)}function Wle(i,e){return Math.abs(i.listHeight-e.listHeight)}function Q9(i,e){return i.listHeight===e.listHeight?Kf.create23(i,e,null,!1):i.listHeight>e.listHeight?Rft(i,e):Mft(e,i)}function Rft(i,e){i=i.toMutable();let t=i;const n=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Kf.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Kf.create23(i,r,null,!1):i}function Mft(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Kf.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Kf.create23(r,i,null,!1):i}class Pft{constructor(e){this.lastOffset=Sa,this.nextNodes=[e],this.offsets=[Sa],this.idxs=[]}readLongestNodeAt(e,t){if(aw(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=uL(this.nextNodes);if(!n)return;const r=uL(this.offsets);if(aw(e,r))return;if(aw(r,e))if(mr(r,n.length)<=e)this.nextNodeAfterCurrent();else{const o=J9(n);o!==-1?(this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const o=J9(n);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=uL(this.offsets),t=uL(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=uL(this.nextNodes),r=J9(n,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(n.getChild(r)),this.offsets.push(mr(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function J9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function uL(i){return i.length>0?i[i.length-1]:void 0}function Bz(i,e,t,n){return new Aft(i,e,t,n).parseDocument()}class Aft{constructor(e,t,n,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,n&&r)throw new Error("Not supported");this.oldNodeReader=n?new Pft(n):void 0,this.positionMapper=new Sft(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ao.getEmpty(),0);return e||(e=Kf.getEmpty()),e}parseList(e,t){const n=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||n.push(o)}return this.oldNodeReader?Nft(n):vwe(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!lO(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!aw(r.length,t)?!1:r.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new Dft(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new R0(n.length);const r=e.merge(n.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),MI.create(n.astNode,o,s.astNode)):MI.create(n.astNode,o,null)}default:throw new Error("unexpected")}}}function dO(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new Op($le(i)),n=$le(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!lO(c);){const[d,h]=r.splitAt(c);u.push(d),c=RI(d.lengthAfter,c),r=h??t.dequeue()}return lO(c)||u.push(new iv(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&fwe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new dp(h.startOffset,u,mr(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=Sa;for(const c of n){const u=o(c.lengthBefore);if(c.modified){const d=yft(u,f=>f.lengthBefore),h=mr(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=mr(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class iv{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=RI(e,this.lengthAfter);return fwe(t,Sa)?[this,void 0]:this.modified?[new iv(this.modified,this.lengthBefore,e),new iv(this.modified,Sa,t)]:[new iv(this.modified,e,e),new iv(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${ru(this.lengthBefore)} -> ${ru(this.lengthAfter)}`}}function $le(i){const e=[];let t=Sa;for(const n of i){const r=RI(t,n.startOffset);lO(r)||e.push(new iv(!1,r,r));const o=RI(n.startOffset,n.endOffset);e.push(new iv(!0,o,n.newLength)),t=n.endOffset}return e}class Oft extends me{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new ae,this.denseKeyProvider=new gwe,this.brackets=new mwe(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 n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new kft(this.textModel.getValue(),n);this.initialAstWithoutTokens=Bz(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(n=>new dp($r(n.fromLineNumber-1,0),$r(n.toLineNumber,0),$r(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=dp.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=dO(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=dO(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,n){const r=t,o=new pwe(this.textModel,this.brackets);return Bz(o,e,r,n)}getBracketsInRange(e,t){this.flushQueue();const n=$r(e.startLineNumber-1,e.startColumn-1),r=$r(e.endLineNumber-1,e.endColumn-1);return new Mf(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;Wz(s,Sa,s.length,n,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=xy(e.getStartPosition()),r=xy(e.getEndPosition());return new Mf(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Fft(o,t,this.textModel);$z(s,Sa,s.length,n,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return bwe(t,Sa,t.length,xy(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return _we(t,Sa,t.length,xy(e))}}function _we(i,e,t,n){if(i.kind===4||i.kind===2){const r=[];for(const o of i.children)t=mr(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(aw(s,n)){const l=_we(i.children[o],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=mb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function bwe(i,e,t,n){if(i.kind===4||i.kind===2){for(const r of i.children){if(t=mr(e,r.length),aw(n,t)){const o=bwe(r,e,t,n);if(o)return o}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=mb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function Wz(i,e,t,n,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=mr(e,i.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=i.computeMinIndentation(e,o.textModel)),c=o.push(new _ft(mb(e,t),mb(e,d),i.closingBracket?mb(mr(d,((l=i.child)===null||l===void 0?void 0:l.length)||Sa),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=mr(e,f.length),lw(e,r)&&QL(t,n)&&(c=$z(f,e,t,n,r,o,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=mr(u,d.length),lw(h,r)&&lw(n,u)&&(c=$z(d,h,u,n,r,o,s,a),!c))return!1}}return c}class Bft extends me{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Vo),this.onDidChangeEmitter=new ae,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var r;(!n.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(n.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Fe;this.bracketPairsTree.value=Wft(e.add(new Oft(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Mf.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Mf.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||Mf.empty}findMatchingBracketUp(e,t,n){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(W.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?o2(this._findMatchingBracketUp(l,r,e7(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(W.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(nu(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,W.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=e7(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(Xh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=r+1;c=l)break;if(Xh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,r=this.textModel.tokenization.getLineTokens(n),o=this.textModel.getLineContent(n),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!Xh(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=Ou.findNextBracketInRange(a.forwardRegex,n,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Bg)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!Xh(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=Ou.findPrevBracketInRange(c.reversedRegex,n,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Bg?null:g}}}return null}_matchFoundBracket(e,t,n,r){if(!t)return null;const o=n?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof Bg?o:[e,o]:null}_findMatchingBracketUp(e,t,n){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return Bg.INSTANCE;const f=Ou.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let m=!0;for(;f>=0;f--){const v=u.getLanguageId(f)===r&&!Xh(u.getStandardTokenType(f));if(v)m?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(m&&g!==p){const _=l(c,h,g,p);if(_)return _}m=v}if(m&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,n){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return Bg.INSTANCE;const g=Ou.findNextBracketInRange(o,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,m=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);r!==p&&(r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(r!==p){if(o&&s&&g&&h!==f){const v=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(v)return this._toFoundBracket(s,v);g=!1}r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const m=!!o&&!Xh(l.getStandardTokenType(d));if(m)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const v=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(v)return this._toFoundBracket(s,v)}g=m}if(s&&o&&g&&h!==f){const p=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=n.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const m=c.getLanguageId(h);o!==m&&(o=m,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=e7(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let m=0,v=g?g.brackets.length:0;m{for(;;){if(r&&++c%100===0&&!r())return Bg.INSTANCE;const _=Ou.findNextBracketInRange(f.forwardRegex,g,p,m,v);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),S=f.textIsBracket[y];if(S&&(S.isOpen(y)?a[S.index]++:S.isClose(y)&&a[S.index]--,a[S.index]===-1))return this._matchFoundBracket(_,S,!1,r);m=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),m=this.textModel.getLineContent(f);let v=0,_=0,y=0;if(f===n.lineNumber){v=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(v);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let S=!0;for(;ve==null?void 0:e.dispose()}}function e7(i){if(typeof i>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class Bg{constructor(){this._searchCanceledBrand=void 0}}Bg.INSTANCE=new Bg;function o2(i){return i instanceof Bg?null:i}class $ft extends me{constructor(e){super(),this.textModel=e,this.colorProvider=new Cwe,this.onDidChangeEmitter=new ae,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,n,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new W(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Cwe{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}`}}vu((i,e)=>{const t=[qye,Xye,Yye,Zye,Qye,Jye],n=new Cwe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Odt)}; }`);const r=t.map(o=>i.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function s2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class cs{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,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${s2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${s2(this.oldText)}")`:`(replace@${this.oldPosition} "${s2(this.oldText)}" with "${s2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const r=t.length;Pd(e,r,n),n+=4;for(let o=0;oi.length)return!1;if(t){if(!cY(i,e))return!1;if(e.length===i.length)return!0;let o=e.length;return e.charAt(e.length-1)===n&&o--,i.charAt(o)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function wwe(i){return i>=65&&i<=90||i>=97&&i<=122}function zft(i,e=Os){return e?wwe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function Yh(i){return RA(i,!0)}class Uft{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:sI(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===cn.file)return Hz(Yh(e),Yh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(zle(e.authority,t.authority))return Hz(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ft.joinPath(e,...t)}basenameOrAuthority(e){return uu(e)||e.authority}basename(e){return lo.basename(e.path)}extname(e){return lo.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===cn.file?t=Ft.file(QCe(Yh(e))).path:(t=lo.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===cn.file?t=Ft.file(ZCe(Yh(e))).path:t=lo.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!zle(e.authority,t.authority))return;if(e.scheme===cn.file){const o=Vit(Yh(e),Yh(t));return Os?ywe(o):o}let n=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(n.length,r.length);oHle(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ih){return Ule(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ih){let n=!1;if(e.scheme===cn.file){const r=Yh(e);n=r!==void 0&&r.length===Hle(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!Ule(e,t)?e.with({path:e.path+"/"}):e}}const Gi=new Uft(()=>!1),sZ=Gi.isEqual.bind(Gi);Gi.isEqualOrParent.bind(Gi);Gi.getComparisonKey.bind(Gi);const jft=Gi.basenameOrAuthority.bind(Gi),uu=Gi.basename.bind(Gi),Kft=Gi.extname.bind(Gi),V3=Gi.dirname.bind(Gi),Gft=Gi.joinPath.bind(Gi),qft=Gi.normalizePath.bind(Gi),Xft=Gi.relativePath.bind(Gi),Vle=Gi.resolvePath.bind(Gi);Gi.isAbsolutePath.bind(Gi);const zle=Gi.isEqualAuthority.bind(Gi),Ule=Gi.hasTrailingPathSeparator.bind(Gi);Gi.removeTrailingPathSeparator.bind(Gi);Gi.addTrailingPathSeparator.bind(Gi);var i_;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&n.set(i.META_DATA_MIME,o),n}i.parseMetaData=e})(i_||(i_={}));function b1(i){return i.toString()}class Oo{static create(e,t){const n=e.getAlternativeVersionId(),r=Vz(e);return new Oo(n,n,r,r,t,t,[])}constructor(e,t,n,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,n,r,o){t.length>0&&(this.changes=Hft(this.changes,t)),this.afterEOL=n,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(Pd(e,t?t.length:0,n),n+=4,t)for(const r of t)Pd(e,r.selectionStartLineNumber,n),n+=4,Pd(e,r.selectionStartColumn,n),n+=4,Pd(e,r.positionLineNumber,n),n+=4,Pd(e,r.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const r=Md(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(Ft.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 Oo}append(e,t,n,r,o){this._data instanceof Oo&&this._data.append(e,t,n,r,o)}close(){this._data instanceof Oo&&(this._data=this._data.serialize())}open(){this._data instanceof Oo||(this._data=Oo.deserialize(this._data))}undo(){if(Ft.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Oo&&(this._data=this._data.serialize());const e=Oo.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ft.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Oo&&(this._data=this._data.serialize());const e=Oo.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Oo&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Yft{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=b1(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=b1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=b1(Ft.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=b1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,r,o){const s=b1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,r,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=b1(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(`${uu(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Vz(i){return i.getEOL()===` -`?0:1}function Wg(i){return i?i instanceof Swe||i instanceof Yft:!1}class aZ{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Wg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Wg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(Wg(n)&&n.canAppend(this._model))return n;const r=new Swe(w("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,[],Vz(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=aZ._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),Vz(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return nn(n),null}}}class Zft{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Qft(i,e,t,n,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-10?r++:S>1&&o++,Qft(s,a,m,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const E=d.spacesDiff;E<=c&&u[E]++,s=m,a=y}let h=t;r!==o&&(h=r{const m=u[p];m>g&&(g=m,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function qa(i){return(i.metadata&1)>>>0}function Vi(i,e){i.metadata=i.metadata&254|e<<0}function _s(i){return(i.metadata&2)>>>1===1}function Ai(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function xwe(i){return(i.metadata&4)>>>2===1}function Kle(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Lwe(i){return(i.metadata&64)>>>6===1}function Gle(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Jft(i){return(i.metadata&24)>>>3}function qle(i,e){i.metadata=i.metadata&231|e<<3}function egt(i){return(i.metadata&32)>>>5===1}function Xle(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class Ewe{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Vi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,Kle(this,!1),Gle(this,!1),qle(this,1),Xle(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Ai(this,!1)}reset(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r}setOptions(e){this.options=e;const t=this.options.className;Kle(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),Gle(this,this.options.glyphMarginClassName!==null),qle(this,this.options.stickiness),Xle(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Cn=new Ewe(null,0,0);Cn.parent=Cn;Cn.left=Cn;Cn.right=Cn;Vi(Cn,0);class t7{constructor(){this.root=Cn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,r,o,s){return this.root===Cn?[]:lgt(this,e,t,n,r,o,s)}search(e,t,n,r){return this.root===Cn?[]:agt(this,e,t,n,r)}collectNodesFromOwner(e){return ogt(this,e)}collectNodesPostOrder(){return sgt(this)}insert(e){Yle(this,e),this._normalizeDeltaIfNecessary()}delete(e){Zle(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=n.start+r,s=n.end+r;n.setCachedOffsets(o,s,t)}acceptReplace(e,t,n,r){const o=igt(this,e,e+t);for(let s=0,a=o.length;st||n===1?!1:n===2?!0:e}function ngt(i,e,t,n,r){const o=Jft(i),s=o===0||o===2,a=o===1||o===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&egt(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const m=r?1:l>0?2:0;!h&&C1(d,s,e,m)&&(h=!0),!g&&C1(f,a,e,m)&&(g=!0)}if(u>0&&!r){const m=l>c?2:0;!h&&C1(d,s,e+u,m)&&(h=!0),!g&&C1(f,a,e+u,m)&&(g=!0)}{const m=r?1:0;!h&&C1(d,s,t,m)&&(i.start=e+c,h=!0),!g&&C1(f,a,t,m)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function igt(i,e,t){let n=i.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;n!==Cn;){if(_s(n)){Ai(n.left,!1),Ai(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),n=n.parent;continue}if(!_s(n.left)){if(o=r+n.maxEnd,ot){Ai(n,!0);continue}if(a=r+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Ai(n,!0),n.right!==Cn&&!_s(n.right)){r+=n.delta,n=n.right;continue}}return Ai(i.root,!1),l}function rgt(i,e,t,n){let r=i.root,o=0,s=0,a=0;const l=n-(t-e);for(;r!==Cn;){if(_s(r)){Ai(r.left,!1),Ai(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),r_(r),r=r.parent;continue}if(!_s(r.left)){if(s=o+r.maxEnd,st){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(i.requestNormalizeDelta=!0),Ai(r,!0);continue}if(Ai(r,!0),r.right!==Cn&&!_s(r.right)){o+=r.delta,r=r.right;continue}}Ai(i.root,!1)}function ogt(i,e){let t=i.root;const n=[];let r=0;for(;t!==Cn;){if(_s(t)){Ai(t.left,!1),Ai(t.right,!1),t=t.parent;continue}if(t.left!==Cn&&!_s(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[r++]=t),Ai(t,!0),t.right!==Cn&&!_s(t.right)){t=t.right;continue}}return Ai(i.root,!1),n}function sgt(i){let e=i.root;const t=[];let n=0;for(;e!==Cn;){if(_s(e)){Ai(e.left,!1),Ai(e.right,!1),e=e.parent;continue}if(e.left!==Cn&&!_s(e.left)){e=e.left;continue}if(e.right!==Cn&&!_s(e.right)){e=e.right;continue}t[n++]=e,Ai(e,!0)}return Ai(i.root,!1),t}function agt(i,e,t,n,r){let o=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==Cn;){if(_s(o)){Ai(o.left,!1),Ai(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==Cn&&!_s(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,n);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&xwe(o)&&(d=!1),r&&!Lwe(o)&&(d=!1),d&&(c[u++]=o),Ai(o,!0),o.right!==Cn&&!_s(o.right)){s+=o.delta,o=o.right;continue}}return Ai(i.root,!1),c}function lgt(i,e,t,n,r,o,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==Cn;){if(_s(a)){Ai(a.left,!1),Ai(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!_s(a.left)){if(c=l+a.maxEnd,ct){Ai(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),r&&xwe(a)&&(g=!1),s&&!Lwe(a)&&(g=!1),g&&(h[f++]=a)}if(Ai(a,!0),a.right!==Cn&&!_s(a.right)){l+=a.delta,a=a.right;continue}}return Ai(i.root,!1),h}function Yle(i,e){if(i.root===Cn)return e.parent=Cn,e.left=Cn,e.right=Cn,Vi(e,0),i.root=e,i.root;cgt(i,e),Em(e.parent);let t=e;for(;t!==i.root&&qa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;qa(n)===1?(Vi(t.parent,0),Vi(n,0),Vi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,KE(i,t)),Vi(t.parent,0),Vi(t.parent.parent,1),GE(i,t.parent.parent))}else{const n=t.parent.parent.left;qa(n)===1?(Vi(t.parent,0),Vi(n,0),Vi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,GE(i,t)),Vi(t.parent,0),Vi(t.parent.parent,1),KE(i,t.parent.parent))}return Vi(i.root,0),e}function cgt(i,e){let t=0,n=i.root;const r=e.start,o=e.end;for(;;)if(dgt(r,o,n.start+t,n.end+t)<0)if(n.left===Cn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===Cn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=Cn,e.right=Cn,Vi(e,1)}function Zle(i,e){let t,n;if(e.left===Cn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Cn?(t=e.left,n=e):(n=ugt(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Vi(t,0),e.detach(),n7(),r_(t),i.root.parent=Cn;return}const r=qa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Vi(n,qa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Cn&&(n.left.parent=n),n.right!==Cn&&(n.right.parent=n)),e.detach(),r){Em(t.parent),n!==e&&(Em(n),Em(n.parent)),n7();return}Em(t),Em(t.parent),n!==e&&(Em(n),Em(n.parent));let o;for(;t!==i.root&&qa(t)===0;)t===t.parent.left?(o=t.parent.right,qa(o)===1&&(Vi(o,0),Vi(t.parent,1),KE(i,t.parent),o=t.parent.right),qa(o.left)===0&&qa(o.right)===0?(Vi(o,1),t=t.parent):(qa(o.right)===0&&(Vi(o.left,0),Vi(o,1),GE(i,o),o=t.parent.right),Vi(o,qa(t.parent)),Vi(t.parent,0),Vi(o.right,0),KE(i,t.parent),t=i.root)):(o=t.parent.left,qa(o)===1&&(Vi(o,0),Vi(t.parent,1),GE(i,t.parent),o=t.parent.left),qa(o.left)===0&&qa(o.right)===0?(Vi(o,1),t=t.parent):(qa(o.left)===0&&(Vi(o.right,0),Vi(o,1),KE(i,o),o=t.parent.left),Vi(o,qa(t.parent)),Vi(t.parent,0),Vi(o.left,0),GE(i,t.parent),t=i.root));Vi(t,0),n7()}function ugt(i){for(;i.left!==Cn;)i=i.left;return i}function n7(){Cn.parent=Cn,Cn.delta=0,Cn.start=0,Cn.end=0}function KE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Cn&&(t.left.parent=e),t.parent=e.parent,e.parent===Cn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,r_(e),r_(t)}function GE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Cn&&(t.right.parent=e),t.parent=e.parent,e.parent===Cn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,r_(e),r_(t)}function Dwe(i){let e=i.end;if(i.left!==Cn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==Cn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function r_(i){i.maxEnd=Dwe(i)}function Em(i){for(;i!==Cn;){const e=Dwe(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function dgt(i,e,t,n){return i===t?e-n:i-t}class zz{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!==on)return lZ(this.right);let e=this;for(;e.parent!==on&&e.parent.left!==e;)e=e.parent;return e.parent===on?on:e.parent}prev(){if(this.left!==on)return Iwe(this.left);let e=this;for(;e.parent!==on&&e.parent.right!==e;)e=e.parent;return e.parent===on?on:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const on=new zz(null,0);on.parent=on;on.left=on;on.right=on;on.color=0;function lZ(i){for(;i.left!==on;)i=i.left;return i}function Iwe(i){for(;i.right!==on;)i=i.right;return i}function cZ(i){return i===on?0:i.size_left+i.piece.length+cZ(i.right)}function uZ(i){return i===on?0:i.lf_left+i.piece.lineFeedCnt+uZ(i.right)}function i7(){on.parent=on}function qE(i,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!==on&&(t.left.parent=e),t.parent=e.parent,e.parent===on?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function XE(i,e){const t=e.left;e.left=t.right,t.right!==on&&(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===on?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function a2(i,e){let t,n;if(e.left===on?(n=e,t=n.right):e.right===on?(n=e,t=n.left):(n=lZ(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),i7(),i.root.parent=on;return}const r=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,JL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,JL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==on&&(n.left.parent=n),n.right!==on&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,JL(i,n)),e.detach(),t.parent.left===t){const s=cZ(t),a=uZ(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,Ig(i,t.parent,l,c)}}if(JL(i,t.parent),r){i7();return}let o;for(;t!==i.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,qE(i,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,XE(i,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,qE(i,t.parent),t=i.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,XE(i,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,qE(i,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,XE(i,t.parent),t=i.root));t.color=0,i7()}function Qle(i,e){for(JL(i,e);e!==i.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,qE(i,e)),e.parent.color=0,e.parent.parent.color=1,XE(i,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,XE(i,e)),e.parent.color=0,e.parent.parent.color=1,qE(i,e.parent.parent))}i.root.color=0}function Ig(i,e,t,n){for(;e!==i.root&&e!==on;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function JL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=cZ(e.left)-e.size_left,n=uZ(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const yg=65535;function kwe(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class hgt{constructor(e,t,n,r,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=o}}function Rg(i,e=!0){const t=[0];let n=1;for(let r=0,o=i.length;r126)&&(s=!1)}const a=new hgt(kwe(i),n,r,o,s);return i.length=0,a}class _l{constructor(e,t,n,r,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=o}}class M0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class ggt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==on&&e.iterate(e.root,n=>(n!==on&&this._pieces.push(n.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 pgt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let r=0;r=e){n[r]=null,t=!0;continue}}if(t){const r=[];for(const o of n)o!==null&&r.push(o);this._cache=r}}}class mgt{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new M0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=on,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Rg(e[o].buffer));const a=new _l(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),r=this.rbInsertRight(r,a)}this._searchCache=new pgt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=yg,n=t-Math.floor(t/3),r=n*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new M0(l,Rg(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 ggt(this,e)}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==on;)if(r.left!==on&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const r=e;for(;t!==on;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(n+1,1),a=r-s;return new le(n+1,a+1)}return new le(n+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===on){const o=this.getOffsetAt(n+1,1),s=r-e-o;return new le(n+1,s+1)}else t=t.right;return new le(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const r=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=r.substring(o+e.remainder,o+n.piece.length);for(n=n.next();n!==on;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",r=!1;return this.iterate(this.root,o=>{if(o===on)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fS+g,t.reset(0)):(_=h.buffer,y=S=>S,t.reset(g));do if(m=t.next(_),m){if(y(m.index)>=p)return u;this.positionInBuffer(e,y(m.index)-f,v);const S=this.getLineFeedCnt(e.piece.bufferIndex,o,v),L=v.line===o.line?v.column-o.column+r:v.column+1,E=L+m[0].length;if(d[u++]=D0(new W(n+S,L,n+S,E),m,l),y(m.index)+m[0].length>=p||u>=c)return u}while(m);return u}findMatchesLineByLine(e,t,n,r){const o=[];let s=0;const a=new gy(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,n,r,s,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=v[u.line+p],S=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,S,u,this.positionInBuffer(f,y-_),t,n,r,s,o),s>=r)return o;h+=p}const m=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(m,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,m,s,o,n,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(m),h,m,s,o,n,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,m=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,p,s,o,n,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,r,s,o),o}_findMatchesInLine(e,t,n,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||kY(u,n,g,p,f))&&(a[s++]=new hI(new W(r,p+1+o,r,p+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=D0(new W(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==on){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new _l(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const p={line:d.start.line+1,column:0};d=new _l(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` +`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return ar._typeCommand(r,` +`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let r=0,o=n.length;rar.shiftIndent(e,a),unshiftIndent:a=>ar.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?ar._typeCommand(new W(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+r,!1):ar._typeCommand(new W(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,n,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,m=r.length;pt.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new W(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let o=null;for(const s of r)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,n,r,o){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-r.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new le(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(Lm(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:m,afterColumn:v}=g,_=t.getLineContent(p),y=_.substring(0,m-1),S=_.substring(v-1);if(S.startsWith(h)||(f=!1),S.length>0){const k=S.charAt(0);if(!ar._isBeforeClosingBrace(e,S)&&!c(k))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const k=cu(e.wordSeparators);if(y.length>0){const T=y.charCodeAt(y.length-1);if(k.get(T)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),E=x3(L,m-1);if(!a.shouldAutoClose(E,m-E.firstCharOffset))return null;const D=a.findNeutralCharacter();if(D){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,m,D);if(!a.isOK(k))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,r,o,s,a){const l=[];for(let c=0,u=r.length;cnew ls(new W(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Ga(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,o,l,!0,u):null}static typeWithInterceptors(e,t,n,r,o,s,a){if(!e&&a===` +`){const u=[];for(let d=0,h=o.length;d{const r=t.get(jn).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const r=ps();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const r=t.get(jn).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,n)):!1})}_runEditorCommand(e,t,n){const r=this.runEditorCommand(e,t,n);return r||!0}}var Ao;(function(i){class e extends br{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[qo.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=st(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=st(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends br{runCoreEditorCommand(_,y){_.model.pushStackElement();const S=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);S!==null&&(_.setCursorStates(y.source,3,S.viewStates.map(L=>$n.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=st(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,_,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const L=v.model.validatePosition(S.position),E=v.coordinatesConverter.validateViewPosition(new le(S.viewPosition.lineNumber,S.viewPosition.column),L),D=S.doColumnSelect?y.fromViewLineNumber:E.lineNumber,k=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return R0.columnSelect(v.cursorConfig,v,D,k,E.lineNumber,S.mouseColumn-1)}}),i.CursorColumnSelectLeft=st(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,_,y,S){return R0.columnSelectLeft(v.cursorConfig,v,y)}}),i.CursorColumnSelectRight=st(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,_,y,S){return R0.columnSelectRight(v.cursorConfig,v,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return R0.columnSelectUp(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectUp=st(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=st(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return R0.columnSelectDown(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectDown=st(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=st(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends br{constructor(){super({id:"cursorMove",precondition:void 0,metadata:oO.metadata})}runCoreEditorCommand(_,y){const S=oO.parse(y);S&&this._runCursorMove(_,y.source,S)}_runCursorMove(_,y,S){_.model.pushStackElement(),_.setCursorStates(y,3,o._move(_,_.getCursorStates(),S)),_.revealPrimaryCursor(y,!0)}static _move(_,y,S){const L=S.select,E=S.value;switch(S.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return qo.simpleMove(_,y,S.direction,L,E,S.unit);case 11:case 13:case 12:case 14:return qo.viewportMove(_,y,S.direction,L,E);default:return null}}}i.CursorMoveImpl=o,i.CursorMove=st(new o);class s extends br{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let S=this._staticArgs;this._staticArgs.value===-1&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,qo.simpleMove(_,_.getCursorStates(),S.direction,S.select,S.value,S.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=st(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=st(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1039}})),i.CursorRight=st(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=st(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1041}})),i.CursorUp=st(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=st(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=st(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:11}})),i.CursorPageUpSelect=st(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1035}})),i.CursorDown=st(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=st(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=st(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:12}})),i.CursorPageDownSelect=st(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1036}})),i.CreateCursor=st(new class extends br{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,_){if(!_.position)return;let y;_.wholeLine?y=qo.line(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=qo.moveTo(v,v.getPrimaryCursorState(),!1,_.position,_.viewPosition);const S=v.getCursorStates();if(S.length>1){const L=y.modelState?y.modelState.position:null,E=y.viewState?y.viewState.position:null;for(let D=0,k=S.length;DE&&(L=E);const D=new W(L,1,L,v.model.getLineMaxColumn(L));let k=0;if(y.at)switch(y.at){case Sy.RawAtArgument.Top:k=3;break;case Sy.RawAtArgument.Center:k=1;break;case Sy.RawAtArgument.Bottom:k=4;break}const T=v.coordinatesConverter.convertModelRangeToViewRange(D);v.revealRange(_.source,!1,T,k,0)}}),i.SelectAll=new class extends Mz{constructor(){super(_st)}runDOMCommand(v){lu&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,_,y){const S=_._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(v,_){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[qo.selectAll(v,v.getPrimaryCursorState())])}},i.SetSelection=st(new class extends br{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,_){_.selection&&(v.model.pushStackElement(),v.setCursorStates(_.source,3,[$n.fromModelSelection(_.selection)]))}})})(Ao||(Ao={}));const ght=Re.and(K.textInputFocus,K.columnSelection);function YS(i,e){sl.registerKeybindingRule({id:i,primary:e,when:ght,weight:Xn+1})}YS(Ao.CursorColumnSelectLeft.id,1039);YS(Ao.CursorColumnSelectRight.id,1041);YS(Ao.CursorColumnSelectUp.id,1040);YS(Ao.CursorColumnSelectPageUp.id,1035);YS(Ao.CursorColumnSelectDown.id,1042);YS(Ao.CursorColumnSelectPageDown.id,1036);function wle(i){return i.register(),i}var ow;(function(i){class e extends zo{runEditorCommand(n,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=st(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,ar.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection)))}}),i.Outdent=st(new class extends e{constructor(){super({id:"outdent",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:Re.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,ar.outdent(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.Tab=st(new class extends e{constructor(){super({id:"tab",precondition:K.writable,kbOpts:{weight:Xn,kbExpr:Re.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,ar.tab(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=st(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Ub.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=st(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Xn,kbExpr:K.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Ub.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends Mz{constructor(){super(q1e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().undo()}},i.Redo=new class extends Mz{constructor(){super(X1e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().redo()}}})(ow||(ow={}));class Sle extends w3{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){const n=e.get(jn).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)}}function SC(i,e){wle(new Sle("default:"+i,i)),wle(new Sle(i,i,e))}SC("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});SC("replacePreviousChar");SC("compositionType");SC("compositionStart");SC("compositionEnd");SC("paste");SC("cut");class pht{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ao.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=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){Ao.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ao.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Ao.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Ao.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ao.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ao.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ao.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ao.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ao.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ao.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ao.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ao.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ao.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 iwe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Qi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;let o=0,s=0;for(let l=n;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class rwe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new iwe(()=>this._host.createVisibleLine())}_createDomNode(){const e=Jn(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(144)}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 n=0,r=t.length;nt){const s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){const s=Math.max(0,n-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,n,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,n,r,o){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const r=document.createElement("div");jg._ttPolicy&&(t=jg._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;oi});jg._sb=new KS(1e5);class owe extends Wl{constructor(e){super(e),this._visibleLines=new rwe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);vs(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,r=t.length;n'),r.appendString(o),r.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class vht extends owe{constructor(e){super(e);const n=this._context.configuration.options.get(144);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._contentWidth=n.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 _ht extends owe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),vs(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;vs(this.domNode,t.get(50));const n=t.get(144);return this._contentLeft=n.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class W3{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return W3.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n={...e};return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 le(e.afterLineNumber,1)).lineNumber}}}class bht extends Wl{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Jn(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 n=this._context.configuration.options.get(144),r=n.contentWidth-n.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=n.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let n=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[n];s||(s=this.blocks[n]=Jn(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),n++}for(let o=n;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),fc){const f=h-(c-r);h-=f,n-=f}if(h=v,S=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,v),fitsBelow:S,belowTop:f,left:m}:{fitsAbove:y,aboveTop:a,fitsBelow:S,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new cL(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new xle(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&G9(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"&&G9(this._actual.afterRender,this._actual,this._renderData.position)}}class lL{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class cL{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class xle{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function G9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class swe extends wC{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Et(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 o of this._selections)t.add(o.positionLineNumber);const n=Array.from(t);n.sort((o,s)=>o-s),lr(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);const r=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let s=t;s<=n;s++){const a=s-t;r[a]=""}if(this._wordWrap){const s=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new le(a,1)).lineNumber,u=l.convertModelPositionToViewPosition(new le(c,1)).lineNumber,d=l.convertModelPositionToViewPosition(new le(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,h=Math.max(u,t),f=Math.min(d,n);for(let g=h;g<=f;g++){const p=g-t;r[p]=s}}}const o=this._renderOne(e,!0);for(const s of this._cursorLineNumbers){if(sn)continue;const a=s-t;r[a]=o}this._renderData=r}render(e,t){if(!this._renderData)return"";const n=t-e;return n>=this._renderData.length?"":this._renderData[n]}_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 wht extends swe{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Sht extends swe{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}vu((i,e)=>{const t=i.getColor(jye);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()||i.defines(_le)){const n=i.getColor(_le);n&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),sh(i.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 xht extends wC{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),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 n=[],r=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:W.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-o;n[g]+=u}}}_renderNormalDecorations(e,t,n){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Lht extends Wl{constructor(e,t,n,r){super(e);const o=this._context.configuration.options,s=o.get(103),a=o.get(75),l=o.get(40),c=o.get(106),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+Nz(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new A3(t.domNode,u,this._context.viewLayout.getScrollable())),vh.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Jn(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const m=h.scrollTop;m&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+m,h.scrollTop=0)}if(g){const m=h.scrollLeft;m&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+m,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(xe(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(xe(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(xe(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(xe(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(144);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(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(103),r=t.get(75),o=t.get(40),s=t.get(106),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(144)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Nz(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Pz{constructor(e,t,n,r,o){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Eht{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}}class Dht{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class awe extends wC{_render(e,t,n){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new Dht}if(n.length===0)return r;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamer)continue;const c=Math.max(a,n),u=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(c,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(o.preference.lane);t.push(new Tht(c,d,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,r)=>n.lineNumber===r.lineNumber?n.laneIndex===r.laneIndex?n.zIndex===r.zIndex?r.type===n.type?n.type===0&&r.type===0?n.className0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.laneIndex===r.laneIndex);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(r),n.domNode.setLeft(o),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class kht{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new Nht(this.lineNumber,this.laneIndex,e)}}class Tht{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}}class Nht{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}}class lwe extends me{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function $3(i,e){let t=0,n=0;const r=i.length;for(;nr)throw new Qi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=D=>{if(a!==-1&&(a===-2||a>D-1)){a=-1,l=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){a=k,l=T;break}}}if(c===-2){c=-1,u=-1;for(let k=D;k=0){c=k,u=T;break}}}};let h=-2,f=-1,g=-2,p=-1;const m=D=>{if(h===-2){h=-1,f=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){h=k,f=T;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=T;break}}}};let v=0,_=!0,y=0,S=!0,L=0,E=0;for(let D=0;_||S;D++){const k=e-D,T=e+D;D>1&&(k<1||k1&&(T>r||T>n)&&(S=!1),D>5e4&&(_=!1,S=!1);let M=-1;if(_&&k>=1){const N=this._computeIndentLevel(k-1);N>=0?(c=k-1,u=N,M=Math.ceil(N/this.textModel.getOptions().indentSize)):(d(k),M=this._getIndentLevelForWhitespaceLine(s,l,u))}let P=-1;if(S&&T<=r){const N=this._computeIndentLevel(T-1);N>=0?(h=T-1,f=N,P=Math.ceil(N/this.textModel.getOptions().indentSize)):(m(T),P=this._getIndentLevelForWhitespaceLine(s,f,p))}if(D===0){E=M;continue}if(D===1){if(T<=r&&P>=0&&E+1===P){_=!1,v=T,y=T,L=P;continue}if(k>=1&&M>=0&&M-1===E){S=!1,v=k,y=k,L=M;continue}if(v=e,y=e,L=E,L===0)return{startLineNumber:v,endLineNumber:y,indent:L}}_&&(M>=L?v=k:_=!1),S&&(P>=L?y=T:S=!1)}return{startLineNumber:v,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new W(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(W.fromPositions(n)).toArray()).filter(f=>W.strictContainsPosition(f.range,n));c=(o=fI(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new cwe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=r.horizontalGuides===pb.Enabled||r.horizontalGuides===pb.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&s[h.range.startLineNumber-e].push(new Q0(-1,h.openingBracketRange.getEndPosition().column,g,new VE(!1,m.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(m),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),S=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Js(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>S&&s[p.lineNumber-e].push(new Q0(S,-1,g,new VE(!1,p.column),-1,-1)),m.lineNumber<=t&&_>S&&s[m.lineNumber-e].push(new Q0(S,-1,g,new VE(!L,m.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return _o.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const m=this._computeIndentLevel(p);if(m>=0){l=p,c=m;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=m;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const r=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const S=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((o=(r=e.visibleRangeForPosition(new le(f,_.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;m+=`
`}h[g]=m}this._renderResult=h}getGuidesByLine(e,t,n){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?pb.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?pb.EnabledForActive:pb.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=r?r[d-e]:[],g=new Op(f),p=o?o[d-e]:0;for(let m=1;m<=p;m++){const v=(m-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&m===l;h.push(...g.takeWhile(S=>S.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function _1(i){if(!(i&&i.isTransparent()))return i}vu((i,e)=>{const t=[{bracketColor:qye,guideColor:Fdt,guideColorActive:zdt},{bracketColor:Xye,guideColor:Bdt,guideColorActive:Udt},{bracketColor:Yye,guideColor:Wdt,guideColorActive:jdt},{bracketColor:Zye,guideColor:$dt,guideColorActive:Kdt},{bracketColor:Qye,guideColor:Hdt,guideColorActive:Gdt},{bracketColor:Jye,guideColor:Vdt,guideColorActive:qdt}],n=new cwe,r=[{indentColor:xT,indentColorActive:LT},{indentColor:bdt,indentColorActive:xdt},{indentColor:Cdt,indentColorActive:Ldt},{indentColor:ydt,indentColorActive:Edt},{indentColor:wdt,indentColorActive:Ddt},{indentColor:Sdt,indentColorActive:Idt}],o=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=_1((l=_1(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=_1((c=_1(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(Pf),s=r.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=_1(l),d=_1(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(Pf);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${n.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.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class q9{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 Pht{constructor(){this._currentVisibleRange=new W(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Aht{constructor(e,t,n,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Oht{constructor(e,t,n,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Pht,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(115).enabled,this._maxNumberStickyLines=r.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new pf(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(145)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),r=t.get(145);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,vs(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(144)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new fle(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=n;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Aht(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Oht(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const n=this._getViewLineDomNode(e);if(n===null)return null;const r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new le(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(rs)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return an)return-1;const r=new q9(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,r=W.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new q9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new le(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(du)continue;const h=d===r.startLineNumber?r.startColumn:1,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const r=new q9(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Wut(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(),n=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(n);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),ka&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,_=o[0].endLineNumber;for(let y=1,S=o.length;yl){if(!u)return-1;m=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)m=a;else{const v=Math.max(5*this._lineHeight,l*.2),_=d-v,y=h-l;m=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)m=a;else{const v=(d+h)/2;m=Math.max(0,v-l/2)}else m=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return m}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(144),r=t.left,o=r+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-H3.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,r,o,s){e=e|0,t=t|0,n=n|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-nt)return Math.max(0,r-a)}else return n;return e}}H3.HORIZONTAL_EXTRA_PX=30;class Fht extends awe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(144);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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){var t,n;const r=e.getDecorationsInViewport(),o=[];let s=0;for(let a=0,l=r.length;a',l=[];for(let c=t;c<=n;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const f of d){let g='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class eu{constructor(e,t,n,r){this._rgba8Brand=void 0,this.r=eu._clamp(e),this.g=eu._clamp(t),this.b=eu._clamp(n),this.a=eu._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}}eu.Empty=new eu(0,0,0,0);class DT extends me{static getInstance(){return this._INSTANCE||(this._INSTANCE=new DT),this._INSTANCE}constructor(){super(),this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(gr.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=gr.getColorMap();if(!e){this._colors=[eu.Empty],this._backgroundIsLight=!0;return}this._colors=[eu.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}DT._INSTANCE=null;const Wht=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),$ht=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class DI{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=DI.soften(e,12/15),this.charDataLight=DI.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;re.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,m=$ht(r,c),v=e.width*4,_=a.r,y=a.g,S=a.b,L=o.r-_,E=o.g-y,D=o.b-S,k=Math.max(s,l),T=e.data;let M=m*h*f,P=n*v+t*4;for(let N=0;Ne.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=s.r,p=s.g,m=s.b,v=r.r-g,_=r.g-p,y=r.b-m,S=g+v*f,L=p+_*f,E=m+y*f,D=Math.max(o,a),k=e.data;let T=n*h+t*4;for(let M=0;M{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Lle[i[t]]<<4|Lle[i[t+1]]&15;return e},Dle={1:qv(()=>Ele("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:qv(()=>Ele("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class zE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return Dle[e]?n=new DI(Dle[e](),e):n=zE.createFromSampleData(zE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold 16px ${e}`,n.textBaseline="middle";let r=0;for(const o of Wht)n.fillText(String.fromCharCode(o),r,16/2),r+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=zE._downsample(e,t);return new DI(r,t)}static _downsampleChar(e,t,n,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u0){const c=255/l;for(let u=0;uzE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=II._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=II._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(wut);return n?new eu(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Sut);return t?eu._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class UE{constructor(e,t,n,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,r,o,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let E=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(E+=Math.max(0,o-e.lineHeight-e.paddingBottom));const D=Math.max(1,Math.floor(o*o/E)),k=Math.max(0,e.minimapHeight-D),T=k/(u-o),M=c*T,P=k>0,N=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new UE(c,u,P,T,M,D,R,1,Math.min(a,N))}let m;if(s&&n!==a){const E=n-t+1;m=Math.floor(E*f/h)}else{const E=o/p;m=Math.floor(E*f/h)}const v=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const E=o/p;_=Math.max(_,E-1)}let y;if(_>0){const E=o/p;y=(v+a+_-E-1)*f/h}else y=Math.max(0,(v+a)*f/h-m);y=Math.min(e.minimapHeight-m,y);const S=y/(u-o),L=c*S;if(g>=v+a+_){const E=y>0;return new UE(c,u,E,S,L,m,v,1,a)}else{let E;t>1?E=t+v:E=Math.max(1,c/p);let D,k=Math.max(1,Math.floor(E-L*h/f));kc&&(k=Math.min(k,d.startLineNumber),D=Math.max(D,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?P=(t-k+D+M)*f/h:P=c/e.paddingTop*(D+M)*f/h,new UE(c,u,!0,S,P,m,D,k,T)}}}class sO{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}sO.INVALID=new sO(-1);class Ile{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new iwe(()=>sO.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let r=0,o=n.length;r1){for(let v=0,_=r-1;v<_;v++)m[v]=Math.round(v*o+s);m[r-1]=t}return[new kI(o,m),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let m=0;m0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,r=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,n]=kI.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of n)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,n){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Hr(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new qS,this._sliderPointerDownListener=Lr(this._slider.domNode,Je.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Li.addTarget(this._domNode.domNode),this._sliderTouchStartListener=xe(this._domNode.domNode,Ei.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=xe(this._domNode.domNode,Ei.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=Lr(this._domNode.domNode,Ei.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=Hr(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Os&&c>Hht){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 eZ(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 n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(cle),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 n=UE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(W.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new kle(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new kle(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,n,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,n,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(ym,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(ym,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==kl.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const m=r.getYForLineNumber(d,o);e.fillRect(ym,m,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,n,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,f,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,n,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case kl.Inline:this.renderDecorationOnLine(e,n,c.range,g,r,p,o,o,s,a,l);continue;case kl.Gutter:{const m=r.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,m,Vht,o);continue}}}}renderDecorationOnLine(e,t,n,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,m=g===s?n.endColumn:this._model.getLineMaxColumn(s),v=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,m,c,u,d);this.renderDecoration(e,r,v,h,_-v,a)}getXOffsetForPosition(e,t,n,r,o,s){if(n===1)return ym;if((n-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[ym];let u=ym;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((r-L)/2):0,D=h.a/255,k=new eu(Math.round((h.r-d.r)*D+d.r),Math.round((h.g-d.g)*D+d.g),Math.round((h.b-d.b)*D+d.b),255);let T=e.topPaddingLineCount*r;const M=[];for(let B=0,$=n-t+1;B<$;B++)l[B]&&aO._renderLine(o,k,h.a,p,m,y,g,f,v,T,E,u,c[B],_,r),M[B]=new sO(T),T+=r;const P=s===-1?0:s,R=(a===-1?o.height:a)-P;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,P,o.width,R),new Ile(e,o,M)}static _renderUntouchedLines(e,t,n,r,o,s){const a=[];if(!s){for(let T=0,M=r-n+1;T=0&&P_)return;const N=m.charCodeAt(L);if(N===9){const R=h-(L+E)%h;E+=R-1,S+=R*s}else if(N===32)S+=s;else{const R=Yv(N)?2:1;for(let O=0;O_)return}}}}}class kle{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;rthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Uht extends Wl{constructor(e,t){super(e),this._viewDomNode=t;const r=this._context.configuration.options.get(144);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=Jn(document.createElement("div")),vh.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Jn(document.createElement("div")),vh.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=Jn(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 n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(n===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&Ce.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 Kht extends Wl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Jn(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=gr.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[new le(1,1)]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jht(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,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=Ce.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):(d.clearRect(0,0,n,r),d.fillStyle=Ce.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):d.clearRect(0,0,n,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,m=g.data;d.fillStyle=p;let v=0,_=0,y=0;for(let S=0,L=m.length/3;Sr&&(N=r-u),T=N-u,M=N+u}T>y+1||E!==v?(S!==0&&d.fillRect(h[v],_,f[v],y-_),v=E,_=T,y=M):M>y&&(y=M)}d.fillRect(h[v],_,f[v],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,m=this._settings.x[7],v=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let S=0,L=this._cursorPositions.length;Sr&&(D=r-p);const k=D-p,T=k+g;k>y+1?(S!==0&&d.fillRect(m,_,v,y-_),_=k,y=T):T>y&&(y=T)}d.fillRect(m,_,v,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class Tle{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 uwe{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,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.colorn&&(p=n-m);const v=u.color;let _=this._color2Id[v];_||(_=++this._lastAssignedId,this._color2Id[v]=_,this._id2Color[_]=v);const y=new Tle(p-m,p+m,_);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Tle.compare),a}}class qht extends wT{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=Jn(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Ght(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(67)),this._zoneManager.setPixelRatio(n.get(142)),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(142)&&(this._zoneManager.setPixelRatio(t.get(142)),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(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,r,e),!0}_renderOneLane(e,t,n,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=n[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class Xht extends Wl{constructor(e){super(e),this.domNode=Jn(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(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),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(e0;){const a=Jn(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(144);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 n=this._context.configuration.options.get(103);return this._useShadows=n.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 Zht{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Qht{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Jht(i){return new Zht(i)}function eft(i){return new Qht(i.lineNumber,i.ranges.map(Jht))}class Tr extends wC{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._roundedSelection=t.get(101),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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;i2(u-g)g&&(h.top=1),i2(d-p)'}_actualRenderOneSelection(e,t,n,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Tr.SELECTION_CLASS_NAME="selected-text";Tr.SELECTION_TOP_LEFT="top-left-radius";Tr.SELECTION_BOTTOM_LEFT="bottom-left-radius";Tr.SELECTION_TOP_RIGHT="top-right-radius";Tr.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Tr.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Tr.ROUNDED_PIECE_WIDTH=10;vu((i,e)=>{const t=i.getColor(Nct);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function i2(i){return i<0?-i:i}class Nle{constructor(e,t,n,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class Rle{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Jn(document.createElement("div")),this._domNode.setClassName(`cursor ${iw}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),vs(this._domNode,n),this._domNode.setDisplay("none"),this._position=new le(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),vs(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[r,o]=prt(n,t-1);return[new le(e,r+1),n.substring(r,o)]}_prepareRender(e){let t="",n="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Jo.Line||this._cursorStyle===Jo.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;const f=Bt(this._domNode.domNode);let g;this._cursorStyle===Jo.Line?(g=nae(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,n=this._getTokenClassName(r))):g=nae(f,1);let p=h.left,m=0;g>=2&&p>=1&&(m=1,p-=m);const v=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new Nle(v,p,m,g,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new W(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Jo.Block&&(t=o,n=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Jo.Underline||this._cursorStyle===Jo.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new Nle(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${iw} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class TI extends Wl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),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 Rle(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Jn(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 gd,this._cursorFlatBlinkInterval=new CY,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(91),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 n=0,r=this._secondaryCursors.length;nt.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s{for(let r=0,o=e.ranges.length;r{this._isVisible?this._hide():this._show()},TI.BLINK_INTERVAL,Bt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},TI.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Jo.Line:e+=" cursor-line-style";break;case Jo.Block:e+=" cursor-block-style";break;case Jo.Underline:e+=" cursor-underline-style";break;case Jo.LineThin:e+=" cursor-line-thin-style";break;case Jo.BlockOutline:e+=" cursor-block-outline-style";break;case Jo.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{const t=i.getColor(Kye);if(t){let n=i.getColor(vdt);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),sh(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const X9=()=>{throw new Error("Invalid change accessor")};class tft extends Wl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=Jn(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=Jn(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 n=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s{const r={addZone:o=>(t=!0,this._addZone(n,o)),removeZone:o=>{o&&(t=this._removeZone(n,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(n,o)||t)}};nft(e,r),r.addZone=X9,r.removeZone=X9,r.layoutZone=X9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:Jn(t.domNode),marginDomNode:t.marginDomNode?Jn(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.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(n){nn(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){nn(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=M.endOffset&&(T++,M=n&&n[T]),R!==9&&R!==32||h&&!E&&N<=k)continue;if(d&&N>=D&&N<=k&&R===32){const B=N-1>=0?a.charCodeAt(N-1):0,$=N+1=0?a.charCodeAt(N-1):0;if(R===32&&B!==32&&B!==9)continue}if(n&&(!M||M.startOffset>N||M.endOffset<=N))continue;const O=e.visibleRangeForPosition(new le(t,N+1));O&&(s?(P=Math.max(P,O.left),R===9?L+=this._renderArrow(f,m,O.left):L+=``):R===9?L+=`
${S?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(P=Math.round(P+m),``+L+""):L}_renderArrow(e,t,n){const r=t/7,o=t,s=e/2,a=n,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},m={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Mle{constructor(e){const t=e.options,n=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}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 rft{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new W(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 oft{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 sft{constructor(e,t,n){this.configuration=e,this.theme=new oft(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var aft=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lft=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Az=class extends wT{constructor(e,t,n,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Et(1,1,1,1)],this._renderAnimationFrame=null;const l=new pht(t,r,o,e);this._context=new sft(t,n,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Rz,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Jn(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Jn(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Jn(document.createElement("div")),vh.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Lht(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new H3(this._context,this._linesContent),this._viewZones=new tft(this._context),this._viewParts.push(this._viewZones);const c=new Kht(this._context);this._viewParts.push(c);const u=new Yht(this._context);this._viewParts.push(u);const d=new vht(this._context);this._viewParts.push(d),d.addDynamicOverlay(new wht(this._context)),d.addDynamicOverlay(new Tr(this._context)),d.addDynamicOverlay(new Mht(this._context)),d.addDynamicOverlay(new xht(this._context)),d.addDynamicOverlay(new ift(this._context));const h=new _ht(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Sht(this._context)),h.addDynamicOverlay(new Bht(this._context)),h.addDynamicOverlay(new Fht(this._context)),h.addDynamicOverlay(new ET(this._context)),this._glyphMarginWidgets=new Iht(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new zb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Cht(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new TI(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Uht(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new Xht(this._context);this._viewParts.push(g);const p=new bht(this._context);this._viewParts.push(p);const m=new zht(this._context);if(this._viewParts.push(m),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(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?(s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),s.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new gdt(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],r=0;n=n.concat(e.getAllMarginDecorations().map(o=>{var s,a,l;const c=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:Uf.Center;return r=Math.max(r,o.range.endLineNumber),{range:o.range,lane:c,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const s=e.validateRange(o.preference.range);return r=Math.max(r,s.endLineNumber),{range:s,lane:o.preference.lane}})),n.sort((o,s)=>W.compareRangesUsingStarts(o.range,s.range)),t.reset(r);for(const o of n)t.push(o.lane,o.range,o.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 Uut(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 le(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(144);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(141)+" "+Nz(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(){if(this._store.isDisposed)throw new Qi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Oz.INSTANCE.scheduleCoordinatedRendering({window:Bt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Qi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Qi;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new Qi;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new Qi;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();nv(()=>e.prepareRenderText());const t=nv(()=>e.renderText());if(t){const[n,r]=t;nv(()=>e.prepareRender(n,r)),nv(()=>e.render(n,r))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Jm.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 n=new rft(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new Fut(this._context.viewLayout,n,this._viewLines)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.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 n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new le(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?W3.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new qht(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.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,n,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};Az=aft([lft(6,Wt)],Az);function nv(i){try{return i()}catch(e){return nn(e),null}}class Oz{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[n,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,HA(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)nv(()=>n.prepareRenderText());const t=[];for(let n=0,r=e.length;no.renderText())}for(let n=0,r=e.length;no.prepareRender(a,l))}for(let n=0,r=e.length;no.render(a,l))}}}Oz.INSTANCE=new Oz;class jE{constructor(e,t,n,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=r,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)r0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)n=o+1;else break;else if(e=l)n=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new r2(o,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,n);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new r2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const r=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Ple(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let r=n.offsetInInputWithInjections;if(Ale(this.injectionOptions[n.injectedTextIndex].cursorStops))return r;let o=n.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[n.injectedTextIndex]&&!(Ple(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,Ale(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=n.offsetInInputWithInjections+n.length,o=n.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}y3()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(n);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let r=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function Ple(i){return i==null?!0:i===qu.Right||i===qu.Both}function Ale(i){return i==null?!0:i===qu.Left||i===qu.Both}class r2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new le(e+this.outputLineIndex,this.outputOffset+1)}}class cft{constructor(){this.changeType=1}}class _h{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",r=0;for(const o of t)n+=e.substring(r,o.column-1),r=o.column-1,n+=o.options.content;return n+=e.substring(r),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new _h(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new _h(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,r)=>n.lineNumber===r.lineNumber?n.column===r.column?n.order-r.order:n.column-r.column:n.lineNumber-r.lineNumber),t}constructor(e,t,n,r,o){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=r,this.order=o}}class Ole{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class uft{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class dft{constructor(e,t,n,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class hft{constructor(){this.changeType=5}}class sw{constructor(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;ti});class tZ{static create(e){return new tZ(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>fft(Ym(this.targetWindow.deref()),s,e,t,n,r,o,a)}}}function fft(i,e,t,n,r,o,s,a){var l;function c(M){const P=a[M];if(P){const N=_h.applyInjectedText(e[M],P),R=P.map(B=>B.options),O=P.map(B=>B.column-1);return new jE(O,R,[N.length],[],0)}else return null}if(r===-1){const M=[];for(let P=0,N=e.length;Pu?(N=0,R=0):O=u-G}const B=P.substr(N),$=gft(B,R,n,O,p,f);m[M]=N,v[M]=R,_[M]=B,y[M]=$[0],S[M]=$[1]}const L=p.build(),E=(l=Y9==null?void 0:Y9.createHTML(L))!==null&&l!==void 0?l:L;g.innerHTML=E,g.style.position="absolute",g.style.top="10000",s==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),i.document.body.appendChild(g);const D=document.createRange(),k=Array.prototype.slice.call(g.children,0),T=[];for(let M=0;Mie.options),U=j.map(ie=>ie.column-1)):(G=null,U=null),T[M]=new jE(U,G,N,$,O)}return i.document.body.removeChild(g),T}function gft(i,e,t,n,r,o){if(o!==0){const h=String(o);r.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,r.appendString("
"),[c,u]}function pft(i,e,t,n){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{Fz(i,r,n,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function Fz(i,e,t,n,r,o,s,a){if(n===o||(r=r||Z9(i,e,t[n],t[n+1]),s=s||Z9(i,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(n+1===o){a.push(o);return}const l=n+(o-n)/2|0,c=Z9(i,e,t[l],t[l+1]);Fz(i,e,t,n,r,l,c,a),Fz(i,e,t,l,c,o,s,a)}function Z9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class mft extends me{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new nY),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,n){this._editor=e,this._instantiationService=n;for(const r of t){if(this._pending.has(r.id)){nn(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(HL(Bt(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return HL(Bt((e=this._editor)===null||e===void 0?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 n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){nn(n)}}}}class hwe{constructor(e,t,n,r,o,s,a){this.id=e,this.label=t,this.alias=n,this.metadata=r,this._precondition=o,this._run=s,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function i_(i){let e=0,t=0,n=0,r=0;for(let o=0,s=i.length;o=dc&&(t=t-i%dc),t}function yft(i,e){return i.reduce((t,n)=>mr(t,e(n)),Sa)}function fwe(i,e){return i===e}function RI(i,e){const t=i,n=e;if(n-t<=0)return Sa;const o=Math.floor(t/dc),s=Math.floor(n/dc),a=n-s*dc;if(o===s){const l=t-o*dc;return $r(0,a-l)}else return $r(s-o,a)}function aw(i,e){return i=e}function xy(i){return $r(i.lineNumber-1,i.column-1)}function vb(i,e){const t=i,n=Math.floor(t/dc),r=t-n*dc,o=e,s=Math.floor(o/dc),a=o-s*dc;return new W(n+1,r+1,s+1,a+1)}function wft(i){const e=ng(i);return $r(e.length-1,e[e.length-1].length)}class dp{static fromModelContentChanges(e){return e.map(n=>{const r=W.lift(n.range);return new dp(xy(r.getStartPosition()),xy(r.getEndPosition()),wft(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${ru(this.startOffset)}...${ru(this.endOffset)}) -> ${ru(this.newLength)}`}}class Sft{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>nZ.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:RI(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?$r(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):$r(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=ru(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?$r(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):$r(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(r===0){const s=1<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 n=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const r=bft(e,t,this.lineIdx,this.lineCharOffset);return new Vm(r,0,-1,ao.getEmpty(),new M0(r))}}class kft{constructor(e,t){this.text=e,this._offset=Sa,this.idx=0;const n=t.getRegExpStr(),r=n?new RegExp(n+`| +`,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new Vm($r(0,g),0,-1,ao.getEmpty(),new M0($r(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Vm($r(1,g),0,-1,ao.getEmpty(),new M0($r(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,p=s[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let m;if(u===a){const v=g-c;if(vTft(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Tft(i){let e=vc(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class mwe{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=oZ.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Nft(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?vwe(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),r=t();if(!r)return n;for(let s=t();s;s=t())Wle(n,r)<=Wle(r,s)?(n=Q9(n,r),r=s):r=Q9(r,s);return Q9(n,r)}function vwe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let r=0;r=3?i[2]:null,e)}function Wle(i,e){return Math.abs(i.listHeight-e.listHeight)}function Q9(i,e){return i.listHeight===e.listHeight?Kf.create23(i,e,null,!1):i.listHeight>e.listHeight?Rft(i,e):Mft(e,i)}function Rft(i,e){i=i.toMutable();let t=i;const n=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Kf.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Kf.create23(i,r,null,!1):i}function Mft(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Kf.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Kf.create23(r,i,null,!1):i}class Pft{constructor(e){this.lastOffset=Sa,this.nextNodes=[e],this.offsets=[Sa],this.idxs=[]}readLongestNodeAt(e,t){if(aw(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=uL(this.nextNodes);if(!n)return;const r=uL(this.offsets);if(aw(e,r))return;if(aw(r,e))if(mr(r,n.length)<=e)this.nextNodeAfterCurrent();else{const o=J9(n);o!==-1?(this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const o=J9(n);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=uL(this.offsets),t=uL(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=uL(this.nextNodes),r=J9(n,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(n.getChild(r)),this.offsets.push(mr(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function J9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function uL(i){return i.length>0?i[i.length-1]:void 0}function Bz(i,e,t,n){return new Aft(i,e,t,n).parseDocument()}class Aft{constructor(e,t,n,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,n&&r)throw new Error("Not supported");this.oldNodeReader=n?new Pft(n):void 0,this.positionMapper=new Sft(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ao.getEmpty(),0);return e||(e=Kf.getEmpty()),e}parseList(e,t){const n=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||n.push(o)}return this.oldNodeReader?Nft(n):vwe(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!lO(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!aw(r.length,t)?!1:r.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new Dft(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new M0(n.length);const r=e.merge(n.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),MI.create(n.astNode,o,s.astNode)):MI.create(n.astNode,o,null)}default:throw new Error("unexpected")}}}function dO(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new Op($le(i)),n=$le(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!lO(c);){const[d,h]=r.splitAt(c);u.push(d),c=RI(d.lengthAfter,c),r=h??t.dequeue()}return lO(c)||u.push(new iv(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&fwe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new dp(h.startOffset,u,mr(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=Sa;for(const c of n){const u=o(c.lengthBefore);if(c.modified){const d=yft(u,f=>f.lengthBefore),h=mr(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=mr(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class iv{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=RI(e,this.lengthAfter);return fwe(t,Sa)?[this,void 0]:this.modified?[new iv(this.modified,this.lengthBefore,e),new iv(this.modified,Sa,t)]:[new iv(this.modified,e,e),new iv(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${ru(this.lengthBefore)} -> ${ru(this.lengthAfter)}`}}function $le(i){const e=[];let t=Sa;for(const n of i){const r=RI(t,n.startOffset);lO(r)||e.push(new iv(!1,r,r));const o=RI(n.startOffset,n.endOffset);e.push(new iv(!0,o,n.newLength)),t=n.endOffset}return e}class Oft extends me{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new ae,this.denseKeyProvider=new gwe,this.brackets=new mwe(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 n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new kft(this.textModel.getValue(),n);this.initialAstWithoutTokens=Bz(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(n=>new dp($r(n.fromLineNumber-1,0),$r(n.toLineNumber,0),$r(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=dp.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=dO(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=dO(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,n){const r=t,o=new pwe(this.textModel,this.brackets);return Bz(o,e,r,n)}getBracketsInRange(e,t){this.flushQueue();const n=$r(e.startLineNumber-1,e.startColumn-1),r=$r(e.endLineNumber-1,e.endColumn-1);return new Mf(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;Wz(s,Sa,s.length,n,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=xy(e.getStartPosition()),r=xy(e.getEndPosition());return new Mf(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Fft(o,t,this.textModel);$z(s,Sa,s.length,n,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return bwe(t,Sa,t.length,xy(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return _we(t,Sa,t.length,xy(e))}}function _we(i,e,t,n){if(i.kind===4||i.kind===2){const r=[];for(const o of i.children)t=mr(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(aw(s,n)){const l=_we(i.children[o],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=vb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function bwe(i,e,t,n){if(i.kind===4||i.kind===2){for(const r of i.children){if(t=mr(e,r.length),aw(n,t)){const o=bwe(r,e,t,n);if(o)return o}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=vb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function Wz(i,e,t,n,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=mr(e,i.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=i.computeMinIndentation(e,o.textModel)),c=o.push(new _ft(vb(e,t),vb(e,d),i.closingBracket?vb(mr(d,((l=i.child)===null||l===void 0?void 0:l.length)||Sa),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=mr(e,f.length),lw(e,r)&&QL(t,n)&&(c=$z(f,e,t,n,r,o,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=mr(u,d.length),lw(h,r)&&lw(n,u)&&(c=$z(d,h,u,n,r,o,s,a),!c))return!1}}return c}class Bft extends me{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Vo),this.onDidChangeEmitter=new ae,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var r;(!n.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(n.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Fe;this.bracketPairsTree.value=Wft(e.add(new Oft(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Mf.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Mf.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||Mf.empty}findMatchingBracketUp(e,t,n){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(W.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?o2(this._findMatchingBracketUp(l,r,e7(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(W.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(nu(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,W.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=e7(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(Xh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=r+1;c=l)break;if(Xh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,r=this.textModel.tokenization.getLineTokens(n),o=this.textModel.getLineContent(n),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!Xh(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=Ou.findNextBracketInRange(a.forwardRegex,n,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Bg)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!Xh(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=Ou.findPrevBracketInRange(c.reversedRegex,n,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Bg?null:g}}}return null}_matchFoundBracket(e,t,n,r){if(!t)return null;const o=n?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof Bg?o:[e,o]:null}_findMatchingBracketUp(e,t,n){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return Bg.INSTANCE;const f=Ou.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let m=!0;for(;f>=0;f--){const v=u.getLanguageId(f)===r&&!Xh(u.getStandardTokenType(f));if(v)m?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(m&&g!==p){const _=l(c,h,g,p);if(_)return _}m=v}if(m&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,n){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return Bg.INSTANCE;const g=Ou.findNextBracketInRange(o,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,m=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);r!==p&&(r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(r!==p){if(o&&s&&g&&h!==f){const v=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(v)return this._toFoundBracket(s,v);g=!1}r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const m=!!o&&!Xh(l.getStandardTokenType(d));if(m)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const v=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(v)return this._toFoundBracket(s,v)}g=m}if(s&&o&&g&&h!==f){const p=Ou.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=n.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const m=c.getLanguageId(h);o!==m&&(o=m,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=e7(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let m=0,v=g?g.brackets.length:0;m{for(;;){if(r&&++c%100===0&&!r())return Bg.INSTANCE;const _=Ou.findNextBracketInRange(f.forwardRegex,g,p,m,v);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),S=f.textIsBracket[y];if(S&&(S.isOpen(y)?a[S.index]++:S.isClose(y)&&a[S.index]--,a[S.index]===-1))return this._matchFoundBracket(_,S,!1,r);m=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),m=this.textModel.getLineContent(f);let v=0,_=0,y=0;if(f===n.lineNumber){v=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(v);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let S=!0;for(;ve==null?void 0:e.dispose()}}function e7(i){if(typeof i>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class Bg{constructor(){this._searchCanceledBrand=void 0}}Bg.INSTANCE=new Bg;function o2(i){return i instanceof Bg?null:i}class $ft extends me{constructor(e){super(),this.textModel=e,this.colorProvider=new Cwe,this.onDidChangeEmitter=new ae,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,n,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new W(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Cwe{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}`}}vu((i,e)=>{const t=[qye,Xye,Yye,Zye,Qye,Jye],n=new Cwe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Odt)}; }`);const r=t.map(o=>i.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function s2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class cs{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,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${s2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${s2(this.oldText)}")`:`(replace@${this.oldPosition} "${s2(this.oldText)}" with "${s2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const r=t.length;Pd(e,r,n),n+=4;for(let o=0;oi.length)return!1;if(t){if(!cY(i,e))return!1;if(e.length===i.length)return!0;let o=e.length;return e.charAt(e.length-1)===n&&o--,i.charAt(o)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function wwe(i){return i>=65&&i<=90||i>=97&&i<=122}function zft(i,e=Os){return e?wwe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function Yh(i){return RA(i,!0)}class Uft{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:sI(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===cn.file)return Hz(Yh(e),Yh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(zle(e.authority,t.authority))return Hz(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ft.joinPath(e,...t)}basenameOrAuthority(e){return uu(e)||e.authority}basename(e){return lo.basename(e.path)}extname(e){return lo.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===cn.file?t=Ft.file(QCe(Yh(e))).path:(t=lo.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===cn.file?t=Ft.file(ZCe(Yh(e))).path:t=lo.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!zle(e.authority,t.authority))return;if(e.scheme===cn.file){const o=Vit(Yh(e),Yh(t));return Os?ywe(o):o}let n=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(n.length,r.length);oHle(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ih){return Ule(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ih){let n=!1;if(e.scheme===cn.file){const r=Yh(e);n=r!==void 0&&r.length===Hle(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!Ule(e,t)?e.with({path:e.path+"/"}):e}}const Gi=new Uft(()=>!1),sZ=Gi.isEqual.bind(Gi);Gi.isEqualOrParent.bind(Gi);Gi.getComparisonKey.bind(Gi);const jft=Gi.basenameOrAuthority.bind(Gi),uu=Gi.basename.bind(Gi),Kft=Gi.extname.bind(Gi),V3=Gi.dirname.bind(Gi),Gft=Gi.joinPath.bind(Gi),qft=Gi.normalizePath.bind(Gi),Xft=Gi.relativePath.bind(Gi),Vle=Gi.resolvePath.bind(Gi);Gi.isAbsolutePath.bind(Gi);const zle=Gi.isEqualAuthority.bind(Gi),Ule=Gi.hasTrailingPathSeparator.bind(Gi);Gi.removeTrailingPathSeparator.bind(Gi);Gi.addTrailingPathSeparator.bind(Gi);var r_;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&n.set(i.META_DATA_MIME,o),n}i.parseMetaData=e})(r_||(r_={}));function b1(i){return i.toString()}class Oo{static create(e,t){const n=e.getAlternativeVersionId(),r=Vz(e);return new Oo(n,n,r,r,t,t,[])}constructor(e,t,n,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,n,r,o){t.length>0&&(this.changes=Hft(this.changes,t)),this.afterEOL=n,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(Pd(e,t?t.length:0,n),n+=4,t)for(const r of t)Pd(e,r.selectionStartLineNumber,n),n+=4,Pd(e,r.selectionStartColumn,n),n+=4,Pd(e,r.positionLineNumber,n),n+=4,Pd(e,r.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const r=Md(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(Ft.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 Oo}append(e,t,n,r,o){this._data instanceof Oo&&this._data.append(e,t,n,r,o)}close(){this._data instanceof Oo&&(this._data=this._data.serialize())}open(){this._data instanceof Oo||(this._data=Oo.deserialize(this._data))}undo(){if(Ft.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Oo&&(this._data=this._data.serialize());const e=Oo.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ft.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Oo&&(this._data=this._data.serialize());const e=Oo.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Oo&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Yft{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=b1(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=b1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=b1(Ft.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=b1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,r,o){const s=b1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,r,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=b1(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(`${uu(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Vz(i){return i.getEOL()===` +`?0:1}function Wg(i){return i?i instanceof Swe||i instanceof Yft:!1}class aZ{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Wg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Wg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(Wg(n)&&n.canAppend(this._model))return n;const r=new Swe(w("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,[],Vz(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=aZ._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),Vz(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return nn(n),null}}}class Zft{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Qft(i,e,t,n,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-10?r++:S>1&&o++,Qft(s,a,m,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const E=d.spacesDiff;E<=c&&u[E]++,s=m,a=y}let h=t;r!==o&&(h=r{const m=u[p];m>g&&(g=m,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function qa(i){return(i.metadata&1)>>>0}function Vi(i,e){i.metadata=i.metadata&254|e<<0}function _s(i){return(i.metadata&2)>>>1===1}function Ai(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function xwe(i){return(i.metadata&4)>>>2===1}function Kle(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Lwe(i){return(i.metadata&64)>>>6===1}function Gle(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Jft(i){return(i.metadata&24)>>>3}function qle(i,e){i.metadata=i.metadata&231|e<<3}function egt(i){return(i.metadata&32)>>>5===1}function Xle(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class Ewe{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Vi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,Kle(this,!1),Gle(this,!1),qle(this,1),Xle(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Ai(this,!1)}reset(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r}setOptions(e){this.options=e;const t=this.options.className;Kle(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),Gle(this,this.options.glyphMarginClassName!==null),qle(this,this.options.stickiness),Xle(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Cn=new Ewe(null,0,0);Cn.parent=Cn;Cn.left=Cn;Cn.right=Cn;Vi(Cn,0);class t7{constructor(){this.root=Cn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,r,o,s){return this.root===Cn?[]:lgt(this,e,t,n,r,o,s)}search(e,t,n,r){return this.root===Cn?[]:agt(this,e,t,n,r)}collectNodesFromOwner(e){return ogt(this,e)}collectNodesPostOrder(){return sgt(this)}insert(e){Yle(this,e),this._normalizeDeltaIfNecessary()}delete(e){Zle(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=n.start+r,s=n.end+r;n.setCachedOffsets(o,s,t)}acceptReplace(e,t,n,r){const o=igt(this,e,e+t);for(let s=0,a=o.length;st||n===1?!1:n===2?!0:e}function ngt(i,e,t,n,r){const o=Jft(i),s=o===0||o===2,a=o===1||o===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&egt(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const m=r?1:l>0?2:0;!h&&C1(d,s,e,m)&&(h=!0),!g&&C1(f,a,e,m)&&(g=!0)}if(u>0&&!r){const m=l>c?2:0;!h&&C1(d,s,e+u,m)&&(h=!0),!g&&C1(f,a,e+u,m)&&(g=!0)}{const m=r?1:0;!h&&C1(d,s,t,m)&&(i.start=e+c,h=!0),!g&&C1(f,a,t,m)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function igt(i,e,t){let n=i.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;n!==Cn;){if(_s(n)){Ai(n.left,!1),Ai(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),n=n.parent;continue}if(!_s(n.left)){if(o=r+n.maxEnd,ot){Ai(n,!0);continue}if(a=r+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Ai(n,!0),n.right!==Cn&&!_s(n.right)){r+=n.delta,n=n.right;continue}}return Ai(i.root,!1),l}function rgt(i,e,t,n){let r=i.root,o=0,s=0,a=0;const l=n-(t-e);for(;r!==Cn;){if(_s(r)){Ai(r.left,!1),Ai(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),o_(r),r=r.parent;continue}if(!_s(r.left)){if(s=o+r.maxEnd,st){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(i.requestNormalizeDelta=!0),Ai(r,!0);continue}if(Ai(r,!0),r.right!==Cn&&!_s(r.right)){o+=r.delta,r=r.right;continue}}Ai(i.root,!1)}function ogt(i,e){let t=i.root;const n=[];let r=0;for(;t!==Cn;){if(_s(t)){Ai(t.left,!1),Ai(t.right,!1),t=t.parent;continue}if(t.left!==Cn&&!_s(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[r++]=t),Ai(t,!0),t.right!==Cn&&!_s(t.right)){t=t.right;continue}}return Ai(i.root,!1),n}function sgt(i){let e=i.root;const t=[];let n=0;for(;e!==Cn;){if(_s(e)){Ai(e.left,!1),Ai(e.right,!1),e=e.parent;continue}if(e.left!==Cn&&!_s(e.left)){e=e.left;continue}if(e.right!==Cn&&!_s(e.right)){e=e.right;continue}t[n++]=e,Ai(e,!0)}return Ai(i.root,!1),t}function agt(i,e,t,n,r){let o=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==Cn;){if(_s(o)){Ai(o.left,!1),Ai(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==Cn&&!_s(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,n);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&xwe(o)&&(d=!1),r&&!Lwe(o)&&(d=!1),d&&(c[u++]=o),Ai(o,!0),o.right!==Cn&&!_s(o.right)){s+=o.delta,o=o.right;continue}}return Ai(i.root,!1),c}function lgt(i,e,t,n,r,o,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==Cn;){if(_s(a)){Ai(a.left,!1),Ai(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!_s(a.left)){if(c=l+a.maxEnd,ct){Ai(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),r&&xwe(a)&&(g=!1),s&&!Lwe(a)&&(g=!1),g&&(h[f++]=a)}if(Ai(a,!0),a.right!==Cn&&!_s(a.right)){l+=a.delta,a=a.right;continue}}return Ai(i.root,!1),h}function Yle(i,e){if(i.root===Cn)return e.parent=Cn,e.left=Cn,e.right=Cn,Vi(e,0),i.root=e,i.root;cgt(i,e),Em(e.parent);let t=e;for(;t!==i.root&&qa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;qa(n)===1?(Vi(t.parent,0),Vi(n,0),Vi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,KE(i,t)),Vi(t.parent,0),Vi(t.parent.parent,1),GE(i,t.parent.parent))}else{const n=t.parent.parent.left;qa(n)===1?(Vi(t.parent,0),Vi(n,0),Vi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,GE(i,t)),Vi(t.parent,0),Vi(t.parent.parent,1),KE(i,t.parent.parent))}return Vi(i.root,0),e}function cgt(i,e){let t=0,n=i.root;const r=e.start,o=e.end;for(;;)if(dgt(r,o,n.start+t,n.end+t)<0)if(n.left===Cn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===Cn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=Cn,e.right=Cn,Vi(e,1)}function Zle(i,e){let t,n;if(e.left===Cn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Cn?(t=e.left,n=e):(n=ugt(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Vi(t,0),e.detach(),n7(),o_(t),i.root.parent=Cn;return}const r=qa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Vi(n,qa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Cn&&(n.left.parent=n),n.right!==Cn&&(n.right.parent=n)),e.detach(),r){Em(t.parent),n!==e&&(Em(n),Em(n.parent)),n7();return}Em(t),Em(t.parent),n!==e&&(Em(n),Em(n.parent));let o;for(;t!==i.root&&qa(t)===0;)t===t.parent.left?(o=t.parent.right,qa(o)===1&&(Vi(o,0),Vi(t.parent,1),KE(i,t.parent),o=t.parent.right),qa(o.left)===0&&qa(o.right)===0?(Vi(o,1),t=t.parent):(qa(o.right)===0&&(Vi(o.left,0),Vi(o,1),GE(i,o),o=t.parent.right),Vi(o,qa(t.parent)),Vi(t.parent,0),Vi(o.right,0),KE(i,t.parent),t=i.root)):(o=t.parent.left,qa(o)===1&&(Vi(o,0),Vi(t.parent,1),GE(i,t.parent),o=t.parent.left),qa(o.left)===0&&qa(o.right)===0?(Vi(o,1),t=t.parent):(qa(o.left)===0&&(Vi(o.right,0),Vi(o,1),KE(i,o),o=t.parent.left),Vi(o,qa(t.parent)),Vi(t.parent,0),Vi(o.left,0),GE(i,t.parent),t=i.root));Vi(t,0),n7()}function ugt(i){for(;i.left!==Cn;)i=i.left;return i}function n7(){Cn.parent=Cn,Cn.delta=0,Cn.start=0,Cn.end=0}function KE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Cn&&(t.left.parent=e),t.parent=e.parent,e.parent===Cn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,o_(e),o_(t)}function GE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Cn&&(t.right.parent=e),t.parent=e.parent,e.parent===Cn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,o_(e),o_(t)}function Dwe(i){let e=i.end;if(i.left!==Cn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==Cn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function o_(i){i.maxEnd=Dwe(i)}function Em(i){for(;i!==Cn;){const e=Dwe(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function dgt(i,e,t,n){return i===t?e-n:i-t}class zz{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!==on)return lZ(this.right);let e=this;for(;e.parent!==on&&e.parent.left!==e;)e=e.parent;return e.parent===on?on:e.parent}prev(){if(this.left!==on)return Iwe(this.left);let e=this;for(;e.parent!==on&&e.parent.right!==e;)e=e.parent;return e.parent===on?on:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const on=new zz(null,0);on.parent=on;on.left=on;on.right=on;on.color=0;function lZ(i){for(;i.left!==on;)i=i.left;return i}function Iwe(i){for(;i.right!==on;)i=i.right;return i}function cZ(i){return i===on?0:i.size_left+i.piece.length+cZ(i.right)}function uZ(i){return i===on?0:i.lf_left+i.piece.lineFeedCnt+uZ(i.right)}function i7(){on.parent=on}function qE(i,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!==on&&(t.left.parent=e),t.parent=e.parent,e.parent===on?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function XE(i,e){const t=e.left;e.left=t.right,t.right!==on&&(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===on?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function a2(i,e){let t,n;if(e.left===on?(n=e,t=n.right):e.right===on?(n=e,t=n.left):(n=lZ(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),i7(),i.root.parent=on;return}const r=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,JL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,JL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==on&&(n.left.parent=n),n.right!==on&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,JL(i,n)),e.detach(),t.parent.left===t){const s=cZ(t),a=uZ(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,Ig(i,t.parent,l,c)}}if(JL(i,t.parent),r){i7();return}let o;for(;t!==i.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,qE(i,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,XE(i,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,qE(i,t.parent),t=i.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,XE(i,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,qE(i,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,XE(i,t.parent),t=i.root));t.color=0,i7()}function Qle(i,e){for(JL(i,e);e!==i.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,qE(i,e)),e.parent.color=0,e.parent.parent.color=1,XE(i,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,XE(i,e)),e.parent.color=0,e.parent.parent.color=1,qE(i,e.parent.parent))}i.root.color=0}function Ig(i,e,t,n){for(;e!==i.root&&e!==on;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function JL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=cZ(e.left)-e.size_left,n=uZ(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const yg=65535;function kwe(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class hgt{constructor(e,t,n,r,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=o}}function Rg(i,e=!0){const t=[0];let n=1;for(let r=0,o=i.length;r126)&&(s=!1)}const a=new hgt(kwe(i),n,r,o,s);return i.length=0,a}class _l{constructor(e,t,n,r,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=o}}class P0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class ggt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==on&&e.iterate(e.root,n=>(n!==on&&this._pieces.push(n.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 pgt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let r=0;r=e){n[r]=null,t=!0;continue}}if(t){const r=[];for(const o of n)o!==null&&r.push(o);this._cache=r}}}class mgt{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new P0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=on,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Rg(e[o].buffer));const a=new _l(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),r=this.rbInsertRight(r,a)}this._searchCache=new pgt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=yg,n=t-Math.floor(t/3),r=n*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new P0(l,Rg(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 ggt(this,e)}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==on;)if(r.left!==on&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const r=e;for(;t!==on;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(n+1,1),a=r-s;return new le(n+1,a+1)}return new le(n+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===on){const o=this.getOffsetAt(n+1,1),s=r-e-o;return new le(n+1,s+1)}else t=t.right;return new le(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const r=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=r.substring(o+e.remainder,o+n.piece.length);for(n=n.next();n!==on;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",r=!1;return this.iterate(this.root,o=>{if(o===on)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fS+g,t.reset(0)):(_=h.buffer,y=S=>S,t.reset(g));do if(m=t.next(_),m){if(y(m.index)>=p)return u;this.positionInBuffer(e,y(m.index)-f,v);const S=this.getLineFeedCnt(e.piece.bufferIndex,o,v),L=v.line===o.line?v.column-o.column+r:v.column+1,E=L+m[0].length;if(d[u++]=I0(new W(n+S,L,n+S,E),m,l),y(m.index)+m[0].length>=p||u>=c)return u}while(m);return u}findMatchesLineByLine(e,t,n,r){const o=[];let s=0;const a=new gy(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,n,r,s,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=v[u.line+p],S=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,S,u,this.positionInBuffer(f,y-_),t,n,r,s,o),s>=r)return o;h+=p}const m=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(m,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,m,s,o,n,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(m),h,m,s,o,n,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,m=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,p,s,o,n,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,r,s,o),o}_findMatchesInLine(e,t,n,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||kY(u,n,g,p,f))&&(a[s++]=new hI(new W(r,p+1+o,r,p+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=I0(new W(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==on){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new _l(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const p={line:d.start.line+1,column:0};d=new _l(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(r,o-1)===13){const p=this.positionInBuffer(r,o-1);this.deleteNodeTail(r,p),t="\r"+t,r.piece.length===0&&u.push(r)}else this.deleteNodeTail(r,c);else this.deleteNodeTail(r,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(r,d);let f=r;for(let g=0;g=0;s--)o=this.rbInsertLeft(o,r[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]);let o=r;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;const o=r[n.line+1],s=r[n.line]+n.column;if(o>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tyg){const u=[];for(;e.length>yg;){const h=e.charCodeAt(yg-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,yg-1),e=e.substring(yg-1)):(f=e.substring(0,yg),e=e.substring(yg));const g=Rg(f);u.push(new _l(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new M0(f,g))}const d=Rg(e);return u.push(new _l(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 M0(e,d)),u}let t=this._buffers[0].buffer.length;const n=Rg(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=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==on;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==on;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,r=this.positionInBuffer(e,t),o=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[o]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-r,u=a-o,d=n.length+u;e.piece=new _l(n.bufferIndex,n.start,s,l,d),Ig(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-r,u=o-l,d=n.length+u;e.piece=new _l(n.bufferIndex,s,n.end,a,d),Ig(this,e,u,c)}shrinkNode(e,t,n){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new _l(r.bufferIndex,r.start,c,u,d),Ig(this,e,d-a,u-l);const h=new _l(r.bufferIndex,n,s,this.getLineFeedCnt(r.bufferIndex,n,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]);let o=r;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;const o=r[n.line+1],s=r[n.line]+n.column;if(o>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tyg){const u=[];for(;e.length>yg;){const h=e.charCodeAt(yg-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,yg-1),e=e.substring(yg-1)):(f=e.substring(0,yg),e=e.substring(yg));const g=Rg(f);u.push(new _l(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new P0(f,g))}const d=Rg(e);return u.push(new _l(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 P0(e,d)),u}let t=this._buffers[0].buffer.length;const n=Rg(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=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==on;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==on;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,r=this.positionInBuffer(e,t),o=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[o]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-r,u=a-o,d=n.length+u;e.piece=new _l(n.bufferIndex,n.start,s,l,d),Ig(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-r,u=o-l,d=n.length+u;e.piece=new _l(n.bufferIndex,s,n.end,a,d),Ig(this,e,u,c)}shrinkNode(e,t,n){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new _l(r.bufferIndex,r.start,c,u,d),Ig(this,e,d-a,u-l);const h=new _l(r.bufferIndex,n,s,this.getLineFeedCnt(r.bufferIndex,n,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Rg(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==on;)if(n.left!==on&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(o+t-1,s),nodeStartOffset:r}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2);if(o+t-1<=n.piece.length)return{node:n,remainder:o+t-1,nodeStartOffset:r};t-=n.piece.length-o;break}else e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==on;){if(n.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,o),nodeStartOffset:s}}else if(n.piece.length>=t-1){const o=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:o}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.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===on||e.piece.lineFeedCnt===0)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,o=n[r]+t.start.column;return r===n.length-1||n[r+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===on||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 n=[],r=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new _l(e.piece.bufferIndex,e.piece.start,o,a,s),Ig(this,e,-1,-1),e.piece.length===0&&n.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 _l(t.piece.bufferIndex,l,t.piece.end,u,c),Ig(this,t,-1,-1),t.piece.length===0&&n.push(t);const d=this.createNewPieces(`\r `);this.rbInsertRight(e,d[0]);for(let h=0;hm.sortIndex-v.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,m)=>m.lineNumber-p.lineNumber),g=[];for(let p=0,m=d.length;p0&&d[p-1].lineNumber===v)continue;const _=d[p].oldContent,y=this.getLineContent(v);y.length===0||y===_||Js(y)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new Lat(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,r=e[e.length-1].range,o=new W(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=m.endLineNumber,a=m.endColumn}const c=l.join(""),[u,d,h]=n_(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cw._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new W(c,u,c,u+l.firstLineLength):d=new W(c,u,c+h-1,l.lastLineLength+1)}else d=new W(c,u,c,u);n=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const n=W.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=W.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class vgt{constructor(e,t,n,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,n){let r=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;pm.sortIndex-v.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,m)=>m.lineNumber-p.lineNumber),g=[];for(let p=0,m=d.length;p0&&d[p-1].lineNumber===v)continue;const _=d[p].oldContent,y=this.getLineContent(v);y.length===0||y===_||Js(y)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new Lat(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,r=e[e.length-1].range,o=new W(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=m.endLineNumber,a=m.endColumn}const c=l.join(""),[u,d,h]=i_(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cw._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new W(c,u,c,u+l.firstLineLength):d=new W(c,u,c+h-1,l.lastLineLength+1)}else d=new W(c,u,c,u);n=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const n=W.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=W.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class vgt{constructor(e,t,n,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` `:`\r `:n>t/2?`\r `:` `}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,s=n.length;o=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=fgt(this._tmpLineStarts,e);this.chunks.push(new M0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Uw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=u1e(e)))}finish(e=!0){return this._finish(),new vgt(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=Rg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class _gt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=bgt(n,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const n=[];for(let r=0;r0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new Cgt(e,[t]))}finalize(){return this._tokens}}class ygt{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new jz(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class wgt extends ygt{constructor(e,t,n,r){super(e,t),this._textModel=n,this._languageIdCodec=r}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=dL(this._languageIdCodec,n,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=dL(this._languageIdCodec,r,this.tokenizationSupport,s,!0,n),l=new Io(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+n+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=dL(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Io(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class xgt{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new bn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new bn(n.start,e):this._ranges.splice(t,1,new bn(n.start,e),new bn(e+1,n.endExclusive))}}addRange(e){bn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function dL(i,e,t,n,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(n,r,o.clone())}catch(a){nn(a)}return s||(s=k3(i.encodeLanguageId(e),o)),Io.convertToEndOffset(s.tokens,n.length),s}class Lgt{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,v1e(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new vn(e,t))}}const Mg=new Uint32Array(0).buffer;class rf{static deleteBeginning(e,t){return e===null||e===Mg?e:rf.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Mg)return e;const n=Kg(e),r=n[n.length-2];return rf.delete(e,t,r)}static delete(e,t,n){if(e===null||e===Mg||t===n)return e;const r=Kg(e),o=r.length>>>1;if(t===0&&r[r.length-2]===n)return Mg;const s=Io.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(nu&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===Mg)return e;if(e===Mg)return t;if(e===null)return e;if(t===null)return null;const n=Kg(e),r=Kg(t),o=r.length>>>1,s=new Uint32Array(n.length+r.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=Io.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let r=null;if(t1&&(o=fs.getLanguageId(r[1])!==e),!o)return Mg}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=Jle(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const n=[];for(let r=0;r=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=rf.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=rf.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let r=null;n=this._len)){if(t===0){this._lineTokens[r]=rf.insert(this._lineTokens[r],e.column-1,n);return}this._lineTokens[r]=rf.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=rf.insert(this._lineTokens[r],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let r=0,o=e.length;r>>0}class dZ{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 n=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;n=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;on.endLineNumber){r=r||{index:o};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumbern.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(n);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=n3(this._pieces,r.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const r=dZ._findFirstPieceWithLine(n,e),o=n[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~v>>>0;for(;lt)r=o-1;else{for(;o>n&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return n}acceptEdit(e,t,n,r,o){for(const s of this._pieces)s.acceptEdit(e,t,n,r,o)}}class hO extends lwe{constructor(e,t,n,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new dZ(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new ae),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new ae),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new ae),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Egt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,r,o]=n_(t.text);this._semanticTokens.acceptEdit(t.range,n,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Zi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=hO._findLanguageBoundaries(r,o),l=nI(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=hO._findLanguageBoundaries(r,o-1),d=nI(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),n.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 n=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new Dgt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new jz(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=gr.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return nn(l),[null,null]}return[s,a]},[r,o]=n();if(r&&o?this._tokenizer=new wgt(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Lgt(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new AI(this._languageIdCodec),this._debugBackgroundStates=new jz(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=n_(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=vn.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new Uz,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,n;const r=new Uz;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new le(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,n)}get hasTokens(){return this._tokens.hasTokens}}class Dgt extends me{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new mi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){lr(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()}}const z3=Sn("undoRedoService");class Nwe{constructor(e,t){this.resource=e,this.elements=t}}class oS{constructor(){this.id=oS._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}oS._ID=0;oS.None=new oS;class mf{constructor(){this.id=mf._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}mf._ID=0;mf.None=new mf;var Igt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},C0;function kgt(i){const e=new Twe;return e.acceptChunk(i),e.finish()}function Tgt(i){const e=new Twe;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function ece(i,e){let t;return typeof i=="string"?t=kgt(i):Sat(i)?t=Tgt(i):t=i,t.create(e)}let l2=0;const Ngt=999,Rgt=1e4;class Mgt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=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,n+=r.length),n>=64*1024)return e.join("")}while(!0)}}const hL=()=>{throw new Error("Invalid change accessor")};let Gf=C0=class extends me{static resolveOptions(e,t){if(t.detectIndentation){const n=jle(e,t.tabSize,t.insertSpaces);return new HM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new HM(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 td(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,n,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new ae),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Wgt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new ae),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new ae),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new ae),this._eventEmitter=this._register(new $gt),this._languageSelectionListener=this._register(new Vo),this._deltaDecorationCallCnt=0,this._attachedViews=new Hgt,l2++,this.id="$model"+l2,this.isForSimpleWidget=n.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=Ft.parse("inmemory://model/"+l2):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=ece(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=C0.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Bft(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Rht(this,this._languageConfigurationService)),this._decorationProvider=this._register(new $ft(this)),this._tokenizationTextModelPart=new hO(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new W(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>C0.LARGE_FILE_SIZE_THRESHOLD||d>C0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>C0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>C0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=d1e(l2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new tce,this._commandManager=new aZ(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cw([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=me.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new pb(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw iu();const{textBuffer:t,disposable:n}=ece(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new tce,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new sw([new cft],this._versionId,!1,!1),this._createContentChanged2(new W(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let o=0,s=n.length;o=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=fgt(this._tmpLineStarts,e);this.chunks.push(new P0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Uw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=u1e(e)))}finish(e=!0){return this._finish(),new vgt(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=Rg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class _gt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=bgt(n,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const n=[];for(let r=0;r0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new Cgt(e,[t]))}finalize(){return this._tokens}}class ygt{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new jz(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class wgt extends ygt{constructor(e,t,n,r){super(e,t),this._textModel=n,this._languageIdCodec=r}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=dL(this._languageIdCodec,n,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=dL(this._languageIdCodec,r,this.tokenizationSupport,s,!0,n),l=new Io(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+n+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=dL(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Io(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class xgt{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new bn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new bn(n.start,e):this._ranges.splice(t,1,new bn(n.start,e),new bn(e+1,n.endExclusive))}}addRange(e){bn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function dL(i,e,t,n,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(n,r,o.clone())}catch(a){nn(a)}return s||(s=k3(i.encodeLanguageId(e),o)),Io.convertToEndOffset(s.tokens,n.length),s}class Lgt{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,v1e(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new vn(e,t))}}const Mg=new Uint32Array(0).buffer;class rf{static deleteBeginning(e,t){return e===null||e===Mg?e:rf.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Mg)return e;const n=Kg(e),r=n[n.length-2];return rf.delete(e,t,r)}static delete(e,t,n){if(e===null||e===Mg||t===n)return e;const r=Kg(e),o=r.length>>>1;if(t===0&&r[r.length-2]===n)return Mg;const s=Io.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(nu&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===Mg)return e;if(e===Mg)return t;if(e===null)return e;if(t===null)return null;const n=Kg(e),r=Kg(t),o=r.length>>>1,s=new Uint32Array(n.length+r.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=Io.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let r=null;if(t1&&(o=fs.getLanguageId(r[1])!==e),!o)return Mg}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=Jle(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const n=[];for(let r=0;r=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=rf.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=rf.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let r=null;n=this._len)){if(t===0){this._lineTokens[r]=rf.insert(this._lineTokens[r],e.column-1,n);return}this._lineTokens[r]=rf.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=rf.insert(this._lineTokens[r],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let r=0,o=e.length;r>>0}class dZ{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 n=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;n=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;on.endLineNumber){r=r||{index:o};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumbern.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(n);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=n3(this._pieces,r.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const r=dZ._findFirstPieceWithLine(n,e),o=n[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~v>>>0;for(;lt)r=o-1;else{for(;o>n&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return n}acceptEdit(e,t,n,r,o){for(const s of this._pieces)s.acceptEdit(e,t,n,r,o)}}class hO extends lwe{constructor(e,t,n,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new dZ(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new ae),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new ae),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new ae),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Egt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,r,o]=i_(t.text);this._semanticTokens.acceptEdit(t.range,n,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Qi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=hO._findLanguageBoundaries(r,o),l=nI(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=hO._findLanguageBoundaries(r,o-1),d=nI(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),n.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 n=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new Dgt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new jz(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=gr.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return nn(l),[null,null]}return[s,a]},[r,o]=n();if(r&&o?this._tokenizer=new wgt(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Lgt(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new AI(this._languageIdCodec),this._debugBackgroundStates=new jz(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=i_(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=vn.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new Uz,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,n;const r=new Uz;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new le(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,n)}get hasTokens(){return this._tokens.hasTokens}}class Dgt extends me{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new mi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){lr(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()}}const z3=Sn("undoRedoService");class Nwe{constructor(e,t){this.resource=e,this.elements=t}}class oS{constructor(){this.id=oS._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}oS._ID=0;oS.None=new oS;class mf{constructor(){this.id=mf._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}mf._ID=0;mf.None=new mf;var Igt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},y0;function kgt(i){const e=new Twe;return e.acceptChunk(i),e.finish()}function Tgt(i){const e=new Twe;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function ece(i,e){let t;return typeof i=="string"?t=kgt(i):Sat(i)?t=Tgt(i):t=i,t.create(e)}let l2=0;const Ngt=999,Rgt=1e4;class Mgt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=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,n+=r.length),n>=64*1024)return e.join("")}while(!0)}}const hL=()=>{throw new Error("Invalid change accessor")};let Gf=y0=class extends me{static resolveOptions(e,t){if(t.detectIndentation){const n=jle(e,t.tabSize,t.insertSpaces);return new HM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new HM(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 td(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,n,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new ae),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Wgt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new ae),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new ae),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new ae),this._eventEmitter=this._register(new $gt),this._languageSelectionListener=this._register(new Vo),this._deltaDecorationCallCnt=0,this._attachedViews=new Hgt,l2++,this.id="$model"+l2,this.isForSimpleWidget=n.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=Ft.parse("inmemory://model/"+l2):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=ece(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=y0.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Bft(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Rht(this,this._languageConfigurationService)),this._decorationProvider=this._register(new $ft(this)),this._tokenizationTextModelPart=new hO(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new W(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>y0.LARGE_FILE_SIZE_THRESHOLD||d>y0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>y0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>y0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=d1e(l2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new tce,this._commandManager=new aZ(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cw([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=me.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new mb(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw iu();const{textBuffer:t,disposable:n}=ece(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new tce,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new sw([new cft],this._versionId,!1,!1),this._createContentChanged2(new W(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new sw([new hft],this._versionId,!1,!1),this._createContentChanged2(new W(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,r=t.length;n0}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 n=this._buffer.getLineCount();for(let r=1;r<=n;r++){const o=this._buffer.getLineLength(r);o>=Rgt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,n=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new HM({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=jle(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),rO(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(c1e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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 Zi("Operation would exceed heap memory limits");const n=this.getFullModelRange(),r=this.getValueInRange(n,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new Mgt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n,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 Zi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Zi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Zi("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 Zi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Zi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Zi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,r=e.startColumn;let o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(o);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return n===o&&r===s&&a===c&&l===u&&e instanceof W&&!(e instanceof Et)?e:new W(o,s,c,u)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const r=this._buffer.getLineCount();if(e>r)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(Do(s))return!1}return!0}_validatePosition(e,t,n){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(r<1)return new le(1,1);if(r>s)return new le(s,this.getLineMaxColumn(s));if(o<=1)return new le(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new le(r,a);if(n===1){const l=this._buffer.getLineCharCode(r,o-2);if(Do(l))return new le(r,o-1)}return new le(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof le&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,r,0)||!this._isValidPosition(o,s,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(n,r-2):0,l=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=Do(a),u=Do(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof W&&!(e instanceof Et)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),o=n.lineNumber,s=n.column,a=r.lineNumber,l=r.column;{const c=s>1?this._buffer.getLineCharCode(o,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=Do(c),h=Do(u);return!d&&!h?new W(o,s,a,l):o===a&&s===l?new W(o,s-1,a,l-1):d&&h?new W(o,s-1,a,l+1):d?new W(o,s-1,a,l):new W(o,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new W(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)}findMatches(e,t,n,r,o,s,a=Ngt){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>W.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>W.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!n&&e.indexOf(` -`)<0){const h=new b0(e,n,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>UR.findMatches(this,new b0(e,n,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` -`)<0){const c=new b0(e,n,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new W(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return UR.findNextMatch(this,new b0(e,n,r,o),a,s),h.length>0||(d=new W(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return UR.findNextMatch(this,new b0(e,n,r,o),a,s)}findPreviousMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return UR.findPreviousMatch(this,new b0(e,n,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new sw([new hft],this._versionId,!1,!1),this._createContentChanged2(new W(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,r=t.length;n0}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 n=this._buffer.getLineCount();for(let r=1;r<=n;r++){const o=this._buffer.getLineLength(r);o>=Rgt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,n=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new HM({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=jle(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),rO(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(c1e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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 Qi("Operation would exceed heap memory limits");const n=this.getFullModelRange(),r=this.getValueInRange(n,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new Mgt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n,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 Qi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Qi("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 Qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,r=e.startColumn;let o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(o);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return n===o&&r===s&&a===c&&l===u&&e instanceof W&&!(e instanceof Et)?e:new W(o,s,c,u)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const r=this._buffer.getLineCount();if(e>r)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(Do(s))return!1}return!0}_validatePosition(e,t,n){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(r<1)return new le(1,1);if(r>s)return new le(s,this.getLineMaxColumn(s));if(o<=1)return new le(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new le(r,a);if(n===1){const l=this._buffer.getLineCharCode(r,o-2);if(Do(l))return new le(r,o-1)}return new le(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof le&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,r,0)||!this._isValidPosition(o,s,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(n,r-2):0,l=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=Do(a),u=Do(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof W&&!(e instanceof Et)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),o=n.lineNumber,s=n.column,a=r.lineNumber,l=r.column;{const c=s>1?this._buffer.getLineCharCode(o,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=Do(c),h=Do(u);return!d&&!h?new W(o,s,a,l):o===a&&s===l?new W(o,s-1,a,l-1):d&&h?new W(o,s-1,a,l+1):d?new W(o,s-1,a,l):new W(o,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new W(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)}findMatches(e,t,n,r,o,s,a=Ngt){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>W.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>W.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!n&&e.indexOf(` +`)<0){const h=new C0(e,n,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>UR.findMatches(this,new C0(e,n,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` +`)<0){const c=new C0(e,n,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new W(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return UR.findNextMatch(this,new C0(e,n,r,o),a,s),h.length>0||(d=new W(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return UR.findNextMatch(this,new C0(e,n,r,o),a,s)}findPreviousMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return UR.findPreviousMatch(this,new C0(e,n,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof O9?e:new O9(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,r=e.length;n({range:this.validateRange(a.range),text:a.text}));let s=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){u=!0;break}}if(!u){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){d=!1;break}}if(d){const h=new W(c,1,c,u);t.push(new O9(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,r)}_applyUndo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new W(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,n,r)}_applyRedo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new W(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,n,r)}_applyUndoRedoEdits(e,t,n,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;T--){const M=f+T,P=y+T;k.takeFromEndWhile(R=>R.lineNumber>P);const N=k.takeFromEndWhile(R=>R.lineNumber===P);a.push(new Ole(M,this.getLineContent(P),N))}if(vG.lineNumber<$),R[B]=T.takeWhile(G=>G.lineNumber===$)}a.push(new dft(M+1,f+m,O,R))}l+=_}this._emitContentChangedEvent(new sw(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const n=Array.from(e).map(r=>new Ole(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new dwe(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,ice(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(n)}catch(o){nn(o)}return n.addDecoration=hL,n.changeDecoration=hL,n.changeDecorationOptions=hL,n.removeDecoration=hL,n.deltaDecorations=hL,r}deltaDecorations(e,t,n=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."),nn(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:nce[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(nce[n]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,r=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new W(a,1,l,c),d=this._getDecorationsInRange(u,n,r,o);return QH(d,this._decorationProvider.getDecorationsInRange(u,n,r)),d}getDecorationsInRange(e,t=0,n=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,o);return QH(a,this._decorationProvider.getDecorationsInRange(s,t,n,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),n=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return _h.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,n,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const r=!!(n.options.overviewRuler&&n.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const s=r!==o,a=Agt(t)!==YM(n);s||a?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;athis._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 Pgt(this.getLineContent(e))+1}};Gf._MODEL_SYNC_LIMIT=50*1024*1024;Gf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Gf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Gf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Gf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ts.tabSize,indentSize:Ts.indentSize,insertSpaces:Ts.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ts.trimAutoWhitespace,largeFileOptimizations:Ts.largeFileOptimizations,bracketPairColorizationOptions:Ts.bracketPairColorizationOptions};Gf=C0=Igt([r7(4,z3),r7(5,qi),r7(6,Ti)],Gf);function Pgt(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function o7(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function Agt(i){return!!i.after||!!i.before}function YM(i){return!!i.options.after||!!i.options.before}class tce{constructor(){this._decorationsTree0=new t7,this._decorationsTree1=new t7,this._injectedTextDecorationsTree=new t7}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,n,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,n,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,n,r,o){const s=e.getVersionId(),a=this._search(t,n,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,r,o){if(n)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){YM(e)?this._injectedTextDecorationsTree.insert(e):o7(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){YM(e)?this._injectedTextDecorationsTree.delete(e):o7(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){YM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):o7(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,r){this._decorationsTree0.acceptReplace(e,t,n,r),this._decorationsTree1.acceptReplace(e,t,n,r),this._injectedTextDecorationsTree.acceptReplace(e,t,n,r)}}function Vh(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class Rwe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Ogt extends Rwe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Cc.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class Fgt{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:Uf.Center,this.persistLane=e==null?void 0:e.persistLane}}class Bgt extends Rwe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?Ce.fromHex(e):t.getColor(e.id)}}class o_{static from(e){return e instanceof o_?e:new o_(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 an{static register(e){return new an(e)}static createDynamic(e){return new an(e)}constructor(e){var t,n,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Vh(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Vh(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Ogt(e.overviewRuler):null,this.minimap=e.minimap?new Bgt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Fgt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Vh(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Vh(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Vh(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?lrt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Vh(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Vh(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Vh(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Vh(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Vh(e.afterContentClassName):null,this.after=e.after?o_.from(e.after):null,this.before=e.before?o_.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}an.EMPTY=an.register({description:"empty"});const nce=[an.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),an.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),an.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),an.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function ice(i){return i instanceof an?i:an.createDynamic(i)}class Wgt extends me{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new ae),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===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,n;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((n=e.overviewRuler)===null||n===void 0)&&n.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 $gt extends me{constructor(){super(),this._fastEmitter=this._register(new ae),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new ae),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class Hgt{constructor(){this._onDidChangeVisibleRanges=new ae,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Vgt(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 Vgt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(r=>new vn(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class hZ{static create(e){return new hZ(e.get(133),e.get(132))}constructor(e,t){this.classifier=new zgt(e,t)}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=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 Kz=[],Gz=[];function Ugt(i,e,t,n,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=Mwe(t,n,r,o,s),f=r-h,g=Kz,p=Gz;let m=0,v=0,_=0,y=r;const S=u.length;let L=0;if(L>=0){let E=Math.abs(d[L]-y);for(;L+1=E)break;E=D,L++}}for(;LE&&(E=v,D=_);let k=0,T=0,M=0,P=0;if(D<=y){let R=D,O=E===0?0:t.charCodeAt(E-1),B=E===0?0:i.get(O),$=!0;for(let G=E;Gv&&qz(O,B,j,ie,c)&&(k=U,T=R),R+=Y,R>y){U>v?(M=U,P=R-Y):(M=G+1,P=R),R-T>f&&(k=0),$=!1;break}O=j,B=ie}if($){m>0&&(g[m]=u[u.length-1],p[m]=d[u.length-1],m++);break}}if(k===0){let R=D,O=t.charCodeAt(E),B=i.get(O),$=!1;for(let G=E-1;G>=v;G--){const U=G+1,j=t.charCodeAt(G);if(j===9){$=!0;break}let ie,Y;if(Fb(j)?(G--,ie=0,Y=2):(ie=i.get(j),Y=Xv(j)?o:1),R<=y){if(M===0&&(M=U,P=R),R<=y-f)break;if(qz(j,ie,O,B,c)){k=U,T=R;break}}R-=Y,O=j,B=ie}if(k!==0){const G=f-(P-T);if(G<=n){const U=t.charCodeAt(M);let j;Do(U)?j=2:j=YE(U,P,n,o),G-j<0&&(k=0)}}if($){L--;continue}}if(k===0&&(k=M,T=P),k<=v){const R=t.charCodeAt(v);Do(R)?(k=v+2,T=_+2):(k=v+1,T=_+YE(R,_,n,o))}for(v=k,g[m]=k,_=T,p[m]=T,m++,y=T+f;L<0||L=N)break;N=R,L++}}return m===0?null:(g.length=m,p.length=m,Kz=e.breakOffsets,Gz=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function jgt(i,e,t,n,r,o,s,a){const l=_h.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(T=>T.options),u=t.map(T=>T.column-1)):(c=null,u=null),r===-1)return c?new jE(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new jE(u,c,[l.length],[],0):null;const h=a==="keepAll",f=Mwe(l,n,r,o,s),g=r-f,p=[],m=[];let v=0,_=0,y=0,S=r,L=l.charCodeAt(0),E=i.get(L),D=YE(L,0,n,o),k=1;Do(L)&&(D+=1,L=l.charCodeAt(1),E=i.get(L),k++);for(let T=k;TS&&((_===0||D-y>g)&&(_=M,y=D-R),p[v]=_,m[v]=y,v++,S=y+g,_=0),L=P,E=N}return v===0&&(!t||t.length===0)?null:(p[v]=d,m[v]=D,new jE(u,c,p,m,f))}function YE(i,e,t,n){return i===9?t-e%t:Xv(i)||i<32?n:1}function rce(i,e){return e-i%e}function qz(i,e,t,n,r){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!r&&e===3&&n!==2||!r&&n===3&&e!==1)}function Mwe(i,e,t,n,r){let o=0;if(r!==0){const s=Js(i);if(s!==-1){for(let l=0;lt&&(o=0)}}return o}class fO{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Zo(new W(1,1,1,1),0,0,new le(1,1),0),new Zo(new W(1,1,1,1),0,0,new le(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 $n(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Et.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Et.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,r){return t.equals(n)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,r,n,s),l=this._validatePositionWithCache(e,o,r,a);return n.equals(s)&&r.equals(a)&&o.equals(l)?t:new Zo(W.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=fO._validateViewState(e.viewModel,n)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Zo(r,t.selectionStartKind,o,s,a)}else{if(!n)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Zo(r,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const r=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Zo(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new le(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new le(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new W(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Zo(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class oce{constructor(e){this.context=e,this.cursors=[new fO(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 Pat(this.cursors,nu(e=>e.viewState.position,le.compare)).viewState.position}getBottomMostViewPosition(){return Mat(this.cursors,nu(e=>e.viewState.position,le.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($n.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,n=e.length;if(tn){const r=t-n;for(let o=0;o=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 n=0,r=e.length;nn.selection,W.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class sce{constructor(e,t,n,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=r}}class Kgt{constructor(){this.type=0}}class Ggt{constructor(){this.type=1}}class qgt{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Xgt{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class i0{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 c2{constructor(){this.type=5}}class Ygt{constructor(e){this.type=6,this.isFocused=e}}class Zgt{constructor(){this.type=7}}class u2{constructor(){this.type=8}}class Pwe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Xz{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Yz{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class ZM{constructor(e,t,n,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Qgt{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 Jgt{constructor(e){this.theme=e,this.type=14}}class ept{constructor(e){this.type=15,this.ranges=e}}class tpt{constructor(){this.type=16}}let npt=class{constructor(){this.type=17}};class ipt extends me{constructor(){super(),this._onEvent=this._register(new ae),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const n of t)n.handleEvents(e)}}}class rpt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class fZ{constructor(e,t,n,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,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 fZ(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class gZ{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 gZ(this.oldHasFocus,e.hasFocus)}}class pZ{constructor(e,t,n,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new pZ(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class opt{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class spt{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class gO{constructor(e,t,n,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;ts&&(r=r.slice(0,s),o=!0);const a=ZE.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=W.fromPositions(a[0],a[0]),e.emitViewEvent(new ZM(t,n,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,r=t.length;n0){const o=$n.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,$n.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,r){this.setStates(e,t,r,$n.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],r=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,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,n,r,o){const s=ZE.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Xgt(l,a,n)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new gO(c,a,u,s.modelVersionId,t||"keyboard",n,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,r=e.length;n=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(n)),o&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(o)for(let d=0,h=o.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,r=0){if(this.context.cursorConfig.readOnly)return;const o=ZE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){nn(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,r,o,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return ace.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new QE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(sr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const r=t.length;let o=0;for(;o{const c=l.getPosition();return new Et(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(sr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,r,o))},e,s)}paste(e,t,n,r,o){this._executeEdit(()=>{this._executeEditOperation(sr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(zb.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Ga(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new Ga(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class ZE{static from(e,t){return new ZE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class ppt{static executeCommands(e,t,n){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,n);for(let s=0,a=r.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),m=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new Et(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):new Et(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{W.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=Et.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,m=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=m,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return nn(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,r)=>-W.compareRangesUsingEnds(n.range,r.range));const t={};for(let n=1;no.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class mpt{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class QE{static _capture(e,t){const n=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;n.push(new mpt(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return n}constructor(e,t){this._original=QE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=QE._capture(e,t);if(!n||this._original.length!==n.length)return null;const r=[];for(let o=0,s=this._original.length;oZw,tokenizeEncoded:(i,e,t)=>k3(0,t)};async function vpt(i,e,t){if(!t)return cce(e,i.languageIdCodec,lce);const n=await gr.getOrCreate(t);return cce(e,i.languageIdCodec,n||lce)}function _pt(i,e,t,n,r,o,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),m--;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:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>r||l>=r)break}return a+="
",a}function cce(i,e,t){let n='
';const r=ng(i);let o=t.getInitialState();for(let s=0,a=r.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,o);Io.convertToEndOffset(c.tokens,l.length);const d=new Io(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${OA(l.substring(h,m))}`,h=m}o=c.endState}return n+="
",n}class bpt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,n=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,r)}}class Cpt{constructor(e,t,n,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=r,this.minWidth=o,this.prefixSum=0}}let Awe=class Zz{constructor(e,t,n,r){this._instanceId=d1e(++Zz.INSTANCE_COUNT),this._pendingChanges=new bpt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=r}static findInsertionIndex(e,t,n){let r=0,o=e.length;for(;r>>1;t===e[s].afterLineNumber?n{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Cpt(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.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 n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of n)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Zz.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let n=0,r=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,r=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,n=this._lineHeight;let r=1,o=t;for(;r=a+n)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],m=e+(t-e)/2;let v=-1;for(let L=r;L<=s;L++){if(v===-1){const E=d,D=d+n;(E<=m&&mm)&&(v=L)}for(d+=n,p[L-r]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}v===-1&&(v=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=r,S=s;return yt&&S--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:S}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,n+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(n),o=this.getHeightForWhitespaceIndex(n);if(e>=r+o)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:n,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(n<0)return[];const o=[];for(let s=n;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};Awe.INSTANCE_COUNT=0;const ypt=125;class eE{constructor(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=r,this.scrollHeight=Math.max(n,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class wpt extends me{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new ae),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new eE(0,0,0,0),this._scrollable=this._register(new XS({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const n=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(n||r)&&this._onDidContentSizeChange.fire(new fZ(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 Spt extends me{constructor(e,t,n){super(),this._configuration=e;const r=this._configuration.options,o=r.get(144),s=r.get(84);this._linesLayout=new Awe(t,r.get(67),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new wpt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new eE(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?ypt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const n=t.get(84);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(144)){const n=t.get(144),r=n.contentWidth,o=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new eE(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(114)&&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(103);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,n){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(105)?o+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,n)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new eE(t,e.contentWidth,n,this._getContentHeight(t,n,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Yae(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Yae(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(145),r=e.get(50),o=e.get(144);if(n.isViewportWrapping){const s=e.get(73);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(104)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new eE(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);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 n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class xpt{constructor(e,t,n,r,o){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=r,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let n=this._decorationsCache[t];if(!n){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new le(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new le(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new W(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);n=new Cye(s,o),this._decorationsCache[t]=n}return n}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,n=!1){const r=new W(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,IA(this.configuration.options),t,n),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;ut===1)}function _Z(i,e){return Owe(i,e.range,t=>t===2)}function Owe(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const r=i.tokenization.getLineTokens(n),o=n===e.startLineNumber,s=n===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function s7(i,e){return i===null?e?pO.INSTANCE:mO.INSTANCE:new Lpt(i,e)}class Lpt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,n){this._assertVisible();const r=n>0?this._projectionData.breakOffsets[n-1]:0,o=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new _h(0,0,c+1,this._projectionData.injectionOptions[u],0));s=_h.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return n>0&&(s=uce(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const r=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],r),r[0]}getViewLinesData(e,t,n,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(v0?l.wrappedTextIndentLength:0,k=D+Math.max(S-v,0),T=D+Math.min(L-v,_-v);k!==T&&m.push(new Mlt(k,T,E.inlineClassName,E.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Io.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?r.wrappedTextIndentLength:0,s=n>0?r.breakOffsets[n-1]:0,a=r.breakOffsets[n],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();n>0&&(c=uce(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=a7.length)for(let e=1;e<=i;e++)a7[e]=Ept(e);return a7[i]}function Ept(i){return new Array(i+1).join(" ")}class Dpt{constructor(e,t,n,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new kpt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=n.length,s=this.createLineBreaksComputer(),a=new Op(_h.fromDecorations(r));for(let p=0;pv.lineNumber===p+1);s.addRequest(n[p],m,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(W.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&m<=h,_=s7(l[p],!v);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new gat(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=Ipt(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(W.compareRangesUsingStarts);if(n.length===r.length){let h=!1;for(let f=0;f({range:h,options:an.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}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,n,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,r=t.remainder;return new dce(n+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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new le(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new le(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),m=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return m.lineNumber===u.modelLineWrappedLineIdx?new Z0(f.visibleColumn,g,f.className,new VE(f.horizontalLine.top,p.column),-1,-1):m.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=n.lineNumber-1,c=r.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const m=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=v-m+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(y=m===0?1:2),s.push(_),a.push(y),u===null&&(u=new le(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,n,l),o+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new le(o+1,u)).equals(n)?new le(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new W(n.lineNumber,n.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),r=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new le(n.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new W(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,r=!1,o=!1){const s=this.model.validatePosition(new le(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new le(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return W.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new W(n.lineNumber,n.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new W(s.lineNumber,1,a.lineNumber,a.column),t,n,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new le(p+1,p===c?s.column:1));else if(d!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new W(d.lineNumber,d.column,p,v),t,n,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new W(d.lineNumber,d.column,a.lineNumber,a.column),t,n,r)),d=null),l.sort((p,m)=>{const v=W.compareRangesUsingStarts(p.range,m.range);return v===0?p.idm.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const m=p.id;g!==m&&(g=m,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Ipt(i){if(i.length===0)return[];const e=i.slice();e.sort(W.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;or+1?(t.push(new W(n,1,r,1)),n=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new W(n,1,r,1)),t}class dce{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class hce{constructor(e,t){this.modelRange=e,this.viewLines=t}}class kpt{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,n,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,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 Tpt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Npt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new Xz(t,n)}onModelLinesInserted(e,t,n,r){return new Yz(t,n)}onModelLineChanged(e,t,n){return[!1,new Pwe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,r=new Array(n);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const r0=Uf.Right;class Rpt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*r0/8))}reset(e){const t=Math.ceil((e+1)*r0/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=bZ.create(this.model),this.glyphLanes=new Rpt(0),this.model.isTooLargeForTokenization())this._lines=new Tpt(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(138),f=u.get(145),g=u.get(137),p=u.get(129);this._lines=new Dpt(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new gpt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Spt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Qgt(u)),this._eventDispatcher.emitOutgoingEvent(new pZ(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new xpt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(DT.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new tpt)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Jgt(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new W(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 Ygt(e)),this._eventDispatcher.emitOutgoingEvent(new gZ(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Kgt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Ggt)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new le(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new gce(t,this._viewportStart.startLineDelta)}return new gce(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(138),a=r.get(145),l=r.get(137),c=r.get(129);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new c2),e.emitViewEvent(new u2),e.emitViewEvent(new i0(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new i0(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new i0(null))),e.emitViewEvent(new qgt(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),v1.shouldRecreate(t)&&(this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof pb?e.rawContentChangedEvent.changes:e.changes,a=e instanceof pb?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new Op(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new c2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,p,m]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),m&&(n.emitViewEvent(m),this.viewLayout.onLinesDeleted(m.fromLineNumber,m.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(n.emitViewEvent(new u2),n.emitViewEvent(new i0(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const r=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof pb&&n.emitOutgoingEvent(new dpt(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,r=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new Zgt),this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new upt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new cpt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new c2),t.emitViewEvent(new u2),t.emitViewEvent(new i0(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new hpt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new i0(e)),this._eventDispatcher.emitOutgoingEvent(new lpt(e))}))}setHiddenAreas(e,t){var n;this.hiddenAreasModel.setHiddenAreas(t,e);const r=this.hiddenAreasModel.getMergedRanges();if(r===this.previousHiddenAreas)return;this.previousHiddenAreas=r;const o=this._captureStableViewport();let s=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(r),s&&(a.emitViewEvent(new c2),a.emitViewEvent(new u2),a.emitViewEvent(new i0(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(n=o.viewportStartModelPosition)===null||n===void 0?void 0:n.lineNumber;l&&r.some(u=>u.startLineNumber<=l&&l<=u.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new spt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(144),t=this._configuration.options.get(67),n=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new W(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(s"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(n.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,n){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,r){return this._lines.getViewLinesBracketGuides(e,t,n,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=Js(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=rh(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 n=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new yc(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const r=this._lines.getViewLinesData(e,t,n);return new Rlt(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,IA(this._configuration.options)),n=new Ppt;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);n.accept(l,o.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e),r=this.model.modifyPosition(n,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,n){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const r=n?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(W.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?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,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===mc||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new W(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===il.fontFamily;let c;return l?c=il.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${il.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(r,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?r-1:0,f=c===o?s-1:d.length;d===""?l+="
":l+=_pt(d,u.inflate(),t,h,f,a,Os)}return l}_getColorMap(){const e=gr.getColorMap(),t=["#000000"];if(e)for(let n=1,r=e.length;nthis._cursor.setStates(r,e,t,n))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,n=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,n))}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 apt);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,r,o))}paste(e,t,n,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,n,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new W(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new ZM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new W(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new ZM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new ZM(e,!1,n,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new npt),this._eventDispatcher.emitOutgoingEvent(new opt))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class bZ{static create(e){const t=e._setTrackedRange(null,new W(1,1,1,1),1);return new bZ(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,n,r,o){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new le(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new W(n.lineNumber,n.column,n.lineNumber,n.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class Ppt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=n){r>c&&(a[a.length-1]=r);return}a.push(o,n,r)}else{const a=new vI(e,t,[o,n,r]);this._asMap[e]=a,this.asArray.push(a)}}}class Apt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&fce(n,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,n)=>Opt(t,n),[]);return fce(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Opt(i,e){const t=[];let n=0,r=0;for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},y0;let Wpt=0,$pt=class{constructor(e,t,n,r,o,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},sS=y0=class extends me{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=Iit(),this._contributions=this._register(new mft),this._onDidDispose=this._register(new ae),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new pce({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new pce({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Us(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Us(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Us(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Us(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g={...t};this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Wpt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const _=this._configuration.options;if(v.hasChanged(144)){const y=_.get(144);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new Hpt(this,this._contextKeyService)),this._register(new Vpt(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new IT([Gt,this._contextKeyService])),this._modelData=null,this._focusTracker=new zpt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=Zy.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of Zy.getEditorActions()){if(this._actions.has(v.id)){nn(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const _=new hwe(v.id,v.label,v.alias,v.metadata,(f=v.precondition)!==null&&f!==void 0?f:void 0,y=>this._instantiationService.invokeFunction(S=>Promise.resolve(v.runEditorCommand(S,this,y))),this._contextKeyService);this._actions.set(_.id,_)}const m=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new Bot(this._domElement,{onDragOver:v=>{if(!m())return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new xz(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return _T.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` +`)){d=!1;break}}if(d){const h=new W(c,1,c,u);t.push(new O9(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,r)}_applyUndo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new W(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,n,r)}_applyRedo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new W(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,n,r)}_applyUndoRedoEdits(e,t,n,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;T--){const M=f+T,P=y+T;k.takeFromEndWhile(R=>R.lineNumber>P);const N=k.takeFromEndWhile(R=>R.lineNumber===P);a.push(new Ole(M,this.getLineContent(P),N))}if(vG.lineNumber<$),R[B]=T.takeWhile(G=>G.lineNumber===$)}a.push(new dft(M+1,f+m,O,R))}l+=_}this._emitContentChangedEvent(new sw(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const n=Array.from(e).map(r=>new Ole(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new dwe(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,ice(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(n)}catch(o){nn(o)}return n.addDecoration=hL,n.changeDecoration=hL,n.changeDecorationOptions=hL,n.removeDecoration=hL,n.deltaDecorations=hL,r}deltaDecorations(e,t,n=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."),nn(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:nce[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(nce[n]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,r=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new W(a,1,l,c),d=this._getDecorationsInRange(u,n,r,o);return QH(d,this._decorationProvider.getDecorationsInRange(u,n,r)),d}getDecorationsInRange(e,t=0,n=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,o);return QH(a,this._decorationProvider.getDecorationsInRange(s,t,n,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),n=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return _h.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,n,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const r=!!(n.options.overviewRuler&&n.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const s=r!==o,a=Agt(t)!==YM(n);s||a?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;athis._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 Pgt(this.getLineContent(e))+1}};Gf._MODEL_SYNC_LIMIT=50*1024*1024;Gf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Gf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Gf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Gf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ts.tabSize,indentSize:Ts.indentSize,insertSpaces:Ts.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ts.trimAutoWhitespace,largeFileOptimizations:Ts.largeFileOptimizations,bracketPairColorizationOptions:Ts.bracketPairColorizationOptions};Gf=y0=Igt([r7(4,z3),r7(5,qi),r7(6,Ti)],Gf);function Pgt(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function o7(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function Agt(i){return!!i.after||!!i.before}function YM(i){return!!i.options.after||!!i.options.before}class tce{constructor(){this._decorationsTree0=new t7,this._decorationsTree1=new t7,this._injectedTextDecorationsTree=new t7}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,n,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,n,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,n,r,o){const s=e.getVersionId(),a=this._search(t,n,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,r,o){if(n)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){YM(e)?this._injectedTextDecorationsTree.insert(e):o7(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){YM(e)?this._injectedTextDecorationsTree.delete(e):o7(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){YM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):o7(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,r){this._decorationsTree0.acceptReplace(e,t,n,r),this._decorationsTree1.acceptReplace(e,t,n,r),this._injectedTextDecorationsTree.acceptReplace(e,t,n,r)}}function Vh(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class Rwe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Ogt extends Rwe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Cc.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class Fgt{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:Uf.Center,this.persistLane=e==null?void 0:e.persistLane}}class Bgt extends Rwe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?Ce.fromHex(e):t.getColor(e.id)}}class s_{static from(e){return e instanceof s_?e:new s_(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 an{static register(e){return new an(e)}static createDynamic(e){return new an(e)}constructor(e){var t,n,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Vh(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Vh(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Ogt(e.overviewRuler):null,this.minimap=e.minimap?new Bgt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Fgt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Vh(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Vh(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Vh(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?lrt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Vh(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Vh(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Vh(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Vh(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Vh(e.afterContentClassName):null,this.after=e.after?s_.from(e.after):null,this.before=e.before?s_.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}an.EMPTY=an.register({description:"empty"});const nce=[an.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),an.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),an.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),an.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function ice(i){return i instanceof an?i:an.createDynamic(i)}class Wgt extends me{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new ae),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===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,n;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((n=e.overviewRuler)===null||n===void 0)&&n.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 $gt extends me{constructor(){super(),this._fastEmitter=this._register(new ae),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new ae),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class Hgt{constructor(){this._onDidChangeVisibleRanges=new ae,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Vgt(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 Vgt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(r=>new vn(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class hZ{static create(e){return new hZ(e.get(133),e.get(132))}constructor(e,t){this.classifier=new zgt(e,t)}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=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 Kz=[],Gz=[];function Ugt(i,e,t,n,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=Mwe(t,n,r,o,s),f=r-h,g=Kz,p=Gz;let m=0,v=0,_=0,y=r;const S=u.length;let L=0;if(L>=0){let E=Math.abs(d[L]-y);for(;L+1=E)break;E=D,L++}}for(;LE&&(E=v,D=_);let k=0,T=0,M=0,P=0;if(D<=y){let R=D,O=E===0?0:t.charCodeAt(E-1),B=E===0?0:i.get(O),$=!0;for(let G=E;Gv&&qz(O,B,j,ie,c)&&(k=U,T=R),R+=Y,R>y){U>v?(M=U,P=R-Y):(M=G+1,P=R),R-T>f&&(k=0),$=!1;break}O=j,B=ie}if($){m>0&&(g[m]=u[u.length-1],p[m]=d[u.length-1],m++);break}}if(k===0){let R=D,O=t.charCodeAt(E),B=i.get(O),$=!1;for(let G=E-1;G>=v;G--){const U=G+1,j=t.charCodeAt(G);if(j===9){$=!0;break}let ie,Y;if(Bb(j)?(G--,ie=0,Y=2):(ie=i.get(j),Y=Yv(j)?o:1),R<=y){if(M===0&&(M=U,P=R),R<=y-f)break;if(qz(j,ie,O,B,c)){k=U,T=R;break}}R-=Y,O=j,B=ie}if(k!==0){const G=f-(P-T);if(G<=n){const U=t.charCodeAt(M);let j;Do(U)?j=2:j=YE(U,P,n,o),G-j<0&&(k=0)}}if($){L--;continue}}if(k===0&&(k=M,T=P),k<=v){const R=t.charCodeAt(v);Do(R)?(k=v+2,T=_+2):(k=v+1,T=_+YE(R,_,n,o))}for(v=k,g[m]=k,_=T,p[m]=T,m++,y=T+f;L<0||L=N)break;N=R,L++}}return m===0?null:(g.length=m,p.length=m,Kz=e.breakOffsets,Gz=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function jgt(i,e,t,n,r,o,s,a){const l=_h.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(T=>T.options),u=t.map(T=>T.column-1)):(c=null,u=null),r===-1)return c?new jE(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new jE(u,c,[l.length],[],0):null;const h=a==="keepAll",f=Mwe(l,n,r,o,s),g=r-f,p=[],m=[];let v=0,_=0,y=0,S=r,L=l.charCodeAt(0),E=i.get(L),D=YE(L,0,n,o),k=1;Do(L)&&(D+=1,L=l.charCodeAt(1),E=i.get(L),k++);for(let T=k;TS&&((_===0||D-y>g)&&(_=M,y=D-R),p[v]=_,m[v]=y,v++,S=y+g,_=0),L=P,E=N}return v===0&&(!t||t.length===0)?null:(p[v]=d,m[v]=D,new jE(u,c,p,m,f))}function YE(i,e,t,n){return i===9?t-e%t:Yv(i)||i<32?n:1}function rce(i,e){return e-i%e}function qz(i,e,t,n,r){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!r&&e===3&&n!==2||!r&&n===3&&e!==1)}function Mwe(i,e,t,n,r){let o=0;if(r!==0){const s=Js(i);if(s!==-1){for(let l=0;lt&&(o=0)}}return o}class fO{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Zo(new W(1,1,1,1),0,0,new le(1,1),0),new Zo(new W(1,1,1,1),0,0,new le(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 $n(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Et.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Et.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,r){return t.equals(n)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,r,n,s),l=this._validatePositionWithCache(e,o,r,a);return n.equals(s)&&r.equals(a)&&o.equals(l)?t:new Zo(W.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=fO._validateViewState(e.viewModel,n)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Zo(r,t.selectionStartKind,o,s,a)}else{if(!n)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Zo(r,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const r=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Zo(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new le(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new le(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new W(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Zo(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class oce{constructor(e){this.context=e,this.cursors=[new fO(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 Pat(this.cursors,nu(e=>e.viewState.position,le.compare)).viewState.position}getBottomMostViewPosition(){return Mat(this.cursors,nu(e=>e.viewState.position,le.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($n.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,n=e.length;if(tn){const r=t-n;for(let o=0;o=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 n=0,r=e.length;nn.selection,W.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class sce{constructor(e,t,n,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=r}}class Kgt{constructor(){this.type=0}}class Ggt{constructor(){this.type=1}}class qgt{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Xgt{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class r0{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 c2{constructor(){this.type=5}}class Ygt{constructor(e){this.type=6,this.isFocused=e}}class Zgt{constructor(){this.type=7}}class u2{constructor(){this.type=8}}class Pwe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Xz{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Yz{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class ZM{constructor(e,t,n,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Qgt{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 Jgt{constructor(e){this.theme=e,this.type=14}}class ept{constructor(e){this.type=15,this.ranges=e}}class tpt{constructor(){this.type=16}}let npt=class{constructor(){this.type=17}};class ipt extends me{constructor(){super(),this._onEvent=this._register(new ae),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const n of t)n.handleEvents(e)}}}class rpt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class fZ{constructor(e,t,n,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,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 fZ(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class gZ{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 gZ(this.oldHasFocus,e.hasFocus)}}class pZ{constructor(e,t,n,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new pZ(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class opt{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class spt{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class gO{constructor(e,t,n,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;ts&&(r=r.slice(0,s),o=!0);const a=ZE.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=W.fromPositions(a[0],a[0]),e.emitViewEvent(new ZM(t,n,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,r=t.length;n0){const o=$n.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,$n.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,r){this.setStates(e,t,r,$n.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],r=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,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,n,r,o){const s=ZE.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Xgt(l,a,n)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new gO(c,a,u,s.modelVersionId,t||"keyboard",n,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,r=e.length;n=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(n)),o&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(o)for(let d=0,h=o.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,r=0){if(this.context.cursorConfig.readOnly)return;const o=ZE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){nn(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,r,o,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return ace.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new QE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(ar.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const r=t.length;let o=0;for(;o{const c=l.getPosition();return new Et(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(ar.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,r,o))},e,s)}paste(e,t,n,r,o){this._executeEdit(()=>{this._executeEditOperation(ar.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Ub.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Ga(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new Ga(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class ZE{static from(e,t){return new ZE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class ppt{static executeCommands(e,t,n){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,n);for(let s=0,a=r.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),m=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new Et(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):new Et(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{W.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=Et.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,m=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=m,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return nn(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,r)=>-W.compareRangesUsingEnds(n.range,r.range));const t={};for(let n=1;no.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class mpt{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class QE{static _capture(e,t){const n=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;n.push(new mpt(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return n}constructor(e,t){this._original=QE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=QE._capture(e,t);if(!n||this._original.length!==n.length)return null;const r=[];for(let o=0,s=this._original.length;oZw,tokenizeEncoded:(i,e,t)=>k3(0,t)};async function vpt(i,e,t){if(!t)return cce(e,i.languageIdCodec,lce);const n=await gr.getOrCreate(t);return cce(e,i.languageIdCodec,n||lce)}function _pt(i,e,t,n,r,o,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),m--;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:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>r||l>=r)break}return a+="
",a}function cce(i,e,t){let n='
';const r=ng(i);let o=t.getInitialState();for(let s=0,a=r.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,o);Io.convertToEndOffset(c.tokens,l.length);const d=new Io(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${OA(l.substring(h,m))}`,h=m}o=c.endState}return n+="
",n}class bpt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,n=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,r)}}class Cpt{constructor(e,t,n,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=r,this.minWidth=o,this.prefixSum=0}}let Awe=class Zz{constructor(e,t,n,r){this._instanceId=d1e(++Zz.INSTANCE_COUNT),this._pendingChanges=new bpt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=r}static findInsertionIndex(e,t,n){let r=0,o=e.length;for(;r>>1;t===e[s].afterLineNumber?n{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Cpt(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.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 n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of n)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Zz.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let n=0,r=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,r=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,n=this._lineHeight;let r=1,o=t;for(;r=a+n)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],m=e+(t-e)/2;let v=-1;for(let L=r;L<=s;L++){if(v===-1){const E=d,D=d+n;(E<=m&&mm)&&(v=L)}for(d+=n,p[L-r]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}v===-1&&(v=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=r,S=s;return yt&&S--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:S}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,n+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(n),o=this.getHeightForWhitespaceIndex(n);if(e>=r+o)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:n,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(n<0)return[];const o=[];for(let s=n;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};Awe.INSTANCE_COUNT=0;const ypt=125;class eE{constructor(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=r,this.scrollHeight=Math.max(n,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class wpt extends me{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new ae),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new eE(0,0,0,0),this._scrollable=this._register(new XS({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const n=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(n||r)&&this._onDidContentSizeChange.fire(new fZ(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 Spt extends me{constructor(e,t,n){super(),this._configuration=e;const r=this._configuration.options,o=r.get(144),s=r.get(84);this._linesLayout=new Awe(t,r.get(67),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new wpt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new eE(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?ypt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const n=t.get(84);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(144)){const n=t.get(144),r=n.contentWidth,o=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new eE(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(114)&&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(103);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,n){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(105)?o+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,n)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new eE(t,e.contentWidth,n,this._getContentHeight(t,n,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Yae(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Yae(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(145),r=e.get(50),o=e.get(144);if(n.isViewportWrapping){const s=e.get(73);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(104)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new eE(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);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 n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class xpt{constructor(e,t,n,r,o){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=r,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let n=this._decorationsCache[t];if(!n){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new le(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new le(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new W(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);n=new Cye(s,o),this._decorationsCache[t]=n}return n}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,n=!1){const r=new W(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,IA(this.configuration.options),t,n),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;ut===1)}function _Z(i,e){return Owe(i,e.range,t=>t===2)}function Owe(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const r=i.tokenization.getLineTokens(n),o=n===e.startLineNumber,s=n===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function s7(i,e){return i===null?e?pO.INSTANCE:mO.INSTANCE:new Lpt(i,e)}class Lpt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,n){this._assertVisible();const r=n>0?this._projectionData.breakOffsets[n-1]:0,o=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new _h(0,0,c+1,this._projectionData.injectionOptions[u],0));s=_h.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return n>0&&(s=uce(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const r=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],r),r[0]}getViewLinesData(e,t,n,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(v0?l.wrappedTextIndentLength:0,k=D+Math.max(S-v,0),T=D+Math.min(L-v,_-v);k!==T&&m.push(new Mlt(k,T,E.inlineClassName,E.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Io.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?r.wrappedTextIndentLength:0,s=n>0?r.breakOffsets[n-1]:0,a=r.breakOffsets[n],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();n>0&&(c=uce(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=a7.length)for(let e=1;e<=i;e++)a7[e]=Ept(e);return a7[i]}function Ept(i){return new Array(i+1).join(" ")}class Dpt{constructor(e,t,n,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new kpt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=n.length,s=this.createLineBreaksComputer(),a=new Op(_h.fromDecorations(r));for(let p=0;pv.lineNumber===p+1);s.addRequest(n[p],m,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(W.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&m<=h,_=s7(l[p],!v);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new gat(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=Ipt(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(W.compareRangesUsingStarts);if(n.length===r.length){let h=!1;for(let f=0;f({range:h,options:an.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}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,n,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,r=t.remainder;return new dce(n+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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new le(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new le(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),m=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return m.lineNumber===u.modelLineWrappedLineIdx?new Q0(f.visibleColumn,g,f.className,new VE(f.horizontalLine.top,p.column),-1,-1):m.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=n.lineNumber-1,c=r.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const m=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=v-m+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(y=m===0?1:2),s.push(_),a.push(y),u===null&&(u=new le(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,n,l),o+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new le(o+1,u)).equals(n)?new le(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new W(n.lineNumber,n.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),r=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new le(n.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new W(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,r=!1,o=!1){const s=this.model.validatePosition(new le(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new le(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return W.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new W(n.lineNumber,n.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new W(s.lineNumber,1,a.lineNumber,a.column),t,n,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new le(p+1,p===c?s.column:1));else if(d!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new W(d.lineNumber,d.column,p,v),t,n,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new W(d.lineNumber,d.column,a.lineNumber,a.column),t,n,r)),d=null),l.sort((p,m)=>{const v=W.compareRangesUsingStarts(p.range,m.range);return v===0?p.idm.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const m=p.id;g!==m&&(g=m,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Ipt(i){if(i.length===0)return[];const e=i.slice();e.sort(W.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;or+1?(t.push(new W(n,1,r,1)),n=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new W(n,1,r,1)),t}class dce{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class hce{constructor(e,t){this.modelRange=e,this.viewLines=t}}class kpt{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,n,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,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 Tpt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Npt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new Xz(t,n)}onModelLinesInserted(e,t,n,r){return new Yz(t,n)}onModelLineChanged(e,t,n){return[!1,new Pwe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,r=new Array(n);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const o0=Uf.Right;class Rpt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*o0/8))}reset(e){const t=Math.ceil((e+1)*o0/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=bZ.create(this.model),this.glyphLanes=new Rpt(0),this.model.isTooLargeForTokenization())this._lines=new Tpt(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(138),f=u.get(145),g=u.get(137),p=u.get(129);this._lines=new Dpt(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new gpt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Spt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Qgt(u)),this._eventDispatcher.emitOutgoingEvent(new pZ(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new xpt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(DT.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new tpt)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Jgt(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new W(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 Ygt(e)),this._eventDispatcher.emitOutgoingEvent(new gZ(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Kgt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Ggt)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new le(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new gce(t,this._viewportStart.startLineDelta)}return new gce(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(138),a=r.get(145),l=r.get(137),c=r.get(129);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new c2),e.emitViewEvent(new u2),e.emitViewEvent(new r0(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new r0(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new r0(null))),e.emitViewEvent(new qgt(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),v1.shouldRecreate(t)&&(this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof mb?e.rawContentChangedEvent.changes:e.changes,a=e instanceof mb?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new Op(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new c2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,p,m]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),m&&(n.emitViewEvent(m),this.viewLayout.onLinesDeleted(m.fromLineNumber,m.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(n.emitViewEvent(new u2),n.emitViewEvent(new r0(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const r=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof mb&&n.emitOutgoingEvent(new dpt(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,r=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new Zgt),this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new upt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new cpt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new c2),t.emitViewEvent(new u2),t.emitViewEvent(new r0(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new v1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new hpt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new r0(e)),this._eventDispatcher.emitOutgoingEvent(new lpt(e))}))}setHiddenAreas(e,t){var n;this.hiddenAreasModel.setHiddenAreas(t,e);const r=this.hiddenAreasModel.getMergedRanges();if(r===this.previousHiddenAreas)return;this.previousHiddenAreas=r;const o=this._captureStableViewport();let s=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(r),s&&(a.emitViewEvent(new c2),a.emitViewEvent(new u2),a.emitViewEvent(new r0(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(n=o.viewportStartModelPosition)===null||n===void 0?void 0:n.lineNumber;l&&r.some(u=>u.startLineNumber<=l&&l<=u.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new spt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(144),t=this._configuration.options.get(67),n=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new W(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(s"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(n.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,n){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,r){return this._lines.getViewLinesBracketGuides(e,t,n,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=Js(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=rh(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 n=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new yc(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const r=this._lines.getViewLinesData(e,t,n);return new Rlt(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,IA(this._configuration.options)),n=new Ppt;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);n.accept(l,o.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e),r=this.model.modifyPosition(n,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,n){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const r=n?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(W.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?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,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===mc||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new W(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===il.fontFamily;let c;return l?c=il.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${il.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(r,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?r-1:0,f=c===o?s-1:d.length;d===""?l+="
":l+=_pt(d,u.inflate(),t,h,f,a,Os)}return l}_getColorMap(){const e=gr.getColorMap(),t=["#000000"];if(e)for(let n=1,r=e.length;nthis._cursor.setStates(r,e,t,n))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,n=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,n))}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 apt);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,r,o))}paste(e,t,n,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,n,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new W(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new ZM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new W(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new ZM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new ZM(e,!1,n,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new npt),this._eventDispatcher.emitOutgoingEvent(new opt))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class bZ{static create(e){const t=e._setTrackedRange(null,new W(1,1,1,1),1);return new bZ(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,n,r,o){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new le(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new W(n.lineNumber,n.column,n.lineNumber,n.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class Ppt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=n){r>c&&(a[a.length-1]=r);return}a.push(o,n,r)}else{const a=new vI(e,t,[o,n,r]);this._asMap[e]=a,this.asArray.push(a)}}}class Apt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&fce(n,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,n)=>Opt(t,n),[]);return fce(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Opt(i,e){const t=[];let n=0,r=0;for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w0;let Wpt=0,$pt=class{constructor(e,t,n,r,o,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},sS=w0=class extends me{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=Iit(),this._contributions=this._register(new mft),this._onDidDispose=this._register(new ae),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new pce({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new pce({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Us(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Us(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Us(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Us(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Us(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Us(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new ae({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g={...t};this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Wpt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const _=this._configuration.options;if(v.hasChanged(144)){const y=_.get(144);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new Hpt(this,this._contextKeyService)),this._register(new Vpt(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new IT([Gt,this._contextKeyService])),this._modelData=null,this._focusTracker=new zpt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=Zy.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of Zy.getEditorActions()){if(this._actions.has(v.id)){nn(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const _=new hwe(v.id,v.label,v.alias,v.metadata,(f=v.precondition)!==null&&f!==void 0?f:void 0,y=>this._instantiationService.invokeFunction(S=>Promise.resolve(v.runEditorCommand(S,this,y))),this._contextKeyService);this._actions.set(_.id,_)}const m=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new Bot(this._domElement,{onDragOver:v=>{if(!m())return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new xz(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return _T.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` `?n=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const n=e;if(this._modelData===null&&n===null||this._modelData&&this._modelData.model===n)return;const r={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(n==null?void 0:n.uri)||null};this._onWillChangeModel.fire(r);const o=this.hasTextFocus(),s=this._detachModel();this._attachModel(n),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,n,r){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?y0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?y0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,r=!1){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?y0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(r=>W.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return _o.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!le.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,n,r){if(!this._modelData)return;if(!W.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",n,s,t,r)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new W(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,r){if(!le.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new W(e.lineNumber,e.column,e.lineNumber,e.column),t,n,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=Et.isISelection(e),r=W.isIRange(e);if(!n&&!r)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new Et(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new W(e,1,t,1),n,!1,r)}revealRange(e,t=0,n=!1,r=!0){this._revealRange(e,n?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,n,r){if(!W.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(W.lift(e),t,n,r)}setSelections(e,t="api",n=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=n;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=n;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=n;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=n;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(n)).then(void 0,nn);return}this._modelData&&(this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,n,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,n,r,o,e)}_paste(e,t,n,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new W(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const r=Zy.getEditorCommand(t);return r?(n=n||{},n.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,n)).then(void 0,nn)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(91))return!1;let r;return n?Array.isArray(n)?r=()=>n:r=n: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 Upt(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,IA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,IA(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(n=>n.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(144)}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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,r=n.get(144),o=y0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:n.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.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){vs(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),r=new Mpt(this._id,this._configuration,e,tZ.create(Bt(this._domElement)),hZ.create(this._configuration.options),a=>Ml(Bt(this._domElement),a),this.languageConfigurationService,this._themeService,n);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),h=w("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(U3.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:w("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new W3(e.coordinatesConverter);return n.onKeyDown=o=>this._onKeyDown.fire(o),n.onKeyUp=o=>this._onKeyUp.fire(o),n.onContextMenu=o=>this._onContextMenu.fire(o),n.onMouseMove=o=>this._onMouseMove.fire(o),n.onMouseLeave=o=>this._onMouseLeave.fire(o),n.onMouseDown=o=>this._onMouseDown.fire(o),n.onMouseUp=o=>this._onMouseUp.fire(o),n.onMouseDrag=o=>this._onMouseDrag.fire(o),n.onMouseDrop=o=>this._onMouseDrop.fire(o),n.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),n.onMouseWheel=o=>this._onMouseWheel.fire(o),[new Az(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new W(e.lineNumber,e.column,e.lineNumber,e.column),options:y0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};sS.dropIntoEditorDecorationOptions=an.register({description:"workbench-dnd-target",className:"dnd-target"});sS=y0=Bpt([wg(3,Wt),wg(4,jn),wg(5,cr),wg(6,Gt),wg(7,Mo),wg(8,zr),wg(9,pd),wg(10,Ti),wg(11,yt)],sS);class pce extends me{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new ae(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new ae(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 Us extends ae{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Hpt extends me{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=K.editorSimpleInput.bindTo(t),this._editorFocus=K.focus.bindTo(t),this._textInputFocus=K.textInputFocus.bindTo(t),this._editorTextFocus=K.editorTextFocus.bindTo(t),this._tabMovesFocus=K.tabMovesFocus.bindTo(t),this._editorReadonly=K.readOnly.bindTo(t),this._inDiffEditor=K.inDiffEditor.bindTo(t),this._editorColumnSelection=K.columnSelection.bindTo(t),this._hasMultipleSelections=K.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=K.hasNonEmptySelection.bindTo(t),this._canUndo=K.canUndo.bindTo(t),this._canRedo=K.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(Qw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Qw.getTabFocusMode()),this._editorReadonly.set(e.get(91)),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 Vpt extends me{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=K.languageId.bindTo(t),this._hasCompletionItemProvider=K.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=K.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=K.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=K.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=K.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=K.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=K.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=K.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=K.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=K.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=K.hasReferenceProvider.bindTo(t),this._hasRenameProvider=K.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=K.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=K.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=K.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=K.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=K.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=K.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=K.isInEmbeddedEditor.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(n.completionProvider.onDidChange(r)),this._register(n.codeActionProvider.onDidChange(r)),this._register(n.codeLensProvider.onDidChange(r)),this._register(n.definitionProvider.onDidChange(r)),this._register(n.declarationProvider.onDidChange(r)),this._register(n.implementationProvider.onDidChange(r)),this._register(n.typeDefinitionProvider.onDidChange(r)),this._register(n.hoverProvider.onDidChange(r)),this._register(n.documentHighlightProvider.onDidChange(r)),this._register(n.documentSymbolProvider.onDidChange(r)),this._register(n.referenceProvider.onDidChange(r)),this._register(n.renameProvider.onDidChange(r)),this._register(n.documentFormattingEditProvider.onDidChange(r)),this._register(n.documentRangeFormattingEditProvider.onDidChange(r)),this._register(n.signatureHelpProvider.onDidChange(r)),this._register(n.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===cn.walkThroughSnippet||e.uri.scheme===cn.vscodeChatCodeBlock)})}}class zpt extends me{constructor(e,t){super(),this._onChange=this._register(new ae),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(ph(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(ph(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(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class Upt{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,n){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},n)}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 n of this._decorationIds){const r=e.getDecorationRange(n);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(n=>{t=n.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const jpt=encodeURIComponent("");function l7(i){return jpt+encodeURIComponent(i.toString())+Kpt}const Gpt=encodeURIComponent('');function Xpt(i){return Gpt+encodeURIComponent(i.toString())+qpt}vu((i,e)=>{const t=i.getColor(Ef);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${l7(t)}") repeat-x bottom left; }`);const n=i.getColor(Zs);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${l7(n)}") repeat-x bottom left; }`);const r=i.getColor(tl);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${l7(r)}") repeat-x bottom left; }`);const o=i.getColor(Sct);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Xpt(o)}") no-repeat bottom left; }`);const s=i.getColor(Rdt);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Ypt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Qz=class extends me{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new ae),this._onCodeEditorAdd=this._register(new ae),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new ae),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new ae),this._onDiffEditorAdd=this._register(new ae),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new ae),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ca,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 n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}async openCodeEditor(e,t,n){for(const r of this._codeEditorOpenHandlers){const o=await r(e,t,n);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ot(t)}};Qz=Ypt([Zpt(0,Mo)],Qz);var Qpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let vO=class extends Qz{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(n,r,o)=>r?this.doOpenEditor(r,n):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===cn.http||o===cn.https)return F1e(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};vO=Qpt([mce(0,Gt),mce(1,Mo)],vO);Tn(jn,vO,0);const xC=Sn("layoutService");var Fwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _O=class{get mainContainer(){var e,t;return(t=(e=GX(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:hi.document.body}get activeContainer(){var e,t;const n=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=n==null?void 0:n.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return Wp(this.mainContainer)}get activeContainerDimension(){return Wp(this.activeContainer)}get containers(){return hh(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=ot.None,this.onDidLayoutActiveContainer=ot.None,this.onDidLayoutContainer=ot.None,this.onDidChangeActiveContainer=ot.None,this.onDidAddContainer=ot.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};_O=Fwe([Bwe(0,jn)],_O);let Jz=class extends _O{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Jz=Fwe([Bwe(1,jn)],Jz);Tn(xC,_O,1);const kT=Sn("dialogService");var Jpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function d2(i){return i.scheme===cn.file?i.fsPath:i.path}let Wwe=0;class h2{constructor(e,t,n,r,o,s,a){this.id=++Wwe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class _ce{constructor(e,t){this.resourceLabel=e,this.reason=t}}class bce{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const n=[];return e.length>0&&n.push(w({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(w({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join(` +`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const n=e;if(this._modelData===null&&n===null||this._modelData&&this._modelData.model===n)return;const r={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(n==null?void 0:n.uri)||null};this._onWillChangeModel.fire(r);const o=this.hasTextFocus(),s=this._detachModel();this._attachModel(n),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,n,r){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?w0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?w0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,r=!1){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?w0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(r=>W.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return _o.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!le.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,n,r){if(!this._modelData)return;if(!W.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",n,s,t,r)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new W(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,r){if(!le.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new W(e.lineNumber,e.column,e.lineNumber,e.column),t,n,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=Et.isISelection(e),r=W.isIRange(e);if(!n&&!r)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new Et(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new W(e,1,t,1),n,!1,r)}revealRange(e,t=0,n=!1,r=!0){this._revealRange(e,n?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,n,r){if(!W.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(W.lift(e),t,n,r)}setSelections(e,t="api",n=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=n;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=n;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=n;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=n;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(n)).then(void 0,nn);return}this._modelData&&(this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,n,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,n,r,o,e)}_paste(e,t,n,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new W(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const r=Zy.getEditorCommand(t);return r?(n=n||{},n.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,n)).then(void 0,nn)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(91))return!1;let r;return n?Array.isArray(n)?r=()=>n:r=n: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 Upt(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,IA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,IA(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(n=>n.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(144)}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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,r=n.get(144),o=w0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:n.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.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){vs(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),r=new Mpt(this._id,this._configuration,e,tZ.create(Bt(this._domElement)),hZ.create(this._configuration.options),a=>Ml(Bt(this._domElement),a),this.languageConfigurationService,this._themeService,n);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),h=w("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(U3.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:w("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new W3(e.coordinatesConverter);return n.onKeyDown=o=>this._onKeyDown.fire(o),n.onKeyUp=o=>this._onKeyUp.fire(o),n.onContextMenu=o=>this._onContextMenu.fire(o),n.onMouseMove=o=>this._onMouseMove.fire(o),n.onMouseLeave=o=>this._onMouseLeave.fire(o),n.onMouseDown=o=>this._onMouseDown.fire(o),n.onMouseUp=o=>this._onMouseUp.fire(o),n.onMouseDrag=o=>this._onMouseDrag.fire(o),n.onMouseDrop=o=>this._onMouseDrop.fire(o),n.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),n.onMouseWheel=o=>this._onMouseWheel.fire(o),[new Az(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new W(e.lineNumber,e.column,e.lineNumber,e.column),options:w0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};sS.dropIntoEditorDecorationOptions=an.register({description:"workbench-dnd-target",className:"dnd-target"});sS=w0=Bpt([wg(3,Wt),wg(4,jn),wg(5,cr),wg(6,Gt),wg(7,Mo),wg(8,zr),wg(9,pd),wg(10,Ti),wg(11,yt)],sS);class pce extends me{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new ae(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new ae(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 Us extends ae{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Hpt extends me{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=K.editorSimpleInput.bindTo(t),this._editorFocus=K.focus.bindTo(t),this._textInputFocus=K.textInputFocus.bindTo(t),this._editorTextFocus=K.editorTextFocus.bindTo(t),this._tabMovesFocus=K.tabMovesFocus.bindTo(t),this._editorReadonly=K.readOnly.bindTo(t),this._inDiffEditor=K.inDiffEditor.bindTo(t),this._editorColumnSelection=K.columnSelection.bindTo(t),this._hasMultipleSelections=K.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=K.hasNonEmptySelection.bindTo(t),this._canUndo=K.canUndo.bindTo(t),this._canRedo=K.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(Qw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Qw.getTabFocusMode()),this._editorReadonly.set(e.get(91)),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 Vpt extends me{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=K.languageId.bindTo(t),this._hasCompletionItemProvider=K.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=K.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=K.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=K.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=K.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=K.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=K.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=K.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=K.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=K.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=K.hasReferenceProvider.bindTo(t),this._hasRenameProvider=K.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=K.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=K.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=K.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=K.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=K.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=K.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=K.isInEmbeddedEditor.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(n.completionProvider.onDidChange(r)),this._register(n.codeActionProvider.onDidChange(r)),this._register(n.codeLensProvider.onDidChange(r)),this._register(n.definitionProvider.onDidChange(r)),this._register(n.declarationProvider.onDidChange(r)),this._register(n.implementationProvider.onDidChange(r)),this._register(n.typeDefinitionProvider.onDidChange(r)),this._register(n.hoverProvider.onDidChange(r)),this._register(n.documentHighlightProvider.onDidChange(r)),this._register(n.documentSymbolProvider.onDidChange(r)),this._register(n.referenceProvider.onDidChange(r)),this._register(n.renameProvider.onDidChange(r)),this._register(n.documentFormattingEditProvider.onDidChange(r)),this._register(n.documentRangeFormattingEditProvider.onDidChange(r)),this._register(n.signatureHelpProvider.onDidChange(r)),this._register(n.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===cn.walkThroughSnippet||e.uri.scheme===cn.vscodeChatCodeBlock)})}}class zpt extends me{constructor(e,t){super(),this._onChange=this._register(new ae),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(ph(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(ph(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(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class Upt{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,n){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},n)}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 n of this._decorationIds){const r=e.getDecorationRange(n);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(n=>{t=n.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const jpt=encodeURIComponent("");function l7(i){return jpt+encodeURIComponent(i.toString())+Kpt}const Gpt=encodeURIComponent('');function Xpt(i){return Gpt+encodeURIComponent(i.toString())+qpt}vu((i,e)=>{const t=i.getColor(Ef);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${l7(t)}") repeat-x bottom left; }`);const n=i.getColor(Zs);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${l7(n)}") repeat-x bottom left; }`);const r=i.getColor(tl);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${l7(r)}") repeat-x bottom left; }`);const o=i.getColor(Sct);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Xpt(o)}") no-repeat bottom left; }`);const s=i.getColor(Rdt);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Ypt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Qz=class extends me{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new ae),this._onCodeEditorAdd=this._register(new ae),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new ae),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new ae),this._onDiffEditorAdd=this._register(new ae),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new ae),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ca,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 n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}async openCodeEditor(e,t,n){for(const r of this._codeEditorOpenHandlers){const o=await r(e,t,n);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ot(t)}};Qz=Ypt([Zpt(0,Mo)],Qz);var Qpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let vO=class extends Qz{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(n,r,o)=>r?this.doOpenEditor(r,n):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===cn.http||o===cn.https)return F1e(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};vO=Qpt([mce(0,Gt),mce(1,Mo)],vO);Tn(jn,vO,0);const xC=Sn("layoutService");var Fwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _O=class{get mainContainer(){var e,t;return(t=(e=GX(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:hi.document.body}get activeContainer(){var e,t;const n=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=n==null?void 0:n.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return Wp(this.mainContainer)}get activeContainerDimension(){return Wp(this.activeContainer)}get containers(){return hh(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=ot.None,this.onDidLayoutActiveContainer=ot.None,this.onDidLayoutContainer=ot.None,this.onDidChangeActiveContainer=ot.None,this.onDidAddContainer=ot.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};_O=Fwe([Bwe(0,jn)],_O);let Jz=class extends _O{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Jz=Fwe([Bwe(1,jn)],Jz);Tn(xC,_O,1);const kT=Sn("dialogService");var Jpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function d2(i){return i.scheme===cn.file?i.fsPath:i.path}let Wwe=0;class h2{constructor(e,t,n,r,o,s,a){this.id=++Wwe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class _ce{constructor(e,t){this.resourceLabel=e,this.reason=t}}class bce{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const n=[];return e.length>0&&n.push(w({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(w({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.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 emt{constructor(e,t,n,r,o,s,a){this.id=++Wwe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new bce),this.removedResources.has(t)||this.removedResources.set(t,new _ce(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new bce),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new _ce(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class $we{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=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 n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let n=0,r=this._past.length;n=0;n--)t.push(this._future[n].id);return new Nwe(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,r=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[r])&&(n=!1,o=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,r++){const l=this._future[a];n&&(r>=t||l.id!==e.elements[r])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.actual);return{past:e,future:t}}getClosestPastElement(){return 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 n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class c7{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=r)}return[t,n]}canUndo(e){if(e instanceof mf){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){nn(e);for(const n of t.strResources)this.removeElements(n);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,n,r,o){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return me.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?me.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(me.None);const n=e.actual.prepareUndoRedo();return n?tY(n)?t(n):n.then(r=>t(r)):t(me.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||Hwe);return new c7(t)}_tryToSplitAndUndo(e,t,n,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(r),new f2(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new f2}_checkWorkspaceUndo(e,t,n,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,w({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,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(n){if(n===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,n,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:Rr.Info,message:w("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:w({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:w({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,n,!1);if(c)return c.returnValue;r=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return o.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,o,()=>this._continueUndoInGroup(t.groupId,r))}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=w({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 c7([e]),r,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=r)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof mf){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,n){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,n)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,n):this._resourceUndo(r,o,n)}finally{}}async _confirmAndContinueUndo(e,t,n){if((await this._dialogService.confirm({message:w("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:w({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:w("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,n,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,n)}async _executeWorkspaceRedo(e,t,n){let r;try{r=await this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,n,!0);if(o)return r.dispose(),o.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,r,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=w({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(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new c7([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const _u=Sn("ILanguageFeatureDebounceService");var bO;(function(i){const e=new WeakMap;let t=0;function n(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}i.of=n})(bO||(bO={}));class imt{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class rmt{constructor(e,t,n,r,o,s){this._logService=e,this._name=t,this._registry=n,this._default=r,this._min=o,this._max=s,this._cache=new N_(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>l3(bO.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?fa(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let r=this._cache.get(n);r||(r=new tmt(6),this._cache.set(n,r));const o=fa(r.update(t),this._min,this._max);return _Y(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new Vwe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return fa(e,this._min,this._max)}}let tU=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var r,o,s;const a=(r=n==null?void 0:n.min)!==null&&r!==void 0?r:50,l=(o=n==null?void 0:n.max)!==null&&o!==void 0?o:a**2,c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${bO.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new rmt(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new imt(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new Vwe;for(const t of this._data.values())e.update(t.default());return e.value}};tU=nmt([Cce(0,Ra),Cce(1,CZ)],tU);Tn(_u,tU,1);class JE{static create(e,t){return new JE(e,new CO(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 W(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new JE(this._startLineNumber,r),new JE(this._startLineNumber+s,o)]}applyEdit(e,t){const[n,r,o]=n_(t);this.acceptEdit(e,n,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new le(e.startLineNumber,e.startColumn),t,n,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const o=n-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&n>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,r,o){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,r,o)}}class CO{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;ae||h===e&&g>=t)&&(he||g===e&&m>=t){if(go?p-=o-n:p=n;else if(f===t&&g===n)if(f===r&&p>o)p-=o-n;else{u=!0;continue}else if(fo)f=t,g=n,p=g+(p-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-n,p-=o-n;else throw new Error("Not possible!");const v=4*c;s[v]=f,s[v+1]=g,s[v+2]=p,s[v+3]=m,c++}this._tokenCount=c}acceptInsertText(e,t,n,r,o,s){const a=n===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nU=class{constructor(e,t,n,r){this._legend=e,this._themeService=t,this._languageService=n,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new $g}getMetadata(e,t,n){const r=this._languageService.languageIdCodec.encodeLanguageId(n),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${fs.getForeground(s)}, fontStyle ${fs.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===hs.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${fs.getForeground(s)}, fontStyle ${fs.getFontStyle(s).toString(2)}`)}return s}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,n,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};nU=omt([u7(1,Mo),u7(2,qi),u7(3,Ra)],nU);function zwe(i,e,t){const n=i.data,r=i.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let y=d;for(;y+1E)e.warnOverlappingSemanticTokens(L,E+1);else{const P=e.getMetadata(T,M,t);P!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=E,h[f+2]=k,h[f+3]=P,f+=4,p=L,m=k)}l=L,c=E,a++}f!==h.length&&(h=h.subarray(0,f));const v=JE.create(g,h);s.push(v)}return s}class smt{constructor(e,t,n,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=r,this.next=null}}class $g{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=$g._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<$g._SIZES.length?2/3*this._currentLength:0),this._elements=[],$g._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let n=0;n=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=$g._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<$g._SIZES.length?2/3*this._currentLength:0),this._elements=[],$g._nullOutEntries(this._elements,this._currentLength);for(const s of o){let a=s;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new smt(e,t,n,r))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}$g._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const j3=Sn("semanticTokensStylingService");var amt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let iU=class extends me{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,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 nU(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};iU=amt([d7(0,Mo),d7(1,Ra),d7(2,qi)],iU);Tn(j3,iU,1);const g2="**",wce="/",QM="[/\\\\]",JM="[^/\\\\]",lmt=/\//g;function Sce(i,e){switch(i){case 0:return"";case 1:return`${JM}*?`;default:return`(?:${QM}|${JM}+${QM}${e?`|${QM}${JM}+`:""})*?`}}function xce(i,e){if(!i)return[];const t=[];let n=!1,r=!1,o="";for(const s of i){switch(s){case e:if(!n&&!r){t.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function Uwe(i){if(!i)return"";let e="";const t=xce(i,wce);if(t.every(n=>n===g2))e=".*";else{let n=!1;t.forEach((r,o)=>{if(r===g2){if(n)return;e+=Sce(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===wce?d="":d=vc(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${xce(a,",").map(f=>Uwe(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=JM;continue;case"*":e+=Sce(1);continue;default:e+=vc(u)}}oyZ(a,e)).filter(a=>a!==Ff),i),n=t.length;if(!n)return Ff;if(n===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Ice(i,e,t){const n=ih===lo.sep,r=n?i:i.replace(lmt,ih),o=ih+r,s=lo.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function _mt(i){try{const e=new RegExp(`^${Uwe(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return Ff}}function bmt(i,e,t){return!i||typeof e!="string"?!1:jwe(i)(e,void 0,t)}function jwe(i,e={}){if(!i)return Ece;if(typeof i=="string"||Cmt(i)){const t=yZ(i,e);if(t===Ff)return Ece;const n=function(r,o){return!!t(r,o)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return ymt(i,e)}function Cmt(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function ymt(i,e){const t=Kwe(Object.getOwnPropertyNames(i).map(a=>wmt(a,i[a],e)).filter(a=>a!==Ff)),n=t.length;if(!n)return Ff;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f{for(const f of h){const g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,f=t.length;h{for(const h of d){const f=await h;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function wmt(i,e,t){if(e===!1)return Ff;const n=yZ(i,t);if(n===Ff)return Ff;if(typeof e=="boolean")return n;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return JV(d)?d.then(h=>h?i:null):d?i:null};return o.requiresSiblings=!0,o}}return n}function Kwe(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?r[c]:null};o.basenames=n,o.patterns=r,o.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(o),s}function wZ(i,e,t,n,r,o){if(Array.isArray(i)){let s=0;for(const a of i){const l=wZ(a,e,t,n,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:ZCe(a.base)},h===e.fsPath||bmt(h,e.fsPath))d=10;else return 0}return d}else return 0}}function Gwe(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(Gwe):!!i.exclusive}class kce{constructor(e,t,n,r){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=r}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class nr{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new ae,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ot(()=>{if(n){const r=this._entries.indexOf(n);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,r;return this._orderedForEach(e,o=>{n&&r===o._score?n.push(o.provider):(r=o._score,n=[o.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new kce(e.uri,e.getLanguageId(),r.uri,r.type):new kce(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=wZ(s.selector,o.uri,o.languageId,uye(e),o.notebookUri,o.notebookType),Gwe(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(nr._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:tE(e.selector)&&!tE(t.selector)?1:!tE(e.selector)&&tE(t.selector)?-1:e._timet._time?-1:0}}function tE(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(tE):!!i.isBuiltin}class Smt{constructor(){this.referenceProvider=new nr(this._score.bind(this)),this.renameProvider=new nr(this._score.bind(this)),this.newSymbolNamesProvider=new nr(this._score.bind(this)),this.codeActionProvider=new nr(this._score.bind(this)),this.definitionProvider=new nr(this._score.bind(this)),this.typeDefinitionProvider=new nr(this._score.bind(this)),this.declarationProvider=new nr(this._score.bind(this)),this.implementationProvider=new nr(this._score.bind(this)),this.documentSymbolProvider=new nr(this._score.bind(this)),this.inlayHintsProvider=new nr(this._score.bind(this)),this.colorProvider=new nr(this._score.bind(this)),this.codeLensProvider=new nr(this._score.bind(this)),this.documentFormattingEditProvider=new nr(this._score.bind(this)),this.documentRangeFormattingEditProvider=new nr(this._score.bind(this)),this.onTypeFormattingEditProvider=new nr(this._score.bind(this)),this.signatureHelpProvider=new nr(this._score.bind(this)),this.hoverProvider=new nr(this._score.bind(this)),this.documentHighlightProvider=new nr(this._score.bind(this)),this.multiDocumentHighlightProvider=new nr(this._score.bind(this)),this.selectionRangeProvider=new nr(this._score.bind(this)),this.foldingRangeProvider=new nr(this._score.bind(this)),this.linkProvider=new nr(this._score.bind(this)),this.inlineCompletionsProvider=new nr(this._score.bind(this)),this.inlineEditProvider=new nr(this._score.bind(this)),this.completionProvider=new nr(this._score.bind(this)),this.linkedEditingRangeProvider=new nr(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new nr(this._score.bind(this)),this.documentSemanticTokensProvider=new nr(this._score.bind(this)),this.documentOnDropEditProvider=new nr(this._score.bind(this)),this.documentPasteEditProvider=new nr(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Tn(yt,Smt,1);var xmt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Tce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const SZ=Sn("hoverService");let yO=class extends me{get delay(){return this.instantHover&&Date.now()-this.lastHoverHideTime{s.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const n=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const r=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const o of r)this.hoverDisposables.add(Lr(o,"keydown",s=>{s.equals(9)&&this.hoverService.hideHover()}));return this.hoverService.showHover({...e,persistence:{hideOnHover:!0},...n},t)}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};yO=xmt([Tce(3,mn),Tce(4,SZ)],yO);const og=Sn("contextViewService"),$l=Sn("contextMenuService");const p2=Xe;let xZ=class extends me{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 ST(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class K3 extends me{static render(e,t,n){return new K3(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Oe(e,p2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Oe(this.actionContainer,p2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Oe(this.action,p2(`span.icon.${t.iconClass}`));const r=Oe(this.action,p2("span"));r.textContent=n?`${t.label} (${n})`:t.label,this._register(xe(this.actionContainer,Je.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(xe(this.actionContainer,Je.KEY_DOWN,o=>{const s=new Oi(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function qwe(i,e){return i&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}const hl=Sn("openerService");function Lmt(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}function Emt(i,e={}){const t=LZ(e);return t.textContent=i,t}function Dmt(i,e={}){const t=LZ(e);return Xwe(t,kmt(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function LZ(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class Imt{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 Xwe(i,e,t,n){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&&n)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Lr(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=i);r&&i!==r&&i.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{Xwe(r,o,t,n)})}function kmt(i,e){const t={type:1,children:[]};let n=0,r=t;const o=[],s=new Imt(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&rU(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&Tmt(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=rU(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),r.children.push(u),o.push(r),r=u}}else if(a===` -`)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function Tmt(i,e){return rU(i,e)!==0}function rU(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Nmt=new RegExp(`(\\\\)?\\$\\((${Vt.iconNameExpression}(?:${Vt.iconModifierExpression})?)\\)`,"g");function Tv(i){const e=new Array;let t,n=0,r=0;for(;(t=Nmt.exec(i))!==null;){r=t.index||0,n0)return new Uint32Array(e)}let Zl=0;const zm=new Uint32Array(10);function Mmt(i){if(Zl=0,zh(i,f7,4352),Zl>0||(zh(i,g7,4449),Zl>0)||(zh(i,p7,4520),Zl>0)||(zh(i,o0,12593),Zl))return zm.subarray(0,Zl);if(i>=44032&&i<=55203){const e=i-44032,t=e%588,n=Math.floor(e/588),r=Math.floor(t/28),o=t%28-1;if(n=0&&(o0)return zm.subarray(0,Zl)}}function zh(i,e,t){i>=t&&i>8&&(zm[Zl++]=i>>8&255),i>>16&&(zm[Zl++]=i>>16&255))}const f7=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),g7=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),p7=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]),o0=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 EZ(...i){return function(e,t){for(let n=0,r=i.length;n0?[{start:0,end:e.length}]:[]:null}function Zwe(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function Qwe(i,e){return oU(i.toLowerCase(),e.toLowerCase(),0,0)}function oU(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let r=null;return(r=oU(i,e,t+1,n+1))?kZ({start:n,end:n+1},r):null}return oU(i,e,t,n+1)}function DZ(i){return 97<=i&&i<=122}function G3(i){return 65<=i&&i<=90}function IZ(i){return 48<=i&&i<=57}function Jwe(i){return i===32||i===9||i===10||i===13}const eSe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>eSe.add(i.charCodeAt(0)));function wO(i){return Jwe(i)||eSe.has(i)}function Nce(i,e){return i===e||wO(i)&&wO(e)}const m7=new Map;function Rce(i){if(m7.has(i))return m7.get(i);let e;const t=Rmt(i);return t&&(e=t),m7.set(i,e),e}function tSe(i){return DZ(i)||G3(i)||IZ(i)}function kZ(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function nSe(i,e){for(let t=e;t0&&!tSe(i.charCodeAt(t-1)))return t}return i.length}function sU(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let r=null,o=n+1;for(r=sU(i,e,t+1,n+1);!r&&(o=nSe(e,o)).6}function Fmt(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:r}=i;return t>.2&&e<.8&&n>.6&&r<.2}function Bmt(i){let e=0,t=0,n=0,r=0;for(let o=0;o60&&(e=e.substring(0,60));const t=Amt(e);if(!Fmt(t)){if(!Omt(t))return null;e=e.toLowerCase()}let n=null,r=0;for(i=i.toLowerCase();r0&&wO(i.charCodeAt(t-1)))return t;return i.length}const $mt=EZ(BI,iSe,Zwe),Hmt=EZ(BI,iSe,Qwe),Mce=new N_(1e4);function Pce(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=Mce.get(i);n||(n=new RegExp(urt(i),"i"),Mce.set(i,n));const r=n.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?Hmt(i,e):$mt(i,e)}function Vmt(i,e){const t=Ub(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?TT(t):null}function zmt(i,e,t,n,r,o){const s=Math.min(13,i.length);for(;t"u")return[];const e=[],t=i[1];for(let n=i.length-1;n>1;n--){const r=i[n]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const rv=128;function TZ(){const i=[],e=[];for(let t=0;t<=rv;t++)e[t]=0;for(let t=0;t<=rv;t++)i.push(e.slice(0));return i}function oSe(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const sSe=oSe(2*rv),lU=oSe(2*rv),Sg=TZ(),s0=TZ(),m2=TZ();function v2(i,e){if(e<0||e>=i.length)return!1;const t=i.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!!fY(t)}}function Ace(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function eP(i,e,t){return e[i]!==t[i]}function Umt(i,e,t,n,r,o,s=!1){for(;erv?rv:i.length,l=n.length>rv?rv:n.length;if(t>=a||o>=l||a-t>l-o||!Umt(e,t,a,r,o,l,!0))return;jmt(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d_,T=k?s0[c][u-1]+(Sg[c][u-1]>0?-5:0):0,M=h>_+1&&Sg[c][u-1]>0,P=M?s0[c][u-2]+(Sg[c][u-2]>0?-5:0):0;if(M&&(!k||P>=T)&&(!E||P>=D))s0[c][u]=P,m2[c][u]=3,Sg[c][u]=0;else if(k&&(!E||T>=D))s0[c][u]=T,m2[c][u]=2,Sg[c][u]=0;else if(E)s0[c][u]=D,m2[c][u]=1,Sg[c][u]=Sg[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[s0[c][u],o];let p=0,m=0;for(;c>=1;){let _=u;do{const y=m2[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===r[o+u-1]&&!eP(_+o-1,n,r)&&p+1>Sg[c][_]&&(_=u),_===u?p++:p=1,m||(m=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const v=m-a;return g[0]-=v,g}function jmt(i,e,t,n,r,o){let s=i-1,a=e-1;for(;s>=t&&a>=n;)r[s]===o[a]&&(lU[s]=a,s--),a--}function Kmt(i,e,t,n,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===r[s]?7:5:eP(s,r,o)&&(s===0||!eP(s-1,r,o))?(d=i[t]===r[s]?7:5,h=!0):v2(o,s)&&(s===0||!v2(o,s-1))?d=5:(v2(o,s-1)||Ace(o,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=eP(s,r,o)||v2(o,s-1)||Ace(o,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function Gmt(i,e,t,n,r,o,s){return qmt(i,e,t,n,r,o,!0,s)}function qmt(i,e,t,n,r,o,s,a){let l=Ub(i,e,t,n,r,o,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function Xmt(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Ymt="$(",NZ=new RegExp(`\\$\\(${Vt.iconNameExpression}(?:${Vt.iconModifierExpression})?\\)`,"g"),Zmt=new RegExp(`(\\\\)?${NZ.source}`,"g");function Qmt(i){return i.replace(Zmt,(e,t)=>t?e:`\\${e}`)}const Jmt=new RegExp(`\\\\${NZ.source}`,"g");function evt(i){return i.replace(Jmt,e=>`\\${e}`)}const tvt=new RegExp(`(\\s)?(\\\\)?${NZ.source}(\\s)?`,"g");function RZ(i){return i.indexOf(Ymt)===-1?i:i.replace(tvt,(e,t,n,r)=>n?e:t||r||"")}function nvt(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const v7=new RegExp(`\\$\\(${Vt.iconNameCharacter}+\\)`,"g");function nE(i){v7.lastIndex=0;let e="";const t=[];let n=0;for(;;){const r=v7.lastIndex,o=v7.exec(i),s=i.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`))}pushElement(e,t=oS.None,n=mf.None){if(e.type===0){const r=d2(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new h2(e,r,o,t.id,t.nextOrder(),n.id,n.nextOrder()))}else{const r=new Set,o=[],s=[];for(const a of e.resources){const l=d2(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),o.push(l),s.push(c))}o.length===1?this._pushElement(new h2(e,o[0],s[0],t.id,t.nextOrder(),n.id,n.nextOrder())):this._pushElement(new emt(e,o,s,t.id,t.nextOrder(),n.id,n.nextOrder()))}}_pushElement(e){for(let t=0,n=e.strResources.length;tt.sourceOrder)&&(t=s,n=r)}return[t,n]}canUndo(e){if(e instanceof mf){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){nn(e);for(const n of t.strResources)this.removeElements(n);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,n,r,o){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return me.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?me.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(me.None);const n=e.actual.prepareUndoRedo();return n?tY(n)?t(n):n.then(r=>t(r)):t(me.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||Hwe);return new c7(t)}_tryToSplitAndUndo(e,t,n,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(r),new f2(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new f2}_checkWorkspaceUndo(e,t,n,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,w({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,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(n){if(n===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,n,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:Rr.Info,message:w("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:w({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:w({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,n,!1);if(c)return c.returnValue;r=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return o.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,o,()=>this._continueUndoInGroup(t.groupId,r))}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=w({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 c7([e]),r,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=r)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof mf){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,n){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,n)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,n):this._resourceUndo(r,o,n)}finally{}}async _confirmAndContinueUndo(e,t,n){if((await this._dialogService.confirm({message:w("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:w({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:w("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,n,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,n)}async _executeWorkspaceRedo(e,t,n){let r;try{r=await this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,n,!0);if(o)return r.dispose(),o.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,r,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=w({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(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new c7([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const _u=Sn("ILanguageFeatureDebounceService");var bO;(function(i){const e=new WeakMap;let t=0;function n(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}i.of=n})(bO||(bO={}));class imt{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class rmt{constructor(e,t,n,r,o,s){this._logService=e,this._name=t,this._registry=n,this._default=r,this._min=o,this._max=s,this._cache=new R_(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>l3(bO.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?fa(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let r=this._cache.get(n);r||(r=new tmt(6),this._cache.set(n,r));const o=fa(r.update(t),this._min,this._max);return _Y(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new Vwe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return fa(e,this._min,this._max)}}let tU=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var r,o,s;const a=(r=n==null?void 0:n.min)!==null&&r!==void 0?r:50,l=(o=n==null?void 0:n.max)!==null&&o!==void 0?o:a**2,c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${bO.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new rmt(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new imt(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new Vwe;for(const t of this._data.values())e.update(t.default());return e.value}};tU=nmt([Cce(0,Ra),Cce(1,CZ)],tU);Tn(_u,tU,1);class JE{static create(e,t){return new JE(e,new CO(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 W(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new JE(this._startLineNumber,r),new JE(this._startLineNumber+s,o)]}applyEdit(e,t){const[n,r,o]=i_(t);this.acceptEdit(e,n,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new le(e.startLineNumber,e.startColumn),t,n,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const o=n-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&n>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,r,o){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,r,o)}}class CO{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;ae||h===e&&g>=t)&&(he||g===e&&m>=t){if(go?p-=o-n:p=n;else if(f===t&&g===n)if(f===r&&p>o)p-=o-n;else{u=!0;continue}else if(fo)f=t,g=n,p=g+(p-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-n,p-=o-n;else throw new Error("Not possible!");const v=4*c;s[v]=f,s[v+1]=g,s[v+2]=p,s[v+3]=m,c++}this._tokenCount=c}acceptInsertText(e,t,n,r,o,s){const a=n===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nU=class{constructor(e,t,n,r){this._legend=e,this._themeService=t,this._languageService=n,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new $g}getMetadata(e,t,n){const r=this._languageService.languageIdCodec.encodeLanguageId(n),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${fs.getForeground(s)}, fontStyle ${fs.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===hs.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===hs.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${fs.getForeground(s)}, fontStyle ${fs.getFontStyle(s).toString(2)}`)}return s}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,n,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};nU=omt([u7(1,Mo),u7(2,qi),u7(3,Ra)],nU);function zwe(i,e,t){const n=i.data,r=i.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let y=d;for(;y+1E)e.warnOverlappingSemanticTokens(L,E+1);else{const P=e.getMetadata(T,M,t);P!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=E,h[f+2]=k,h[f+3]=P,f+=4,p=L,m=k)}l=L,c=E,a++}f!==h.length&&(h=h.subarray(0,f));const v=JE.create(g,h);s.push(v)}return s}class smt{constructor(e,t,n,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=r,this.next=null}}class $g{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=$g._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<$g._SIZES.length?2/3*this._currentLength:0),this._elements=[],$g._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let n=0;n=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=$g._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<$g._SIZES.length?2/3*this._currentLength:0),this._elements=[],$g._nullOutEntries(this._elements,this._currentLength);for(const s of o){let a=s;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new smt(e,t,n,r))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}$g._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const j3=Sn("semanticTokensStylingService");var amt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let iU=class extends me{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,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 nU(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};iU=amt([d7(0,Mo),d7(1,Ra),d7(2,qi)],iU);Tn(j3,iU,1);const g2="**",wce="/",QM="[/\\\\]",JM="[^/\\\\]",lmt=/\//g;function Sce(i,e){switch(i){case 0:return"";case 1:return`${JM}*?`;default:return`(?:${QM}|${JM}+${QM}${e?`|${QM}${JM}+`:""})*?`}}function xce(i,e){if(!i)return[];const t=[];let n=!1,r=!1,o="";for(const s of i){switch(s){case e:if(!n&&!r){t.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function Uwe(i){if(!i)return"";let e="";const t=xce(i,wce);if(t.every(n=>n===g2))e=".*";else{let n=!1;t.forEach((r,o)=>{if(r===g2){if(n)return;e+=Sce(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===wce?d="":d=vc(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${xce(a,",").map(f=>Uwe(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=JM;continue;case"*":e+=Sce(1);continue;default:e+=vc(u)}}oyZ(a,e)).filter(a=>a!==Ff),i),n=t.length;if(!n)return Ff;if(n===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Ice(i,e,t){const n=ih===lo.sep,r=n?i:i.replace(lmt,ih),o=ih+r,s=lo.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function _mt(i){try{const e=new RegExp(`^${Uwe(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return Ff}}function bmt(i,e,t){return!i||typeof e!="string"?!1:jwe(i)(e,void 0,t)}function jwe(i,e={}){if(!i)return Ece;if(typeof i=="string"||Cmt(i)){const t=yZ(i,e);if(t===Ff)return Ece;const n=function(r,o){return!!t(r,o)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return ymt(i,e)}function Cmt(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function ymt(i,e){const t=Kwe(Object.getOwnPropertyNames(i).map(a=>wmt(a,i[a],e)).filter(a=>a!==Ff)),n=t.length;if(!n)return Ff;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f{for(const f of h){const g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,f=t.length;h{for(const h of d){const f=await h;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function wmt(i,e,t){if(e===!1)return Ff;const n=yZ(i,t);if(n===Ff)return Ff;if(typeof e=="boolean")return n;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return JV(d)?d.then(h=>h?i:null):d?i:null};return o.requiresSiblings=!0,o}}return n}function Kwe(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?r[c]:null};o.basenames=n,o.patterns=r,o.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(o),s}function wZ(i,e,t,n,r,o){if(Array.isArray(i)){let s=0;for(const a of i){const l=wZ(a,e,t,n,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:ZCe(a.base)},h===e.fsPath||bmt(h,e.fsPath))d=10;else return 0}return d}else return 0}}function Gwe(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(Gwe):!!i.exclusive}class kce{constructor(e,t,n,r){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=r}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class ir{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new ae,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ot(()=>{if(n){const r=this._entries.indexOf(n);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,r;return this._orderedForEach(e,o=>{n&&r===o._score?n.push(o.provider):(r=o._score,n=[o.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new kce(e.uri,e.getLanguageId(),r.uri,r.type):new kce(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=wZ(s.selector,o.uri,o.languageId,uye(e),o.notebookUri,o.notebookType),Gwe(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(ir._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:tE(e.selector)&&!tE(t.selector)?1:!tE(e.selector)&&tE(t.selector)?-1:e._timet._time?-1:0}}function tE(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(tE):!!i.isBuiltin}class Smt{constructor(){this.referenceProvider=new ir(this._score.bind(this)),this.renameProvider=new ir(this._score.bind(this)),this.newSymbolNamesProvider=new ir(this._score.bind(this)),this.codeActionProvider=new ir(this._score.bind(this)),this.definitionProvider=new ir(this._score.bind(this)),this.typeDefinitionProvider=new ir(this._score.bind(this)),this.declarationProvider=new ir(this._score.bind(this)),this.implementationProvider=new ir(this._score.bind(this)),this.documentSymbolProvider=new ir(this._score.bind(this)),this.inlayHintsProvider=new ir(this._score.bind(this)),this.colorProvider=new ir(this._score.bind(this)),this.codeLensProvider=new ir(this._score.bind(this)),this.documentFormattingEditProvider=new ir(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ir(this._score.bind(this)),this.onTypeFormattingEditProvider=new ir(this._score.bind(this)),this.signatureHelpProvider=new ir(this._score.bind(this)),this.hoverProvider=new ir(this._score.bind(this)),this.documentHighlightProvider=new ir(this._score.bind(this)),this.multiDocumentHighlightProvider=new ir(this._score.bind(this)),this.selectionRangeProvider=new ir(this._score.bind(this)),this.foldingRangeProvider=new ir(this._score.bind(this)),this.linkProvider=new ir(this._score.bind(this)),this.inlineCompletionsProvider=new ir(this._score.bind(this)),this.inlineEditProvider=new ir(this._score.bind(this)),this.completionProvider=new ir(this._score.bind(this)),this.linkedEditingRangeProvider=new ir(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ir(this._score.bind(this)),this.documentSemanticTokensProvider=new ir(this._score.bind(this)),this.documentOnDropEditProvider=new ir(this._score.bind(this)),this.documentPasteEditProvider=new ir(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Tn(yt,Smt,1);var xmt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Tce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const SZ=Sn("hoverService");let yO=class extends me{get delay(){return this.instantHover&&Date.now()-this.lastHoverHideTime{s.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const n=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const r=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const o of r)this.hoverDisposables.add(Lr(o,"keydown",s=>{s.equals(9)&&this.hoverService.hideHover()}));return this.hoverService.showHover({...e,persistence:{hideOnHover:!0},...n},t)}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};yO=xmt([Tce(3,mn),Tce(4,SZ)],yO);const og=Sn("contextViewService"),$l=Sn("contextMenuService");const p2=Xe;let xZ=class extends me{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 ST(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class K3 extends me{static render(e,t,n){return new K3(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Oe(e,p2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Oe(this.actionContainer,p2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Oe(this.action,p2(`span.icon.${t.iconClass}`));const r=Oe(this.action,p2("span"));r.textContent=n?`${t.label} (${n})`:t.label,this._register(xe(this.actionContainer,Je.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(xe(this.actionContainer,Je.KEY_DOWN,o=>{const s=new Oi(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function qwe(i,e){return i&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}const hl=Sn("openerService");function Lmt(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}function Emt(i,e={}){const t=LZ(e);return t.textContent=i,t}function Dmt(i,e={}){const t=LZ(e);return Xwe(t,kmt(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function LZ(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class Imt{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 Xwe(i,e,t,n){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&&n)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Lr(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=i);r&&i!==r&&i.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{Xwe(r,o,t,n)})}function kmt(i,e){const t={type:1,children:[]};let n=0,r=t;const o=[],s=new Imt(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&rU(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&Tmt(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=rU(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),r.children.push(u),o.push(r),r=u}}else if(a===` +`)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function Tmt(i,e){return rU(i,e)!==0}function rU(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Nmt=new RegExp(`(\\\\)?\\$\\((${Vt.iconNameExpression}(?:${Vt.iconModifierExpression})?)\\)`,"g");function Tv(i){const e=new Array;let t,n=0,r=0;for(;(t=Nmt.exec(i))!==null;){r=t.index||0,n0)return new Uint32Array(e)}let Zl=0;const zm=new Uint32Array(10);function Mmt(i){if(Zl=0,zh(i,f7,4352),Zl>0||(zh(i,g7,4449),Zl>0)||(zh(i,p7,4520),Zl>0)||(zh(i,s0,12593),Zl))return zm.subarray(0,Zl);if(i>=44032&&i<=55203){const e=i-44032,t=e%588,n=Math.floor(e/588),r=Math.floor(t/28),o=t%28-1;if(n=0&&(o0)return zm.subarray(0,Zl)}}function zh(i,e,t){i>=t&&i>8&&(zm[Zl++]=i>>8&255),i>>16&&(zm[Zl++]=i>>16&255))}const f7=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),g7=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),p7=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]),s0=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 EZ(...i){return function(e,t){for(let n=0,r=i.length;n0?[{start:0,end:e.length}]:[]:null}function Zwe(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function Qwe(i,e){return oU(i.toLowerCase(),e.toLowerCase(),0,0)}function oU(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let r=null;return(r=oU(i,e,t+1,n+1))?kZ({start:n,end:n+1},r):null}return oU(i,e,t,n+1)}function DZ(i){return 97<=i&&i<=122}function G3(i){return 65<=i&&i<=90}function IZ(i){return 48<=i&&i<=57}function Jwe(i){return i===32||i===9||i===10||i===13}const eSe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>eSe.add(i.charCodeAt(0)));function wO(i){return Jwe(i)||eSe.has(i)}function Nce(i,e){return i===e||wO(i)&&wO(e)}const m7=new Map;function Rce(i){if(m7.has(i))return m7.get(i);let e;const t=Rmt(i);return t&&(e=t),m7.set(i,e),e}function tSe(i){return DZ(i)||G3(i)||IZ(i)}function kZ(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function nSe(i,e){for(let t=e;t0&&!tSe(i.charCodeAt(t-1)))return t}return i.length}function sU(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let r=null,o=n+1;for(r=sU(i,e,t+1,n+1);!r&&(o=nSe(e,o)).6}function Fmt(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:r}=i;return t>.2&&e<.8&&n>.6&&r<.2}function Bmt(i){let e=0,t=0,n=0,r=0;for(let o=0;o60&&(e=e.substring(0,60));const t=Amt(e);if(!Fmt(t)){if(!Omt(t))return null;e=e.toLowerCase()}let n=null,r=0;for(i=i.toLowerCase();r0&&wO(i.charCodeAt(t-1)))return t;return i.length}const $mt=EZ(BI,iSe,Zwe),Hmt=EZ(BI,iSe,Qwe),Mce=new R_(1e4);function Pce(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=Mce.get(i);n||(n=new RegExp(urt(i),"i"),Mce.set(i,n));const r=n.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?Hmt(i,e):$mt(i,e)}function Vmt(i,e){const t=jb(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?TT(t):null}function zmt(i,e,t,n,r,o){const s=Math.min(13,i.length);for(;t"u")return[];const e=[],t=i[1];for(let n=i.length-1;n>1;n--){const r=i[n]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const rv=128;function TZ(){const i=[],e=[];for(let t=0;t<=rv;t++)e[t]=0;for(let t=0;t<=rv;t++)i.push(e.slice(0));return i}function oSe(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const sSe=oSe(2*rv),lU=oSe(2*rv),Sg=TZ(),a0=TZ(),m2=TZ();function v2(i,e){if(e<0||e>=i.length)return!1;const t=i.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!!fY(t)}}function Ace(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function eP(i,e,t){return e[i]!==t[i]}function Umt(i,e,t,n,r,o,s=!1){for(;erv?rv:i.length,l=n.length>rv?rv:n.length;if(t>=a||o>=l||a-t>l-o||!Umt(e,t,a,r,o,l,!0))return;jmt(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d_,T=k?a0[c][u-1]+(Sg[c][u-1]>0?-5:0):0,M=h>_+1&&Sg[c][u-1]>0,P=M?a0[c][u-2]+(Sg[c][u-2]>0?-5:0):0;if(M&&(!k||P>=T)&&(!E||P>=D))a0[c][u]=P,m2[c][u]=3,Sg[c][u]=0;else if(k&&(!E||T>=D))a0[c][u]=T,m2[c][u]=2,Sg[c][u]=0;else if(E)a0[c][u]=D,m2[c][u]=1,Sg[c][u]=Sg[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[a0[c][u],o];let p=0,m=0;for(;c>=1;){let _=u;do{const y=m2[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===r[o+u-1]&&!eP(_+o-1,n,r)&&p+1>Sg[c][_]&&(_=u),_===u?p++:p=1,m||(m=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const v=m-a;return g[0]-=v,g}function jmt(i,e,t,n,r,o){let s=i-1,a=e-1;for(;s>=t&&a>=n;)r[s]===o[a]&&(lU[s]=a,s--),a--}function Kmt(i,e,t,n,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===r[s]?7:5:eP(s,r,o)&&(s===0||!eP(s-1,r,o))?(d=i[t]===r[s]?7:5,h=!0):v2(o,s)&&(s===0||!v2(o,s-1))?d=5:(v2(o,s-1)||Ace(o,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=eP(s,r,o)||v2(o,s-1)||Ace(o,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function Gmt(i,e,t,n,r,o,s){return qmt(i,e,t,n,r,o,!0,s)}function qmt(i,e,t,n,r,o,s,a){let l=jb(i,e,t,n,r,o,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function Xmt(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Ymt="$(",NZ=new RegExp(`\\$\\(${Vt.iconNameExpression}(?:${Vt.iconModifierExpression})?\\)`,"g"),Zmt=new RegExp(`(\\\\)?${NZ.source}`,"g");function Qmt(i){return i.replace(Zmt,(e,t)=>t?e:`\\${e}`)}const Jmt=new RegExp(`\\\\${NZ.source}`,"g");function evt(i){return i.replace(Jmt,e=>`\\${e}`)}const tvt=new RegExp(`(\\s)?(\\\\)?${NZ.source}(\\s)?`,"g");function RZ(i){return i.indexOf(Ymt)===-1?i:i.replace(tvt,(e,t,n,r)=>n?e:t||r||"")}function nvt(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const v7=new RegExp(`\\$\\(${Vt.iconNameCharacter}+\\)`,"g");function nE(i){v7.lastIndex=0;let e="";const t=[];let n=0;for(;;){const r=v7.lastIndex,o=v7.exec(i),s=i.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` @@ -674,11 +674,11 @@ Please report this to https://github.com/markedjs/marked.`,ue.silent)return"

A `,i.tablerow=e=>e,i.tablecell=(e,t)=>e+" ",i.strong=e=>e,i.em=e=>e,i.codespan=e=>e,i.br=()=>` `,i.del=e=>e,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function PZ(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function pvt(i){var e,t;for(let n=0;nFce(a.raw)))return wvt(i)}}}}function Fce(i){return!!i.match(/^[^\[]*\]\([^\)]*$/)}function mvt(i){let e,t;for(e=0;e"u"&&s.match(/^\s*\|/)){const a=s.match(/(\|[^\|]+)(?=\||$)/g);a&&(n=a.length)}else if(typeof n=="number")if(s.match(/^\s*\|/)){if(o!==t.length-1)return;r=!0}else return}if(typeof n=="number"&&n>0){const o=r?t.slice(0,-1).join(` `):e,s=!!o.match(/\|\s*$/),a=o+(s?"":"|")+` -|${" --- |".repeat(n)}`;return vf.lexer(a)}}var Evt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fU;let qf=fU=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new ae,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new Fe,o=r.add(X3(e,{...this._getRenderOptions(e,r),...t},n));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(n,r)=>{var o,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=mc);const c=await vpt(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=fU._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);vs(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>AZ(this._openerService,n,e.isTrusted),disposables:t}}}};qf._ttpTokenizer=Gp("tokenizeToString",{createHTML(i){return i}});qf=fU=Evt([Wce(1,qi),Wce(2,hl)],qf);async function AZ(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Dvt(t)})}catch(n){return nn(n),!1}}function Dvt(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var Ivt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Uh=Xe;let gU=class extends Lc{get _targetWindow(){return Bt(this._target.targetElements[0])}get _targetDocumentElement(){return Bt(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,n,r,o,s){var a,l,c,u,d,h,f,g;super(),this._keybindingService=t,this._configurationService=n,this._openerService=r,this._instantiationService=o,this._accessibilityService=s,this._messageListeners=new Fe,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 ae),this._onRequestLayout=this._register(new ae),this._linkHandler=e.linkHandler||(S=>AZ(this._openerService,S,Bf(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new kvt(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Uh("div.workbench-hover-pointer"):void 0,this._hover=this._register(new xZ),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((u=e.position)===null||u===void 0)&&u.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(d=e.position)===null||d===void 0?void 0:d.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,S=>S.stopPropagation()),this.onkeydown(this._hover.containerDomNode,S=>{S.equals(9)&&this.dispose()}),this._register(xe(this._targetWindow,"blur",()=>this.dispose()));const p=Uh("div.hover-row.markdown-hover"),m=Uh("div.hover-contents");if(typeof e.content=="string")m.textContent=e.content,m.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)m.appendChild(e.content),m.classList.add("html-hover-contents");else{const S=e.content,L=this._instantiationService.createInstance(qf,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||il.fontFamily}),{element:E}=L.render(S,{actionHandler:{callback:D=>this._linkHandler(D),disposables:this._messageListeners},asyncRenderCallback:()=>{m.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});m.appendChild(E)}if(p.appendChild(m),this._hover.contentsDomNode.appendChild(p),e.actions&&e.actions.length>0){const S=Uh("div.hover-row.status-bar"),L=Uh("div.actions");e.actions.forEach(E=>{const D=this._keybindingService.lookupKeybinding(E.commandId),k=D?D.getLabel():null;K3.render(L,{label:E.label,commandId:E.commandId,run:T=>{E.run(T),this.dispose()},iconClass:E.iconClass},k)}),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}this._hoverContainer=Uh("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let v;if(e.actions&&e.actions.length>0?v=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?v=typeof e.content=="string"||Bf(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):v=e.persistence.hideOnHover,v&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){const S=Uh("div.hover-row.status-bar"),L=Uh("div.info");L.textContent=w("hoverhint","Hold {0} key to mouse over",Dn?"Option":"Alt"),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}const _=[...this._target.targetElements];v||_.push(this._hoverContainer);const y=this._register(new $ce(_));if(this._register(y.onMouseOut(()=>{this._isLocked||this.dispose()})),v){const S=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new $ce(S)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=y}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const n=xY(this._hoverContainer,Uh("div")),r=Oe(this._hoverContainer,Uh("div"));n.tabIndex=0,r.tabIndex=0,this._register(xe(r,"focus",o=>{e.focus(),o.preventDefault()})),this._register(xe(n,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const r=this.findLastFocusableChild(n);if(r)return r}}render(e){var t;e.appendChild(this._hoverContainer);const r=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&qwe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());r&&jf(r),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=u=>{const d=T1e(u),h=u.getBoundingClientRect();return{top:h.top*d,bottom:h.bottom*d,right:h.right*d,left:h.left*d}},t=this._target.targetElements.map(u=>e(u)),n=Math.min(...t.map(u=>u.top)),r=Math.max(...t.map(u=>u.right)),o=Math.max(...t.map(u=>u.bottom)),s=Math.min(...t.map(u=>u.left)),a=r-s,l=o-n,c={top:n,right:r,bottom:o,left:s,width:a,height:l,center:{x:s+a/2,y:n+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._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x===void 0){if(this._forcePosition){const t=(this._hoverPointer?3:0)+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-t}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-t}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}}adjustVerticalHoverPosition(e){this._target.y!==void 0||this._forcePosition||(this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight>this._targetWindow.innerHeight&&(this._hoverPosition=3))}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const n=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-n):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-n))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.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 n=Math.round(t/2)-3;const r=this._x+n;(re.right)&&(n=e.center.x-this._x-3),this._hoverPointer.style.left=`${n}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}};gU=Ivt([fL(1,ci),fL(2,mn),fL(3,hl),fL(4,Wt),fL(5,pd)],gU);class $ce extends Lc{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 ae),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=Bt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Bt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class kvt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Tvt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let pU=class{constructor(e,t,n,r,o,s){this._instantiationService=e,this._contextViewService=t,this._keybindingService=r,this._layoutService=o,this._accessibilityService=s,n.onDidShowContextMenu(()=>this.hideHover())}showHover(e,t,n){var r,o,s,a;if(Hce(this._currentHoverOptions)===Hce(e)||this._currentHover&&(!((o=(r=this._currentHoverOptions)===null||r===void 0?void 0:r.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=ps();n||(l&&c?this._lastFocusedElementBeforeOpen=c:this._lastFocusedElementBeforeOpen=void 0);const u=new Fe,d=this._instantiationService.createInstance(gU,e);if(!((s=e.persistence)===null||s===void 0)&&s.sticky&&(d.isLocked=!0),d.onDispose(()=>{var f,g;((f=this._currentHover)===null||f===void 0?void 0:f.domNode)&&R1e(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),u.dispose()}),!e.container){const f=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Bt(f))}const h=this._contextViewService;if(h.showContextView(new Nvt(d,t),e.container),d.onRequestLayout(()=>h.layout()),!((a=e.persistence)===null||a===void 0)&&a.sticky)u.add(xe(Bt(e.container).document,Je.MOUSE_DOWN,f=>{ts(f.target,d.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)u.add(xe(g,Je.CLICK,()=>this.hideHover()));else u.add(xe(e.target,Je.CLICK,()=>this.hideHover()));const f=ps();if(f){const g=Bt(f).document;u.add(xe(f,Je.KEY_DOWN,p=>{var m;return this._keyDown(p,d,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),u.add(xe(g,Je.KEY_DOWN,p=>{var m;return this._keyDown(p,d,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),u.add(xe(f,Je.KEY_UP,p=>this._keyUp(p,d))),u.add(xe(g,Je.KEY_UP,p=>this._keyUp(p,d)))}}if("IntersectionObserver"in hi){const f=new IntersectionObserver(p=>this._intersectionChange(p,d),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(g),u.add(Ot(()=>f.disconnect()))}return this._currentHover=d,d}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewService.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}_keyDown(e,t,n){var r,o;if(e.key==="Alt"){t.isLocked=!0;return}const s=new Oi(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||n&&(!(!((r=this._currentHoverOptions)===null||r===void 0)&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var n;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(n=this._lastFocusedElementBeforeOpen)===null||n===void 0||n.focus()))}};pU=Tvt([y1(0,Wt),y1(1,og),y1(2,$l),y1(3,ci),y1(4,xC),y1(5,pd)],pU);function Hce(i){var e;if(i!==void 0)return(e=i==null?void 0:i.id)!==null&&e!==void 0?e:i}class Nvt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t}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()}}Tn(SZ,pU,1);vu((i,e)=>{const t=i.getColor(Nye);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 NT=Sn("IWorkspaceEditService");class OZ{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Nv.is(t))return Nv.lift(t);if(uw.is(t))return uw.lift(t);throw new Error("Unsupported edit")})}}class Nv extends OZ{static is(e){return e instanceof Nv?!0:ba(e)&&Ft.isUri(e.resource)&&ba(e.textEdit)}static lift(e){return e instanceof Nv?e:new Nv(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=n}}class uw extends OZ{static is(e){return e instanceof uw?!0:ba(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof uw?e:new uw(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},r){super(r),this.oldResource=e,this.newResource=t,this.options=n}}const js={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},Y3=Object.freeze({id:"editor",order:5,type:"object",title:w("editorConfigurationTitle","Editor"),scope:5}),SO={...Y3,properties:{"editor.tabSize":{type:"number",default:Ts.tabSize,minimum:1,markdownDescription:w("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:w("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:Ts.insertSpaces,markdownDescription:w("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:Ts.detectIndentation,markdownDescription:w("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:Ts.trimAutoWhitespace,description:w("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ts.largeFileOptimizations,description:w("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[w("wordBasedSuggestions.off","Turn off Word Based Suggestions."),w("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),w("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),w("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:w("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:[w("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),w("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),w("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:w("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:w("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:w("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:w("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:w("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:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:js.maxComputationTime,description:w("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:js.maxFileSize,description:w("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:js.renderSideBySide,description:w("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:js.renderSideBySideInlineBreakpoint,description:w("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:js.useInlineViewWhenSpaceIsLimited,description:w("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:js.renderMarginRevertIcon,description:w("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:js.ignoreTrimWhitespace,description:w("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:js.renderIndicators,description:w("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:js.diffCodeLens,description:w("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:js.diffWordWrap,markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:js.diffAlgorithm,markdownEnumDescriptions:[w("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),w("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:js.hideUnchangedRegions.enabled,markdownDescription:w("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:js.hideUnchangedRegions.revealLineCount,markdownDescription:w("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:js.hideUnchangedRegions.minimumLineCount,markdownDescription:w("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:js.hideUnchangedRegions.contextLineCount,markdownDescription:w("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:js.experimental.showMoves,markdownDescription:w("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:js.experimental.showEmptyDecorations,description:w("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function Rvt(i){return typeof i.type<"u"||typeof i.anyOf<"u"}for(const i of uy){const e=i.schema;if(typeof e<"u")if(Rvt(e))SO.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(SO.properties[t]=e[t])}let b2=null;function aSe(){return b2===null&&(b2=Object.create(null),Object.keys(SO.properties).forEach(i=>{b2[i]=!0})),b2}function Mvt(i){return aSe()[`editor.${i}`]||!1}function Pvt(i){return aSe()[`diffEditor.${i}`]||!1}const Avt=ur.as(Rh.Configuration);Avt.registerConfiguration(SO);class Qi{static insert(e,t){return{range:new W(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 C2(i){return Object.isFrozen(i)?i:fnt(i)}class us{constructor(e={},t=[],n=[],r){this._contents=e,this._keys=t,this._overrides=n,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof us)return n;const r=new Ovt("");return r.parseRaw(n),r.configurationModel});this._rawConfiguration=t.reduce((n,r)=>r===n?r:n.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?mae(this.contents,e):this.contents}inspect(e,t){const n=this;return{get value(){return C2(n.rawConfiguration.getValue(e))},get override(){return t?C2(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return C2(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:o,identifiers:s,keys:a}of n.rawConfiguration.overrides){const l=new us(o,a).getValue(e);l!==void 0&&r.push({identifiers:s,value:l})}return r.length?C2(r):void 0}}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?mae(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const r=Fg(this.contents),o=Fg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>lr(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=Ap(u.keys)):o.push(Fg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new us(r,s,o,a.every(l=>l instanceof us)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const r of Ap([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=Fg(o),this.mergeContents(o,s)):o=s),n[r]=o}return new us(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ba(e[n])&&ba(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=Fg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const r=o=>{o&&(n?this.mergeContents(n,o):n=Fg(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Kst(this.contents,e),Jv.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>lr(n.identifiers,KA(e))),1))}updateValue(e,t,n){nye(this.contents,e,t,r=>console.error(r)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Jv.test(e)&&this.overrides.push({identifiers:KA(e),keys:Object.keys(this.contents[e]),contents:dz(this.contents[e],r=>console.error(r))})}}class Ovt{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new us}parseRaw(e,t){this._raw=e;const{contents:n,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new us(n,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=ur.as(Rh.Configuration).getConfigurationProperties(),r=this.filter(e,n,!0,t);e=r.raw;const o=dz(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,n,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(Jv.test(d)&&n){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const r of Object.keys(e))if(Jv.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];n.push({identifiers:KA(r),keys:Object.keys(o),contents:dz(o,t)})}return n}}class Fvt{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}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 Z3{constructor(e,t,n,r,o=new us,s=new us,a=new Mr,l=new us,c=new Mr){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Mr,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=new us,this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const r=this.getConsolidatedConfigurationModel(e,t,n),o=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new Fvt(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,n?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);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 n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);const o=this._memoryConfigurationByResource.get(e);o&&(n=n.merge(o))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},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:n,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Ft.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Mr);return new Z3(t,n,r,o,new us,s,a,new us,new Mr)}static parseConfigurationModel(e){return new us(e.contents,e.keys,e.overrides)}}class Bvt{constructor(e,t,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Z3.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!pc(l,c)}return!0}}const xO={kind:0},Wvt={kind:1};function $vt(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class eD{constructor(e,t,n){var r;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=eD.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a"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 n=0,r=t.length;n"u"||n.length===0)return null;if(n.length===1)return n[0];for(let r=n.length-1;r>=0;r--){const o=n[r];if(t.contextMatchesRules(o.when))return o}return n[n.length-1]}resolve(e,t,n){const r=[...t,n];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),xO;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const r=t[n];if(eD._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Vce(i){return i?`${i.serialize()}`:"no when condition"}function zce(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const Hvt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Vvt extends me{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ot.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new ae),this._currentChords=[],this._currentChordChecker=new vY,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Ly.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new gd,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 n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),xO;const[r]=n.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),xO;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw eY("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(w("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(w("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),$E.enabled&&$E.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],$E.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[r]=n.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=Ly.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Ly.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(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=n.getChords();return this._ignoreSingleModifiers=new Ly(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),this._currentlyDispatchingCommandId=u.commandId;try{typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}Hvt.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Ly{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}}}Ly.EMPTY=new Ly(null);class Uce{constructor(e,t,n,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?mU(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=mU(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function mU(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return zvt.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Uvt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return jvt.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 Ert(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 WI extends Gvt{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 Vg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Vg.toString(e.keyCode)}_getElectronAccelerator(e){return Vg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Vg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return WI.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+=Vg.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=sY[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 Bp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Bp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=mU(e.chords.map(r=>this._toKeyCodeChord(r)));return n.length>0?[new WI(n,t)]:[]}}const lS=Sn("labelService"),lSe=Sn("progressService");class yp{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}yp.None=Object.freeze({report(){}});const P_=Sn("editorProgressService");class qvt{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=0;t--,this._valueLen--){const n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new dw(new Zvt(e,t))}static forStrings(){return new dw(new qvt)}static forConfigKeys(){return new dw(new Xvt)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let r;this._root||(this._root=new y2,this._root.segment=n.value());const o=[];for(r=this._root;;){const a=n.cmp(r.segment);if(a>0)r.left||(r.left=new y2,r.left.segment=n.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new y2,r.right.segment=n.value()),o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new y2,r.mid.segment=n.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,r;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),r=n.value||r,n=n.mid;else break}return n&&n.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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 jb=Sn("contextService");function vU(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Ft.isUri(e.uri)}function Qvt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!vU(i)&&!n_t(i)}const Jvt={id:"ext-dev"},e_t={id:"empty-window"};function t_t(i,e){if(typeof i=="string"||typeof i>"u")return typeof i=="string"?{id:Lv(i)}:e?Jvt:e_t;const t=i;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 n_t(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Ft.isUri(e.configPath)}class i_t{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 _U="code-workspace";w("codeWorkspace","Code Workspace");const cSe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function r_t(i){return i.id===cSe}var bU;(function(i){i.inspectTokensAction=w("inspectTokens","Developer: Inspect Tokens")})(bU||(bU={}));var LO;(function(i){i.gotoLineActionLabel=w("gotoLineActionLabel","Go to Line/Column...")})(LO||(LO={}));var CU;(function(i){i.helpQuickAccessActionLabel=w("helpQuickAccess","Show all Quick Access Providers")})(CU||(CU={}));var EO;(function(i){i.quickCommandActionLabel=w("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=w("quickCommandActionHelp","Show And Run Commands")})(EO||(EO={}));var $I;(function(i){i.quickOutlineActionLabel=w("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=w("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})($I||($I={}));var DO;(function(i){i.editorViewAccessibleLabel=w("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=w("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(DO||(DO={}));var yU;(function(i){i.toggleHighContrast=w("toggleHighContrast","Toggle High Contrast Theme")})(yU||(yU={}));var wU;(function(i){i.bulkEditServiceSummary=w("bulkEditServiceSummary","Made {0} edits in {1} files")})(wU||(wU={}));const uSe=Sn("workspaceTrustManagementService");var Es;(function(i){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(o){return o.end-o.start<=0}i.isEmpty=t;function n(o,s){return!t(e(o,s))}i.intersects=n;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=r})(Es||(Es={}));function o_t(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var ov;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(ov||(ov={}));function Ey(i,e,t){const n=t.mode===ov.ALIGN?t.offset:t.offset+t.size,r=t.mode===ov.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=r?r-e:Math.max(i-e,0):e<=r?r-e:e<=i-n?n:0}class cS extends me{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=me.None,this.toDisposeOnSetContainer=me.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Xe(".context-view"),pa(this.view),this.setContainer(e,t),this._register(Ot(()=>this.setContainer(null,1)))}setContainer(e,t){var n;this.useFixedPosition=t!==1;const r=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&r===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=Xe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=s_t,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Xe("slot"))}else this.container.appendChild(this.view);const o=new Fe;cS.BUBBLE_UP_EVENTS.forEach(s=>{o.add(Lr(this.container,s,a=>{this.onDOMEvent(a,!1)}))}),cS.BUBBLE_DOWN_EVENTS.forEach(s=>{o.add(Lr(this.container,s,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ps(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Sl(this.view),this.toDisposeOnClean=e.render(this.view)||me.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(fh&&pY.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const h=Hr(e),f=T1e(e);t={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else o_t(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 n=ha(this.view),r=ep(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const u=xot();if(a===0){const h={offset:t.top-u.pageYOffset,size:t.height,position:o===0?0:1},f={offset:t.left,size:t.width,position:s===0?0:1,mode:ov.ALIGN};l=Ey(u.innerHeight,r,h)+u.pageYOffset,Es.intersects({start:l,end:l+r},{start:h.offset,end:h.offset+h.size})&&(f.mode=ov.AVOID),c=Ey(u.innerWidth,n,f)}else{const h={offset:t.left,size:t.width,position:s===0?0:1},f={offset:t.top,size:t.height,position:o===0?0:1,mode:ov.ALIGN};c=Ey(u.innerWidth,n,h),Es.intersects({start:c,end:c+n},{start:h.offset,end:h.offset+h.size})&&(f.mode=ov.AVOID),l=Ey(u.innerHeight,r,f)+u.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Hr(this.container);this.view.style.top=`${l-(this.useFixedPosition?Hr(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Hr(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(),pa(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Bt(e).document.activeElement):t&&!ts(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}cS.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];cS.BUBBLE_DOWN_EVENTS=["click"];const s_t=` +|${" --- |".repeat(n)}`;return vf.lexer(a)}}var Evt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fU;let qf=fU=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new ae,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new Fe,o=r.add(X3(e,{...this._getRenderOptions(e,r),...t},n));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(n,r)=>{var o,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=mc);const c=await vpt(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=fU._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);vs(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>AZ(this._openerService,n,e.isTrusted),disposables:t}}}};qf._ttpTokenizer=Gp("tokenizeToString",{createHTML(i){return i}});qf=fU=Evt([Wce(1,qi),Wce(2,hl)],qf);async function AZ(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Dvt(t)})}catch(n){return nn(n),!1}}function Dvt(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var Ivt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Uh=Xe;let gU=class extends Lc{get _targetWindow(){return Bt(this._target.targetElements[0])}get _targetDocumentElement(){return Bt(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,n,r,o,s){var a,l,c,u,d,h,f,g;super(),this._keybindingService=t,this._configurationService=n,this._openerService=r,this._instantiationService=o,this._accessibilityService=s,this._messageListeners=new Fe,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 ae),this._onRequestLayout=this._register(new ae),this._linkHandler=e.linkHandler||(S=>AZ(this._openerService,S,Bf(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new kvt(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Uh("div.workbench-hover-pointer"):void 0,this._hover=this._register(new xZ),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((u=e.position)===null||u===void 0)&&u.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(d=e.position)===null||d===void 0?void 0:d.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,S=>S.stopPropagation()),this.onkeydown(this._hover.containerDomNode,S=>{S.equals(9)&&this.dispose()}),this._register(xe(this._targetWindow,"blur",()=>this.dispose()));const p=Uh("div.hover-row.markdown-hover"),m=Uh("div.hover-contents");if(typeof e.content=="string")m.textContent=e.content,m.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)m.appendChild(e.content),m.classList.add("html-hover-contents");else{const S=e.content,L=this._instantiationService.createInstance(qf,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||il.fontFamily}),{element:E}=L.render(S,{actionHandler:{callback:D=>this._linkHandler(D),disposables:this._messageListeners},asyncRenderCallback:()=>{m.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});m.appendChild(E)}if(p.appendChild(m),this._hover.contentsDomNode.appendChild(p),e.actions&&e.actions.length>0){const S=Uh("div.hover-row.status-bar"),L=Uh("div.actions");e.actions.forEach(E=>{const D=this._keybindingService.lookupKeybinding(E.commandId),k=D?D.getLabel():null;K3.render(L,{label:E.label,commandId:E.commandId,run:T=>{E.run(T),this.dispose()},iconClass:E.iconClass},k)}),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}this._hoverContainer=Uh("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let v;if(e.actions&&e.actions.length>0?v=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?v=typeof e.content=="string"||Bf(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):v=e.persistence.hideOnHover,v&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){const S=Uh("div.hover-row.status-bar"),L=Uh("div.info");L.textContent=w("hoverhint","Hold {0} key to mouse over",Dn?"Option":"Alt"),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}const _=[...this._target.targetElements];v||_.push(this._hoverContainer);const y=this._register(new $ce(_));if(this._register(y.onMouseOut(()=>{this._isLocked||this.dispose()})),v){const S=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new $ce(S)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=y}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const n=xY(this._hoverContainer,Uh("div")),r=Oe(this._hoverContainer,Uh("div"));n.tabIndex=0,r.tabIndex=0,this._register(xe(r,"focus",o=>{e.focus(),o.preventDefault()})),this._register(xe(n,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const r=this.findLastFocusableChild(n);if(r)return r}}render(e){var t;e.appendChild(this._hoverContainer);const r=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&qwe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());r&&jf(r),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=u=>{const d=T1e(u),h=u.getBoundingClientRect();return{top:h.top*d,bottom:h.bottom*d,right:h.right*d,left:h.left*d}},t=this._target.targetElements.map(u=>e(u)),n=Math.min(...t.map(u=>u.top)),r=Math.max(...t.map(u=>u.right)),o=Math.max(...t.map(u=>u.bottom)),s=Math.min(...t.map(u=>u.left)),a=r-s,l=o-n,c={top:n,right:r,bottom:o,left:s,width:a,height:l,center:{x:s+a/2,y:n+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._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x===void 0){if(this._forcePosition){const t=(this._hoverPointer?3:0)+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-t}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-t}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}}adjustVerticalHoverPosition(e){this._target.y!==void 0||this._forcePosition||(this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight>this._targetWindow.innerHeight&&(this._hoverPosition=3))}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const n=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-n):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-n))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.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 n=Math.round(t/2)-3;const r=this._x+n;(re.right)&&(n=e.center.x-this._x-3),this._hoverPointer.style.left=`${n}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}};gU=Ivt([fL(1,ci),fL(2,mn),fL(3,hl),fL(4,Wt),fL(5,pd)],gU);class $ce extends Lc{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 ae),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=Bt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Bt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class kvt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Tvt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let pU=class{constructor(e,t,n,r,o,s){this._instantiationService=e,this._contextViewService=t,this._keybindingService=r,this._layoutService=o,this._accessibilityService=s,n.onDidShowContextMenu(()=>this.hideHover())}showHover(e,t,n){var r,o,s,a;if(Hce(this._currentHoverOptions)===Hce(e)||this._currentHover&&(!((o=(r=this._currentHoverOptions)===null||r===void 0?void 0:r.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=ps();n||(l&&c?this._lastFocusedElementBeforeOpen=c:this._lastFocusedElementBeforeOpen=void 0);const u=new Fe,d=this._instantiationService.createInstance(gU,e);if(!((s=e.persistence)===null||s===void 0)&&s.sticky&&(d.isLocked=!0),d.onDispose(()=>{var f,g;((f=this._currentHover)===null||f===void 0?void 0:f.domNode)&&R1e(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),u.dispose()}),!e.container){const f=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Bt(f))}const h=this._contextViewService;if(h.showContextView(new Nvt(d,t),e.container),d.onRequestLayout(()=>h.layout()),!((a=e.persistence)===null||a===void 0)&&a.sticky)u.add(xe(Bt(e.container).document,Je.MOUSE_DOWN,f=>{ts(f.target,d.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)u.add(xe(g,Je.CLICK,()=>this.hideHover()));else u.add(xe(e.target,Je.CLICK,()=>this.hideHover()));const f=ps();if(f){const g=Bt(f).document;u.add(xe(f,Je.KEY_DOWN,p=>{var m;return this._keyDown(p,d,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),u.add(xe(g,Je.KEY_DOWN,p=>{var m;return this._keyDown(p,d,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),u.add(xe(f,Je.KEY_UP,p=>this._keyUp(p,d))),u.add(xe(g,Je.KEY_UP,p=>this._keyUp(p,d)))}}if("IntersectionObserver"in hi){const f=new IntersectionObserver(p=>this._intersectionChange(p,d),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(g),u.add(Ot(()=>f.disconnect()))}return this._currentHover=d,d}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewService.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}_keyDown(e,t,n){var r,o;if(e.key==="Alt"){t.isLocked=!0;return}const s=new Oi(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||n&&(!(!((r=this._currentHoverOptions)===null||r===void 0)&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var n;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(n=this._lastFocusedElementBeforeOpen)===null||n===void 0||n.focus()))}};pU=Tvt([y1(0,Wt),y1(1,og),y1(2,$l),y1(3,ci),y1(4,xC),y1(5,pd)],pU);function Hce(i){var e;if(i!==void 0)return(e=i==null?void 0:i.id)!==null&&e!==void 0?e:i}class Nvt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t}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()}}Tn(SZ,pU,1);vu((i,e)=>{const t=i.getColor(Nye);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 NT=Sn("IWorkspaceEditService");class OZ{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Nv.is(t))return Nv.lift(t);if(uw.is(t))return uw.lift(t);throw new Error("Unsupported edit")})}}class Nv extends OZ{static is(e){return e instanceof Nv?!0:ba(e)&&Ft.isUri(e.resource)&&ba(e.textEdit)}static lift(e){return e instanceof Nv?e:new Nv(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=n}}class uw extends OZ{static is(e){return e instanceof uw?!0:ba(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof uw?e:new uw(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},r){super(r),this.oldResource=e,this.newResource=t,this.options=n}}const js={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},Y3=Object.freeze({id:"editor",order:5,type:"object",title:w("editorConfigurationTitle","Editor"),scope:5}),SO={...Y3,properties:{"editor.tabSize":{type:"number",default:Ts.tabSize,minimum:1,markdownDescription:w("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:w("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:Ts.insertSpaces,markdownDescription:w("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:Ts.detectIndentation,markdownDescription:w("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:Ts.trimAutoWhitespace,description:w("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ts.largeFileOptimizations,description:w("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[w("wordBasedSuggestions.off","Turn off Word Based Suggestions."),w("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),w("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),w("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:w("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:[w("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),w("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),w("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:w("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:w("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:w("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:w("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:w("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:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:js.maxComputationTime,description:w("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:js.maxFileSize,description:w("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:js.renderSideBySide,description:w("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:js.renderSideBySideInlineBreakpoint,description:w("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:js.useInlineViewWhenSpaceIsLimited,description:w("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:js.renderMarginRevertIcon,description:w("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:js.ignoreTrimWhitespace,description:w("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:js.renderIndicators,description:w("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:js.diffCodeLens,description:w("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:js.diffWordWrap,markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:js.diffAlgorithm,markdownEnumDescriptions:[w("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),w("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:js.hideUnchangedRegions.enabled,markdownDescription:w("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:js.hideUnchangedRegions.revealLineCount,markdownDescription:w("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:js.hideUnchangedRegions.minimumLineCount,markdownDescription:w("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:js.hideUnchangedRegions.contextLineCount,markdownDescription:w("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:js.experimental.showMoves,markdownDescription:w("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:js.experimental.showEmptyDecorations,description:w("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function Rvt(i){return typeof i.type<"u"||typeof i.anyOf<"u"}for(const i of uy){const e=i.schema;if(typeof e<"u")if(Rvt(e))SO.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(SO.properties[t]=e[t])}let b2=null;function aSe(){return b2===null&&(b2=Object.create(null),Object.keys(SO.properties).forEach(i=>{b2[i]=!0})),b2}function Mvt(i){return aSe()[`editor.${i}`]||!1}function Pvt(i){return aSe()[`diffEditor.${i}`]||!1}const Avt=ur.as(Rh.Configuration);Avt.registerConfiguration(SO);class Ji{static insert(e,t){return{range:new W(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 C2(i){return Object.isFrozen(i)?i:fnt(i)}class us{constructor(e={},t=[],n=[],r){this._contents=e,this._keys=t,this._overrides=n,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof us)return n;const r=new Ovt("");return r.parseRaw(n),r.configurationModel});this._rawConfiguration=t.reduce((n,r)=>r===n?r:n.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?mae(this.contents,e):this.contents}inspect(e,t){const n=this;return{get value(){return C2(n.rawConfiguration.getValue(e))},get override(){return t?C2(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return C2(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:o,identifiers:s,keys:a}of n.rawConfiguration.overrides){const l=new us(o,a).getValue(e);l!==void 0&&r.push({identifiers:s,value:l})}return r.length?C2(r):void 0}}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?mae(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const r=Fg(this.contents),o=Fg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>lr(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=Ap(u.keys)):o.push(Fg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new us(r,s,o,a.every(l=>l instanceof us)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const r of Ap([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=Fg(o),this.mergeContents(o,s)):o=s),n[r]=o}return new us(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ba(e[n])&&ba(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=Fg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const r=o=>{o&&(n?this.mergeContents(n,o):n=Fg(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Kst(this.contents,e),e_.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>lr(n.identifiers,KA(e))),1))}updateValue(e,t,n){nye(this.contents,e,t,r=>console.error(r)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),e_.test(e)&&this.overrides.push({identifiers:KA(e),keys:Object.keys(this.contents[e]),contents:dz(this.contents[e],r=>console.error(r))})}}class Ovt{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new us}parseRaw(e,t){this._raw=e;const{contents:n,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new us(n,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=ur.as(Rh.Configuration).getConfigurationProperties(),r=this.filter(e,n,!0,t);e=r.raw;const o=dz(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,n,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(e_.test(d)&&n){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const r of Object.keys(e))if(e_.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];n.push({identifiers:KA(r),keys:Object.keys(o),contents:dz(o,t)})}return n}}class Fvt{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}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 Z3{constructor(e,t,n,r,o=new us,s=new us,a=new Mr,l=new us,c=new Mr){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Mr,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=new us,this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const r=this.getConsolidatedConfigurationModel(e,t,n),o=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new Fvt(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,n?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);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 n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);const o=this._memoryConfigurationByResource.get(e);o&&(n=n.merge(o))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},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:n,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Ft.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Mr);return new Z3(t,n,r,o,new us,s,a,new us,new Mr)}static parseConfigurationModel(e){return new us(e.contents,e.keys,e.overrides)}}class Bvt{constructor(e,t,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Z3.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!pc(l,c)}return!0}}const xO={kind:0},Wvt={kind:1};function $vt(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class eD{constructor(e,t,n){var r;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=eD.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a"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 n=0,r=t.length;n"u"||n.length===0)return null;if(n.length===1)return n[0];for(let r=n.length-1;r>=0;r--){const o=n[r];if(t.contextMatchesRules(o.when))return o}return n[n.length-1]}resolve(e,t,n){const r=[...t,n];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),xO;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const r=t[n];if(eD._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Vce(i){return i?`${i.serialize()}`:"no when condition"}function zce(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const Hvt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Vvt extends me{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ot.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new ae),this._currentChords=[],this._currentChordChecker=new vY,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Ly.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new gd,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 n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),xO;const[r]=n.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),xO;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw eY("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(w("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(w("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),$E.enabled&&$E.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],$E.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[r]=n.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=Ly.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Ly.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(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=n.getChords();return this._ignoreSingleModifiers=new Ly(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),this._currentlyDispatchingCommandId=u.commandId;try{typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}Hvt.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Ly{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}}}Ly.EMPTY=new Ly(null);class Uce{constructor(e,t,n,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?mU(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=mU(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function mU(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return zvt.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Uvt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return jvt.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 Ert(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 WI extends Gvt{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 Vg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Vg.toString(e.keyCode)}_getElectronAccelerator(e){return Vg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Vg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return WI.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+=Vg.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=sY[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 Bp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Bp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=mU(e.chords.map(r=>this._toKeyCodeChord(r)));return n.length>0?[new WI(n,t)]:[]}}const lS=Sn("labelService"),lSe=Sn("progressService");class yp{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}yp.None=Object.freeze({report(){}});const A_=Sn("editorProgressService");class qvt{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=0;t--,this._valueLen--){const n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new dw(new Zvt(e,t))}static forStrings(){return new dw(new qvt)}static forConfigKeys(){return new dw(new Xvt)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let r;this._root||(this._root=new y2,this._root.segment=n.value());const o=[];for(r=this._root;;){const a=n.cmp(r.segment);if(a>0)r.left||(r.left=new y2,r.left.segment=n.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new y2,r.right.segment=n.value()),o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new y2,r.mid.segment=n.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,r;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),r=n.value||r,n=n.mid;else break}return n&&n.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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 Kb=Sn("contextService");function vU(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Ft.isUri(e.uri)}function Qvt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!vU(i)&&!n_t(i)}const Jvt={id:"ext-dev"},e_t={id:"empty-window"};function t_t(i,e){if(typeof i=="string"||typeof i>"u")return typeof i=="string"?{id:Lv(i)}:e?Jvt:e_t;const t=i;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 n_t(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Ft.isUri(e.configPath)}class i_t{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 _U="code-workspace";w("codeWorkspace","Code Workspace");const cSe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function r_t(i){return i.id===cSe}var bU;(function(i){i.inspectTokensAction=w("inspectTokens","Developer: Inspect Tokens")})(bU||(bU={}));var LO;(function(i){i.gotoLineActionLabel=w("gotoLineActionLabel","Go to Line/Column...")})(LO||(LO={}));var CU;(function(i){i.helpQuickAccessActionLabel=w("helpQuickAccess","Show all Quick Access Providers")})(CU||(CU={}));var EO;(function(i){i.quickCommandActionLabel=w("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=w("quickCommandActionHelp","Show And Run Commands")})(EO||(EO={}));var $I;(function(i){i.quickOutlineActionLabel=w("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=w("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})($I||($I={}));var DO;(function(i){i.editorViewAccessibleLabel=w("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=w("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(DO||(DO={}));var yU;(function(i){i.toggleHighContrast=w("toggleHighContrast","Toggle High Contrast Theme")})(yU||(yU={}));var wU;(function(i){i.bulkEditServiceSummary=w("bulkEditServiceSummary","Made {0} edits in {1} files")})(wU||(wU={}));const uSe=Sn("workspaceTrustManagementService");var Es;(function(i){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(o){return o.end-o.start<=0}i.isEmpty=t;function n(o,s){return!t(e(o,s))}i.intersects=n;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=r})(Es||(Es={}));function o_t(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var ov;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(ov||(ov={}));function Ey(i,e,t){const n=t.mode===ov.ALIGN?t.offset:t.offset+t.size,r=t.mode===ov.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=r?r-e:Math.max(i-e,0):e<=r?r-e:e<=i-n?n:0}class cS extends me{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=me.None,this.toDisposeOnSetContainer=me.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Xe(".context-view"),pa(this.view),this.setContainer(e,t),this._register(Ot(()=>this.setContainer(null,1)))}setContainer(e,t){var n;this.useFixedPosition=t!==1;const r=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&r===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=Xe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=s_t,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Xe("slot"))}else this.container.appendChild(this.view);const o=new Fe;cS.BUBBLE_UP_EVENTS.forEach(s=>{o.add(Lr(this.container,s,a=>{this.onDOMEvent(a,!1)}))}),cS.BUBBLE_DOWN_EVENTS.forEach(s=>{o.add(Lr(this.container,s,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ps(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Sl(this.view),this.toDisposeOnClean=e.render(this.view)||me.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(fh&&pY.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const h=Hr(e),f=T1e(e);t={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else o_t(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 n=ha(this.view),r=ep(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const u=xot();if(a===0){const h={offset:t.top-u.pageYOffset,size:t.height,position:o===0?0:1},f={offset:t.left,size:t.width,position:s===0?0:1,mode:ov.ALIGN};l=Ey(u.innerHeight,r,h)+u.pageYOffset,Es.intersects({start:l,end:l+r},{start:h.offset,end:h.offset+h.size})&&(f.mode=ov.AVOID),c=Ey(u.innerWidth,n,f)}else{const h={offset:t.left,size:t.width,position:s===0?0:1},f={offset:t.top,size:t.height,position:o===0?0:1,mode:ov.ALIGN};c=Ey(u.innerWidth,n,h),Es.intersects({start:c,end:c+n},{start:h.offset,end:h.offset+h.size})&&(f.mode=ov.AVOID),l=Ey(u.innerHeight,r,f)+u.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Hr(this.container);this.view.style.top=`${l-(this.useFixedPosition?Hr(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Hr(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(),pa(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Bt(e).document.activeElement):t&&!ts(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}cS.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];cS.BUBBLE_DOWN_EVENTS=["click"];const s_t=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -717,7 +717,7 @@ ${e}`)}function _vt(i){return M_(i,"`")}function bvt(i){return M_(i,"*")}functio :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 a_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let SU=class extends me{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=me.None,this.contextView=this._register(new cS(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,n){let r;t?t===this.layoutService.getContainer(Bt(t))?r=1:n?r=3:r=2:r=1,this.contextView.setContainer(t??this.layoutService.activeContainer,r),this.contextView.show(e);const o=Ot(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=me.None}};SU=a_t([l_t(0,xC)],SU);let uS=[],BZ=[],dSe=[];function w2(i,e=!1){c_t(i,!1,e)}function c_t(i,e,t){const n=u_t(i,e);uS.push(n),n.userConfigured?dSe.push(n):BZ.push(n),t&&!n.userConfigured&&uS.forEach(r=>{r.mime===n.mime||r.userConfigured||(n.extension&&r.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&r.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&r.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&r.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function u_t(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?jwe(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(lo.sep)>=0:!1}}function d_t(){uS=uS.filter(i=>i.userConfigured),BZ=[]}function h_t(i,e){return f_t(i,e).map(t=>t.id)}function f_t(i,e){let t;if(i)switch(i.scheme){case cn.file:t=i.fsPath;break;case cn.data:{t=i_.parseMetaData(i).get(i_.META_DATA_LABEL);break}case cn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:wr.unknown}];t=t.toLowerCase();const n=Lv(t),r=jce(t,n,dSe);if(r)return[r,{id:mc,mime:wr.text}];const o=jce(t,n,BZ);if(o)return[o,{id:mc,mime:wr.text}];if(e){const s=g_t(e);if(s)return[s,{id:mc,mime:wr.text}]}return[{id:"unknown",mime:wr.unknown}]}function jce(i,e,t){var n;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function g_t(i){if(gY(i)&&(i=i.substr(1)),i.length>0)for(let e=uS.length-1;e>=0;e--){const t=uS[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const S2=Object.prototype.hasOwnProperty,Kce="vs.editor.nullLanguage";class p_t{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Kce,0),this._register(mc,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]||Kce}}class HI extends me{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,HI.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new p_t,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(qw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){HI.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},d_t();const e=[].concat(qw.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 n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=n.identifier}),n.mimetypes.forEach(r=>{this._mimeTypesMap[r]=n.identifier})}),ur.as(Rh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;S2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${n}`,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)w2({id:n,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)w2({id:n,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)w2({id:n,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);hrt(l)||w2({id:n,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?S2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return S2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&S2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:h_t(e,t)}}HI.instanceCount=0;class VI extends me{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new ae),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new ae),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new ae({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,VI.instanceCount++,this._registry=this._register(new HI(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){VI.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return GX(n,null)}createById(e){return new Gce(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Gce(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=mc),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),gr.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}VI.instanceCount=0;class Gce{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new ae({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const zI={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:wr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},m_t=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let J3=m_t;const v_t=new tg(()=>J3("mouse",!1)),__t=new tg(()=>J3("element",!1));function b_t(i){J3=i}function qp(i,e){return e?J3(i,!0):i==="element"?__t.value:v_t.value}function C_t(i,e){Ea(e)?i.title=RZ(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class y_t{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}async update(e,t,n){var r;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ea(e)||e instanceof HTMLElement)o=e;else if(!tI(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(w("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new xr;const s=this._cancellationTokenSource.token;if(o=await e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,n)}show(e,t,n){const r=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!r},position:{hoverPosition:2},...n};this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Bf(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function LC(i,e,t,n){let r,o;const s=(v,_)=>{var y;const S=o!==void 0;v&&(o==null||o.dispose(),o=void 0),_&&(r==null||r.dispose(),r=void 0),S&&((y=i.onDidHideHover)===null||y===void 0||y.call(i),o=void 0)},a=(v,_,y)=>new gd(async()=>{(!o||o.isDisposed)&&(o=new y_t(i,y||e,v>0),await o.update(typeof t=="function"?t():t,_,n))},v);let l=!1;const c=xe(e,Je.MOUSE_DOWN,()=>{l=!0,s(!0,!0)},!0),u=xe(e,Je.MOUSE_UP,()=>{l=!1},!0),d=xe(e,Je.MOUSE_LEAVE,v=>{l=!1,s(!1,v.fromElement===e)},!0),h=()=>{if(r)return;const v=new Fe,_={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const y=S=>{_.x=S.x+10,S.target instanceof HTMLElement&&S.target.classList.contains("action-label")&&s(!0,!0)};v.add(xe(e,Je.MOUSE_MOVE,y,!0))}v.add(a(i.delay,!1,_)),r=v},f=xe(e,Je.MOUSE_OVER,h,!0),g=()=>{if(l||r)return;const v={targetElements:[e],dispose:()=>{}},_=new Fe,y=()=>s(!0,!0);_.add(xe(e,Je.BLUR,y,!0)),_.add(a(i.delay,!1,v)),r=_},p=xe(e,Je.FOCUS,g,!0);return{show:v=>{s(!1,!0),a(0,v)},hide:()=>{s(!0,!0)},update:async(v,_)=>{t=v,await(o==null?void 0:o.update(t,void 0,_))},dispose:()=>{f.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose(),s(!0,!0)}}}class w_t{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(r=>r.splice(e,t,n))}}class a0 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function qce(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class L_t{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,n=[]){const r=n.length-t,o=qce({start:0,end:e},this.groups),s=qce({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:xU(l.range,r),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=x_t(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.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 Xp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const l0={CurrentDragAndDropData:void 0},jh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class RT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class I_t{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class k_t{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;tr,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class bu{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:S9(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,n,r=jh){var o,s,a,l,c,u,d,h,f,g,p,m,v;if(this.virtualDelegate=t,this.domId=`list_id_${++bu.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ad(50),this.splicing=!1,this.dragOverAnimationStopDisposable=me.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=me.None,this.onDragLeaveTimeout=me.None,this.disposables=new Fe,this._onDidChangeContentHeight=new ae,this._onDidChangeContentWidth=new ae,this.onDidChangeContentHeight=ot.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((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new D_t(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:jh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new N_t(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:jh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Li.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new XS({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Ml(Bt(this.domNode),y)})),this.scrollableElement=this.disposables.add(new A3(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:jh.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:jh.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:jh.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(xe(this.rowsContainer,Ei.Change,y=>this.onTouchChange(y))),this.disposables.add(xe(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(xe(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:jh.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:jh.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:jh.supportDynamicHeights,this.dnd=(p=r.dnd)!==null&&p!==void 0?p:this.disposables.add(jh.dnd),this.layout((m=r.initialSize)===null||m===void 0?void 0:m.height,(v=r.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...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 n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,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 L_t(e)}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=Es.intersect(r,o),a=new Map;for(let L=s.end-1;L>=s.start;L--){const E=this.items[L];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let D=a.get(E.templateId);D||(D=[],a.set(E.templateId,D));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,L,E.row.templateData,E.size),D.push(E.row)}E.row=null,E.stale=!0}const l={start:e+t,end:this.items.length},c=Es.intersect(l,r),u=Es.relativeComplement(l,r),d=n.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:me.None,checkedDisposable:me.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=xU(c,f),m=Es.intersect(g,p);for(let L=m.start;LxU(L,f)),S=[{start:e,end:e+n.length},..._].map(L=>Es.intersect(g,L)).reverse();for(const L of S)for(let E=L.end-1;E>=L.start;E--){const D=this.items[E],k=a.get(D.templateId),T=k==null?void 0:k.pop();this.insertItemInDOM(E,T)}for(const L of a.values())for(const E of L)this.cache.release(E);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(L=>L.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ml(Bt(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 n={height:typeof e=="number"?e:wot(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:S9(this.domNode)})}render(e,t,n,r,o,s=!1){const a=this.getRenderRange(t,n),l=Es.relativeComplement(a,e).reverse(),c=Es.relativeComplement(e,a);if(s){const u=Es.intersect(e,a);for(let d=u.start;d{for(const u of c)for(let d=u.start;d=u.start;d--)this.insertItemInDOM(d)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){var n,r,o;const s=this.items[e];if(!s.row)if(t)s.row=t,s.stale=!0;else{const d=this.cache.alloc(s.templateId);s.row=d.row,s.stale||(s.stale=d.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(s.element);if(typeof l=="boolean")s.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const d=h=>s.row.domNode.setAttribute("aria-checked",String(!!h));d(l.value),s.checkedDisposable=l.onDidChange(d)}if(s.stale||!s.row.domNode.parentElement){const d=(o=(r=(n=this.items.at(e+1))===null||n===void 0?void 0:n.row)===null||r===void 0?void 0:r.domNode)!==null&&o!==void 0?o:null;this.rowsContainer.insertBefore(s.row.domNode,d),s.stale=!1}this.updateItemInDOM(s,e);const c=this.renderers.get(s.templateId);if(!c)throw new Error(`No renderer found for template id ${s.templateId}`);c==null||c.renderElement(s.element,e,s.row.templateData,s.size);const u=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!u,u&&(s.dragStartDisposable=xe(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,u,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=S9(e.row.domNode);const t=Bt(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 n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ot.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ot.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ot.filter(ot.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ot.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ot.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ot.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ot.any(ot.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ot.map(this.disposables.add(new xn(this.domNode,Ei.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ot.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ot.map(this.disposables.add(new xn(this.rowsContainer,Ei.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:r,sector:o}}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,n){var r,o;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(zI.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a>"u"&&(a=String(s.length));const l=Xe(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||this.domNode.ownerDocument})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new RT(s),l0.CurrentDragAndDropData=new I_t(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,n)}onDragOver(e){var t,n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),l0.CurrentDragAndDropData&&l0.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(l0.CurrentDragAndDropData)this.currentDragData=l0.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new k_t}const r=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof r=="boolean"?r:r.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof r!="boolean"&&((t=r.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof r!="boolean"&&r.feedback?o=r.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Ap(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let s=typeof r!="boolean"&&r.effect&&r.effect.position?r.effect.position:"drop-target";if(T_t(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Ot(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(o.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&o[0]{var a;for(const l of o){const c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Zv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,l0.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,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,l0.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=me.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=k1e(this.domNode).top;this.dragOverAnimationDisposable=Aot(Bt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Zv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const n=e.offsetY/this.items[t].size,r=Math.floor(n/.25);return fa(r,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const r=n.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=h.start;f--)this.insertItemInDOM(f);for(let h=l.start;h=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class R_t{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const r=this.renderedElements.findIndex(o=>o.templateData===n);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(n),o.index=t}else{const o={index:t,templateData:n};this.renderedElements.push(o)}this.trait.renderIndex(t,n)}splice(e,t,n){const r=[];for(const o of this.renderedElements)o.index=e+t&&r.push({index:o.index+n-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}let IO=class{get name(){return this._trait}get renderer(){return new R_t(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new ae,this.onChange=this._onChange.event}splice(e,t,n){const r=n.length-t,o=e+t,s=[];let a=0;for(;a=o;)s.push(this.sortedIndexes[a++]+r);this.renderer.splice(e,t,n.length),this._set(s,s)}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(Yce),t)}_set(e,t,n){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=LU(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),r}get(){return this.indexes}contains(e){return JD(this.sortedIndexes,e,Yce)>=0}dispose(){si(this._onChange)}};A_([Ar],IO.prototype,"renderer",null);class M_t extends IO{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 w7{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.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(n.length).fill(!1));const o=new Set(r),s=n.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Rv(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function MT(i,e){return i.classList.contains(e)?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:MT(i.parentElement,e)}function iE(i){return MT(i,"monaco-editor")}function P_t(i){return MT(i,"monaco-custom-toggle")}function A_t(i){return MT(i,"action-item")}function tD(i){return MT(i,"monaco-tree-sticky-row")}function kO(i){return i.classList.contains("monaco-tree-sticky-container")}function hSe(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:hSe(i.parentElement)}class fSe{get onKeyDown(){return ot.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Rv(t.target)).map(t=>new Oi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Fe,this.multipleSelectionDisposables=new Fe,this.multipleSelectionSupport=n.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&&(Dn?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(ua(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()}}A_([Ar],fSe.prototype,"onKeyDown",null);var _f;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(_f||(_f={}));var Dy;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(Dy||(Dy={}));const O_t=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class F_t{constructor(e,t,n,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=Dy.Idle,this.mode=_f.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Fe,this.disposables=new Fe,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:_f.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ot.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,o=>o.filter(s=>!Rv(s.target)).filter(()=>this.mode===_f.Automatic||this.triggered).map(s=>new Oi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>gn.stop(s,!0)).map(s=>s.browserEvent.key)),n=ot.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ot.reduce(ot.any(t,n),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&Pl(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Dy.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,r=this.state===Dy.Idle?1:0;this.state=Dy.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||BI(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class B_t{constructor(e,t){this.list=e,this.view=t,this.disposables=new Fe;const n=ot.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,o=>o.filter(s=>!Rv(s.target)).map(s=>new Oi(s)));ot.chain(n,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const n=this.view.domElement(t[0]);if(!n)return;const r=n.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=Bt(r).getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function gSe(i){return Dn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function pSe(i){return i.browserEvent.shiftKey}function W_t(i){return wY(i)&&i.button===2}const Xce={isSelectionSingleChangeEvent:gSe,isSelectionRangeChangeEvent:pSe};class mSe{constructor(e){this.list=e,this.disposables=new Fe,this._onPointer=new ae,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Xce),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(Li.addTarget(e.getHTMLElement()))),ot.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||Xce))}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){iE(e.browserEvent.target)||ps()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Rv(e.browserEvent.target)||iE(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Rv(e.browserEvent.target)||iE(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),W_t(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Rv(e.browserEvent.target)||iE(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n>"u"){const u=this.list.getFocus()[0];n=u??t,this.list.setAnchor(n)}const r=Math.min(n,t),o=Math.max(n,t),s=ua(r,o+1),a=this.list.getSelection(),l=V_t(LU(a,[n]),n);if(l.length===0)return;const c=LU(s,z_t(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class vSe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` +`;var a_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let SU=class extends me{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=me.None,this.contextView=this._register(new cS(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,n){let r;t?t===this.layoutService.getContainer(Bt(t))?r=1:n?r=3:r=2:r=1,this.contextView.setContainer(t??this.layoutService.activeContainer,r),this.contextView.show(e);const o=Ot(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=me.None}};SU=a_t([l_t(0,xC)],SU);let uS=[],BZ=[],dSe=[];function w2(i,e=!1){c_t(i,!1,e)}function c_t(i,e,t){const n=u_t(i,e);uS.push(n),n.userConfigured?dSe.push(n):BZ.push(n),t&&!n.userConfigured&&uS.forEach(r=>{r.mime===n.mime||r.userConfigured||(n.extension&&r.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&r.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&r.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&r.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function u_t(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?jwe(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(lo.sep)>=0:!1}}function d_t(){uS=uS.filter(i=>i.userConfigured),BZ=[]}function h_t(i,e){return f_t(i,e).map(t=>t.id)}function f_t(i,e){let t;if(i)switch(i.scheme){case cn.file:t=i.fsPath;break;case cn.data:{t=r_.parseMetaData(i).get(r_.META_DATA_LABEL);break}case cn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:wr.unknown}];t=t.toLowerCase();const n=Lv(t),r=jce(t,n,dSe);if(r)return[r,{id:mc,mime:wr.text}];const o=jce(t,n,BZ);if(o)return[o,{id:mc,mime:wr.text}];if(e){const s=g_t(e);if(s)return[s,{id:mc,mime:wr.text}]}return[{id:"unknown",mime:wr.unknown}]}function jce(i,e,t){var n;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function g_t(i){if(gY(i)&&(i=i.substr(1)),i.length>0)for(let e=uS.length-1;e>=0;e--){const t=uS[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const S2=Object.prototype.hasOwnProperty,Kce="vs.editor.nullLanguage";class p_t{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Kce,0),this._register(mc,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]||Kce}}class HI extends me{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,HI.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new p_t,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(qw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){HI.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},d_t();const e=[].concat(qw.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 n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=n.identifier}),n.mimetypes.forEach(r=>{this._mimeTypesMap[r]=n.identifier})}),ur.as(Rh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;S2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${n}`,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)w2({id:n,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)w2({id:n,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)w2({id:n,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);hrt(l)||w2({id:n,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?S2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return S2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&S2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:h_t(e,t)}}HI.instanceCount=0;class VI extends me{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new ae),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new ae),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new ae({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,VI.instanceCount++,this._registry=this._register(new HI(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){VI.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return GX(n,null)}createById(e){return new Gce(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Gce(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=mc),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),gr.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}VI.instanceCount=0;class Gce{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new ae({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const zI={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:wr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},m_t=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let J3=m_t;const v_t=new tg(()=>J3("mouse",!1)),__t=new tg(()=>J3("element",!1));function b_t(i){J3=i}function qp(i,e){return e?J3(i,!0):i==="element"?__t.value:v_t.value}function C_t(i,e){Ea(e)?i.title=RZ(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class y_t{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}async update(e,t,n){var r;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ea(e)||e instanceof HTMLElement)o=e;else if(!tI(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(w("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new xr;const s=this._cancellationTokenSource.token;if(o=await e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,n)}show(e,t,n){const r=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!r},position:{hoverPosition:2},...n};this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Bf(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function LC(i,e,t,n){let r,o;const s=(v,_)=>{var y;const S=o!==void 0;v&&(o==null||o.dispose(),o=void 0),_&&(r==null||r.dispose(),r=void 0),S&&((y=i.onDidHideHover)===null||y===void 0||y.call(i),o=void 0)},a=(v,_,y)=>new gd(async()=>{(!o||o.isDisposed)&&(o=new y_t(i,y||e,v>0),await o.update(typeof t=="function"?t():t,_,n))},v);let l=!1;const c=xe(e,Je.MOUSE_DOWN,()=>{l=!0,s(!0,!0)},!0),u=xe(e,Je.MOUSE_UP,()=>{l=!1},!0),d=xe(e,Je.MOUSE_LEAVE,v=>{l=!1,s(!1,v.fromElement===e)},!0),h=()=>{if(r)return;const v=new Fe,_={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const y=S=>{_.x=S.x+10,S.target instanceof HTMLElement&&S.target.classList.contains("action-label")&&s(!0,!0)};v.add(xe(e,Je.MOUSE_MOVE,y,!0))}v.add(a(i.delay,!1,_)),r=v},f=xe(e,Je.MOUSE_OVER,h,!0),g=()=>{if(l||r)return;const v={targetElements:[e],dispose:()=>{}},_=new Fe,y=()=>s(!0,!0);_.add(xe(e,Je.BLUR,y,!0)),_.add(a(i.delay,!1,v)),r=_},p=xe(e,Je.FOCUS,g,!0);return{show:v=>{s(!1,!0),a(0,v)},hide:()=>{s(!0,!0)},update:async(v,_)=>{t=v,await(o==null?void 0:o.update(t,void 0,_))},dispose:()=>{f.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose(),s(!0,!0)}}}class w_t{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(r=>r.splice(e,t,n))}}class l0 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function qce(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class L_t{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,n=[]){const r=n.length-t,o=qce({start:0,end:e},this.groups),s=qce({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:xU(l.range,r),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=x_t(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.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 Xp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const c0={CurrentDragAndDropData:void 0},jh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class RT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class I_t{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class k_t{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;tr,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class bu{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:S9(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,n,r=jh){var o,s,a,l,c,u,d,h,f,g,p,m,v;if(this.virtualDelegate=t,this.domId=`list_id_${++bu.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ad(50),this.splicing=!1,this.dragOverAnimationStopDisposable=me.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=me.None,this.onDragLeaveTimeout=me.None,this.disposables=new Fe,this._onDidChangeContentHeight=new ae,this._onDidChangeContentWidth=new ae,this.onDidChangeContentHeight=ot.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((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new D_t(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:jh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new N_t(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:jh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Li.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new XS({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Ml(Bt(this.domNode),y)})),this.scrollableElement=this.disposables.add(new A3(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:jh.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:jh.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:jh.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(xe(this.rowsContainer,Ei.Change,y=>this.onTouchChange(y))),this.disposables.add(xe(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(xe(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(xe(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:jh.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:jh.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:jh.supportDynamicHeights,this.dnd=(p=r.dnd)!==null&&p!==void 0?p:this.disposables.add(jh.dnd),this.layout((m=r.initialSize)===null||m===void 0?void 0:m.height,(v=r.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...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 n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,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 L_t(e)}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=Es.intersect(r,o),a=new Map;for(let L=s.end-1;L>=s.start;L--){const E=this.items[L];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let D=a.get(E.templateId);D||(D=[],a.set(E.templateId,D));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,L,E.row.templateData,E.size),D.push(E.row)}E.row=null,E.stale=!0}const l={start:e+t,end:this.items.length},c=Es.intersect(l,r),u=Es.relativeComplement(l,r),d=n.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:me.None,checkedDisposable:me.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=xU(c,f),m=Es.intersect(g,p);for(let L=m.start;LxU(L,f)),S=[{start:e,end:e+n.length},..._].map(L=>Es.intersect(g,L)).reverse();for(const L of S)for(let E=L.end-1;E>=L.start;E--){const D=this.items[E],k=a.get(D.templateId),T=k==null?void 0:k.pop();this.insertItemInDOM(E,T)}for(const L of a.values())for(const E of L)this.cache.release(E);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(L=>L.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ml(Bt(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 n={height:typeof e=="number"?e:wot(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:S9(this.domNode)})}render(e,t,n,r,o,s=!1){const a=this.getRenderRange(t,n),l=Es.relativeComplement(a,e).reverse(),c=Es.relativeComplement(e,a);if(s){const u=Es.intersect(e,a);for(let d=u.start;d{for(const u of c)for(let d=u.start;d=u.start;d--)this.insertItemInDOM(d)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){var n,r,o;const s=this.items[e];if(!s.row)if(t)s.row=t,s.stale=!0;else{const d=this.cache.alloc(s.templateId);s.row=d.row,s.stale||(s.stale=d.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(s.element);if(typeof l=="boolean")s.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const d=h=>s.row.domNode.setAttribute("aria-checked",String(!!h));d(l.value),s.checkedDisposable=l.onDidChange(d)}if(s.stale||!s.row.domNode.parentElement){const d=(o=(r=(n=this.items.at(e+1))===null||n===void 0?void 0:n.row)===null||r===void 0?void 0:r.domNode)!==null&&o!==void 0?o:null;this.rowsContainer.insertBefore(s.row.domNode,d),s.stale=!1}this.updateItemInDOM(s,e);const c=this.renderers.get(s.templateId);if(!c)throw new Error(`No renderer found for template id ${s.templateId}`);c==null||c.renderElement(s.element,e,s.row.templateData,s.size);const u=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!u,u&&(s.dragStartDisposable=xe(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,u,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=S9(e.row.domNode);const t=Bt(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 n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ot.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ot.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ot.filter(ot.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ot.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ot.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ot.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ot.any(ot.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ot.map(this.disposables.add(new xn(this.domNode,Ei.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ot.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ot.map(this.disposables.add(new xn(this.rowsContainer,Ei.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:r,sector:o}}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,n){var r,o;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(zI.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a>"u"&&(a=String(s.length));const l=Xe(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||this.domNode.ownerDocument})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new RT(s),c0.CurrentDragAndDropData=new I_t(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,n)}onDragOver(e){var t,n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),c0.CurrentDragAndDropData&&c0.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(c0.CurrentDragAndDropData)this.currentDragData=c0.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new k_t}const r=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof r=="boolean"?r:r.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof r!="boolean"&&((t=r.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof r!="boolean"&&r.feedback?o=r.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Ap(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let s=typeof r!="boolean"&&r.effect&&r.effect.position?r.effect.position:"drop-target";if(T_t(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Ot(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(o.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&o[0]{var a;for(const l of o){const c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Qv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,c0.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,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,c0.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=me.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=k1e(this.domNode).top;this.dragOverAnimationDisposable=Aot(Bt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Qv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const n=e.offsetY/this.items[t].size,r=Math.floor(n/.25);return fa(r,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const r=n.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=h.start;f--)this.insertItemInDOM(f);for(let h=l.start;h=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class R_t{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const r=this.renderedElements.findIndex(o=>o.templateData===n);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(n),o.index=t}else{const o={index:t,templateData:n};this.renderedElements.push(o)}this.trait.renderIndex(t,n)}splice(e,t,n){const r=[];for(const o of this.renderedElements)o.index=e+t&&r.push({index:o.index+n-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}let IO=class{get name(){return this._trait}get renderer(){return new R_t(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new ae,this.onChange=this._onChange.event}splice(e,t,n){const r=n.length-t,o=e+t,s=[];let a=0;for(;a=o;)s.push(this.sortedIndexes[a++]+r);this.renderer.splice(e,t,n.length),this._set(s,s)}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(Yce),t)}_set(e,t,n){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=LU(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),r}get(){return this.indexes}contains(e){return JD(this.sortedIndexes,e,Yce)>=0}dispose(){si(this._onChange)}};O_([Ar],IO.prototype,"renderer",null);class M_t extends IO{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 w7{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.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(n.length).fill(!1));const o=new Set(r),s=n.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Rv(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function MT(i,e){return i.classList.contains(e)?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:MT(i.parentElement,e)}function iE(i){return MT(i,"monaco-editor")}function P_t(i){return MT(i,"monaco-custom-toggle")}function A_t(i){return MT(i,"action-item")}function tD(i){return MT(i,"monaco-tree-sticky-row")}function kO(i){return i.classList.contains("monaco-tree-sticky-container")}function hSe(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:hSe(i.parentElement)}class fSe{get onKeyDown(){return ot.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Rv(t.target)).map(t=>new Oi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Fe,this.multipleSelectionDisposables=new Fe,this.multipleSelectionSupport=n.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&&(Dn?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(ua(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()}}O_([Ar],fSe.prototype,"onKeyDown",null);var _f;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(_f||(_f={}));var Dy;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(Dy||(Dy={}));const O_t=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class F_t{constructor(e,t,n,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=Dy.Idle,this.mode=_f.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Fe,this.disposables=new Fe,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:_f.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ot.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,o=>o.filter(s=>!Rv(s.target)).filter(()=>this.mode===_f.Automatic||this.triggered).map(s=>new Oi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>gn.stop(s,!0)).map(s=>s.browserEvent.key)),n=ot.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ot.reduce(ot.any(t,n),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&Pl(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Dy.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,r=this.state===Dy.Idle?1:0;this.state=Dy.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||BI(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class B_t{constructor(e,t){this.list=e,this.view=t,this.disposables=new Fe;const n=ot.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,o=>o.filter(s=>!Rv(s.target)).map(s=>new Oi(s)));ot.chain(n,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const n=this.view.domElement(t[0]);if(!n)return;const r=n.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=Bt(r).getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function gSe(i){return Dn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function pSe(i){return i.browserEvent.shiftKey}function W_t(i){return wY(i)&&i.button===2}const Xce={isSelectionSingleChangeEvent:gSe,isSelectionRangeChangeEvent:pSe};class mSe{constructor(e){this.list=e,this.disposables=new Fe,this._onPointer=new ae,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Xce),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(Li.addTarget(e.getHTMLElement()))),ot.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||Xce))}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){iE(e.browserEvent.target)||ps()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Rv(e.browserEvent.target)||iE(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Rv(e.browserEvent.target)||iE(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),W_t(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Rv(e.browserEvent.target)||iE(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n>"u"){const u=this.list.getFocus()[0];n=u??t,this.list.setAnchor(n)}const r=Math.min(n,t),o=Math.max(n,t),s=ua(r,o+1),a=this.list.getSelection(),l=V_t(LU(a,[n]),n);if(l.length===0)return;const c=LU(s,z_t(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class vSe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${r}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` @@ -760,9 +760,9 @@ ${e}`)}function _vt(i){return M_(i,"`")}function bvt(i){return M_(i,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` -`)}}const $_t={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:Ce.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Ce.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Ce.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},H_t={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function V_t(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let r=t-1;for(;r>=0&&i[r]===e-(t-r);)n.push(i[r--]);for(n.reverse(),r=t;r=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){t.push(i[n]),n++,r++;continue}else i[n]=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){n++,r++;continue}else i[n]i-e;class U_t{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,n,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,n[o++],r)}disposeElement(e,t,n,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,n[s],r),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class j_t{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const r=this.accessibilityProvider.getAriaLabel(e);r?n.setAttribute("aria-label",r):n.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?n.setAttribute("aria-level",`${o}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class K_t{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 n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,e,t)}onDragOver(e,t,n,r,o){return this.dnd.onDragOver(e,t,n,r,o)}onDragLeave(e,t,n,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,n,r)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,r,o){this.dnd.drop(e,t,n,r,o)}dispose(){this.dnd.dispose()}}class Ec{get onDidChangeFocus(){return ot.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ot.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=ot.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,o=>o.map(s=>new Oi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>gn.stop(s,!0)).filter(()=>!1)),n=ot.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new Oi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>gn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=ot.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Gu(Bt(this.view.domNode),l),browserEvent:l})));return ot.any(t,n,r)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return ot.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return ot.signal(this.disposables.add(new xn(this.view.domNode,"blur",!0)).event)}constructor(e,t,n,r,o=H_t){var s,a,l,c;this.user=e,this._options=o,this.focus=new IO("focused"),this.anchor=new IO("anchor"),this.eventBufferer=new rY,this._ariaLabel="",this.disposables=new Fe,this._onDidDispose=new ae,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new M_t(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new j_t(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new U_t(f.templateId,[...d,f]));const h={...o,dnd:o.dnd&&new K_t(this,o.dnd)};if(this.view=this.createListView(t,n,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=_c(this.view.domNode);this.styleController=new vSe(f,this.view.domId)}if(this.spliceable=new w_t([new w7(this.focus,this.view,o.identityProvider),new w7(this.selection,this.view,o.identityProvider),new w7(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new B_t(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new fSe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||O_t;this.typeNavigationController=new F_t(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,n,r){return new bu(e,t,n,r)}createMouseController(e){return new mSe(this)}updateOptions(e={}){var t,n;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new a0(this.user,`Invalid start index: ${e}`);if(t<0)throw new a0(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}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 n of e)if(n<0||n>=this.length)throw new a0(this.user,`Invalid index ${n}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new a0(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return GX(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new a0(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],n)}async focusNextPage(e,t){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const r=this.getFocus()[0];if(r!==n&&(r===void 0||n>r)){const o=this.findPreviousIndex(n,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([n],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;n>r&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await Yv(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,n=()=>0){let r;const o=n(),s=this.view.getScrollTop()+o;s===0?r=this.view.indexAt(s):r=this.view.indexAfter(s-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=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+n()!==l&&(this.setFocus([]),await Yv(0),await this.focusPreviousPage(e,t,n))}}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const r=this.findNextIndex(e,!1,n);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,n){for(let r=0;r=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let r=0;rthis.view.element(e))}reveal(e,t,n=0){if(e<0||e>=this.length)throw new a0(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(Kv(t)){const a=s-this.view.renderHeight+n;this.view.setScrollTop(a*fa(t,0,1)+o-n)}else{const a=o+s,l=r+this.view.renderHeight;o=l||(o=l&&s>=this.view.renderHeight?this.view.setScrollTop(o-n):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new a0(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(rn+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((n+t-r)/s)}isDOMFocused(){return pT(this.view.domNode)}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(n=>this.view.element(n)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",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()}}A_([Ar],Ec.prototype,"onDidChangeFocus",null);A_([Ar],Ec.prototype,"onDidChangeSelection",null);A_([Ar],Ec.prototype,"onContextMenu",null);A_([Ar],Ec.prototype,"onKeyDown",null);A_([Ar],Ec.prototype,"onDidFocus",null);A_([Ar],Ec.prototype,"onDidBlur",null);const Q0=Xe,_Se="selectOption.entry.template";class G_t{get templateId(){return _Se}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Oe(e,Q0(".option-text")),t.detail=Oe(e,Q0(".option-detail")),t.decoratorRight=Oe(e,Q0(".option-decorator-right")),t}renderElement(e,t,n){const r=n,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class bf extends me{constructor(e,t,n,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=bf.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._hover=this._register(LC(qp("mouse"),this.selectElement,"")),this._onDidSelect=new ae,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return _Se}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Xe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Oe(this.selectDropDownContainer,Q0(".select-box-details-pane"));const t=Oe(this.selectDropDownContainer,Q0(".select-box-dropdown-container-width-control")),n=Oe(t,Q0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Oe(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=_c(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(xe(this.selectDropDownContainer,Je.DRAG_START,r=>{gn.stop(r,!0)}))}registerListeners(){this._register(Lr(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._hover.update(this.options[this.selected].text)})),this._register(xe(this.selectElement,Je.CLICK,t=>{gn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(xe(this.selectElement,Je.MOUSE_DOWN,t=>{gn.stop(t)}));let e;this._register(xe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(xe(this.selectElement,"touchend",t=>{gn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(xe(this.selectElement,Je.KEY_DOWN,t=>{const n=new Oi(t);let r=!1;Dn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(r=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),gn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){lr(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.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._hover.update(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){var e,t,n;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=bp(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!n,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),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=Bt(this.selectElement),n=Hr(this.selectElement),r=Bt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-bf.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 h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=d+o+h,g=Math.floor((s-o-h)/this.getHeight()),p=Math.floor((a-o-h)/this.getHeight());if(e)return n.top+n.height>t.innerHeight-22||n.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(n.top+n.height>t.innerHeight-22||n.tops&&(d=g*this.getHeight())}else f>a&&(d=p*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+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"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 n=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(n=s,r=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=ha(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Oe(e,Q0(".select-box-dropdown-list-container")),this.listRenderer=new G_t,this.selectList=new Ec("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>w({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Dn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=ot.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new Oi(o)));this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(xe(this.selectList.getHTMLElement(),Je.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(xe(this.selectDropDownContainer,Je.FOCUS_OUT,r=>{!this._isVisible||ts(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;gn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const r=Number(n.getAttribute("data-index")),o=n.classList.contains("option-disabled");r>=0&&r{for(let s=0;sthis.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&&(gn.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){gn.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{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){gn.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){gn.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=Vg.toString(e.keyCode);let n=-1;for(let r=0;r{this._register(xe(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Lr(this.selectElement,"click",e=>{gn.stop(e,!0)})),this._register(Lr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Lr(this.selectElement,"keydown",e=>{let t=!1;Dn?(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||!lr(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{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 Hb)),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(Li.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,lu&&this._register(xe(e,Je.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(zI.TEXT,this._action.label)}))),this._register(xe(t,Ei.Tap,r=>this.onClick(r,!0))),this._register(xe(t,Je.MOUSE_DOWN,r=>{n||gn.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),Dn&&this._register(xe(t,Je.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(xe(t,Je.CLICK,r=>{gn.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(xe(t,Je.DBLCLICK,r=>{gn.stop(r,!0)})),[Je.MOUSE_UP,Je.MOUSE_OUT].forEach(r=>{this._register(xe(t,r,o=>{gn.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var n;gn.stop(e,!0);const r=sc(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,n;if(!this.element)return;const r=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=r;else if(this.customHover)this.customHover.update(r);else{const o=(n=this.options.hoverDelegate)!==null&&n!==void 0?n:qp("element");this.customHover=LC(o,this.element,r),this._store.add(this.customHover)}}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class dS extends zd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),Yn(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 n=document.createElement("span");n.classList.add("keybinding"),n.textContent=this.options.keybinding,this.element.appendChild(n)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===ho.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=w({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===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Y_t extends zd{constructor(e,t,n,r,o,s,a){super(e,t),this.selectBox=new X_t(n,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Z_t extends Hb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new ae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Oe(e,Xe(".monaco-dropdown")),this._label=Oe(this._element,Xe(".dropdown-label"));let n=t.labelRenderer;n||(n=o=>(o.textContent=t.label||"",null));for(const o of[Je.CLICK,Je.MOUSE_DOWN,Ei.Tap])this._register(xe(this.element,o,s=>gn.stop(s,!0)));for(const o of[Je.MOUSE_DOWN,Ei.Tap])this._register(xe(this._label,o,s=>{wY(s)&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(xe(this._label,Je.KEY_UP,o=>{const s=new Oi(o);(s.equals(3)||s.equals(10))&&(gn.stop(o,!0),this.visible?this.hide():this.show())}));const r=n(this._label);r&&this._register(r),this._register(Li.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 Q_t extends Z_t{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 TO extends zd{constructor(e,t,n,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new ae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=Oe(o,Xe("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(LC(qp("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Q_t(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function J_t(i){return i?i.condition!==void 0:!1}var hw;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(hw||(hw={}));var Iy;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(Iy||(Iy={}));class fw extends me{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Ab),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Iy.None,this.cache=new Map,this.flushDelayer=this._register(new m1e(fw.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(n=e.deleted)===null||n===void 0||n.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Iy.Closed)return;let n=!1;sc(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return sc(n)?t:n}getBoolean(e,t){const n=this.get(e);return sc(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return sc(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===Iy.Closed)return;if(sc(t))return this.delete(e,n);const r=ba(t)||Array.isArray(t)?avt(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:n}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Iy.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===void 0||t()})}async doFlush(e){return this.options.hint===hw.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}fw.DEFAULT_FLUSH_DELAY=100;class S7{constructor(){this.onDidChangeItemsExternal=ot.None,this.items=new Map}async updateItems(e){var t,n;(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(n=e.delete)===null||n===void 0||n.forEach(r=>this.items.delete(r))}}const tP="__$__targetStorageMarker",md=Sn("storageService");var UI;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(UI||(UI={}));function e0t(i){const e=i.get(tP);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class e5 extends me{constructor(e={flushInterval:e5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Ab),this._onDidChangeTarget=this._register(new Ab),this._onWillSaveState=this._register(new ae),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return ot.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:r}=t;if(n===tP){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:n,target:this.getKeyTargets(e)[n],external:r})}get(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,n)}getBoolean(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,n)}getNumber(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,n)}store(e,t,n,r,o=!1){if(sc(t)){this.remove(e,n,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,r),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,o)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,r=!1){var o,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(o=this.getStorage(t))===null||o===void 0||o.set(tP,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(tP,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?e0t(t):Object.create(null)}}e5.DEFAULT_FLUSH_INTERVAL=60*1e3;class t0t extends e5{constructor(){super(),this.applicationStorage=this._register(new fw(new S7,{hint:hw.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fw(new S7,{hint:hw.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fw(new S7,{hint:hw.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 n0t(i,e){const t={...e};for(const n in i){const r=i[n];t[n]=r!==void 0?ft(r):void 0}return t}const i0t={keybindingLabelBackground:ft(Dct),keybindingLabelForeground:ft(Ict),keybindingLabelBorder:ft(kct),keybindingLabelBottomBorder:ft(Tct),keybindingLabelShadow:ft(np)},r0t={buttonForeground:ft(zL),buttonSeparator:ft(pct),buttonBackground:ft(UL),buttonHoverBackground:ft(mct),buttonSecondaryForeground:ft(_ct),buttonSecondaryBackground:ft(Lz),buttonSecondaryHoverBackground:ft(bct),buttonBorder:ft(vct)},o0t={progressBarBackground:ft(yct)},NO={inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY),inputActiveOptionBackground:ft(G0)};ft(sut),ft(lut),ft(aut);ft(Pr),ft(rp),ft(np),ft(Ln),ft(xut),ft(Lut),ft(Eut),ft(rct);const RO={inputBackground:ft(Eye),inputForeground:ft(Dye),inputBorder:ft(Iye),inputValidationInfoBorder:ft(act),inputValidationInfoBackground:ft(oct),inputValidationInfoForeground:ft(sct),inputValidationWarningBorder:ft(uct),inputValidationWarningBackground:ft(lct),inputValidationWarningForeground:ft(cct),inputValidationErrorBorder:ft(fct),inputValidationErrorBackground:ft(dct),inputValidationErrorForeground:ft(hct)},s0t={listFilterWidgetBackground:ft(Jct),listFilterWidgetOutline:ft(eut),listFilterWidgetNoMatchesOutline:ft(tut),listFilterWidgetShadow:ft(nut),inputBoxStyles:RO,toggleStyles:NO},bSe={badgeBackground:ft(jM),badgeForeground:ft(Cct),badgeBorder:ft(Ln)};ft(vut),ft(mut),ft(ole),ft(ole),ft(_ut);const O_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ft(Vct),listFocusForeground:ft(zct),listFocusOutline:ft(Uct),listActiveSelectionBackground:ft(cp),listActiveSelectionForeground:ft(Df),listActiveSelectionIconForeground:ft(XL),listFocusAndSelectionOutline:ft(jct),listFocusAndSelectionBackground:ft(cp),listFocusAndSelectionForeground:ft(Df),listInactiveSelectionBackground:ft(Kct),listInactiveSelectionIconForeground:ft(qct),listInactiveSelectionForeground:ft(Gct),listInactiveFocusBackground:ft(Xct),listInactiveFocusOutline:ft(Yct),listHoverBackground:ft(Rye),listHoverForeground:ft(Mye),listDropOverBackground:ft(Zct),listDropBetweenBackground:ft(Qct),listSelectionOutline:ft(Ki),listHoverOutline:ft(Ki),treeIndentGuidesStroke:ft(YL),treeInactiveIndentGuidesStroke:ft(iut),tableColumnsBorder:ft(rut),tableOddRowsBackgroundColor:ft(out)};function ZS(i){return n0t(i,O_)}const a0t={selectBackground:ft(Lf),selectListBackground:ft(gct),selectForeground:ft(ip),decoratorRightForeground:ft(kye),selectBorder:ft(my),focusBorder:ft(Qc),listFocusBackground:ft(X0),listInactiveSelectionIconForeground:ft(vy),listFocusForeground:ft(q0),listFocusOutline:nct(Ki,Ce.transparent.toString()),listHoverBackground:ft(Rye),listHoverForeground:ft(Mye),listHoverOutline:ft(Ki),selectListBorder:ft(op),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},l0t={shadowColor:ft(np),borderColor:ft(cut),foregroundColor:ft(uut),backgroundColor:ft(dut),selectionForegroundColor:ft(hut),selectionBackgroundColor:ft(fut),selectionBorderColor:ft(gut),separatorColor:ft(put),scrollbarShadow:ft(jL),scrollbarSliderBackground:ft(KL),scrollbarSliderHoverBackground:ft(GL),scrollbarSliderActiveBackground:ft(qL)};var t5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ja=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function c0t(i,e,t,n){const r=i.getActions(e),o=tp.getInstance(),s=o.keyStatus.altKey||(Os||ka)&&o.keyStatus.shiftKey;CSe(r,t,s,n?a=>a===n:a=>a==="navigation")}function n5(i,e,t,n,r,o){const s=i.getActions(e);CSe(s,t,!1,typeof n=="string"?l=>l===n:n,r,o)}function CSe(i,e,t,n=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&o&&d.push(new ho)):(d=a,d.length>0&&d.push(new ho));for(let h of u){t&&(h=h instanceof bc&&h.alt?h.alt:h);const f=d.push(h);h instanceof jw&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let s_=class extends dS{constructor(e,t,n,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Vo),this._altKey=tp.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 n=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(xe(e,"mouseleave",r=>{t=!1,n()})),this._register(xe(e,"mouseenter",r=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=n?w("titleAndKb","{0} ({1})",r,n):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?w("titleAndKb","{0} ({1})",s,l):s;o=w("titleAndKbAndAlt",`{0} -[{1}] {2}`,o,FZ.modifierLabels[Ll].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:n}=this;if(!t||!n)return;const r=this._commandAction.checked&&J_t(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Vt.isThemeIcon(r)){const o=Vt.asClassNameArray(r);n.classList.add(...o),this._itemClassDispose.value=Ot(()=>{n.classList.remove(...o)})}else n.style.backgroundImage=tS(this._themeService.getColorTheme().type)?Qv(r.dark):Qv(r.light),n.classList.add("icon"),this._itemClassDispose.value=td(Ot(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};s_=t5([Ja(2,ci),Ja(3,zr),Ja(4,Gt),Ja(5,Mo),Ja(6,$l),Ja(7,pd)],s_);let EU=class extends TO{constructor(e,t,n,r,o){var s,a,l;const c={...t,menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Vt.isThemeIcon(e.item.icon)?Vt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)};super(e,{getActions:()=>e.actions},r,c),this._keybindingService=n,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),Yn(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Vt.isThemeIcon(n)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=tS(this._themeService.getColorTheme().type)?Qv(n.dark):Qv(n.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};EU=t5([Ja(2,ci),Ja(3,$l),Ja(4,Mo)],EU);let DU=class extends zd{constructor(e,t,n,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(s_,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new Hb};this._dropdown=new TO(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof bc&&this.update(p.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(s_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Hb{async runAction(n,r){await n.run(void 0)}},this._container&&this._defaultAction.render(xY(this._container,Xe(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(n=`(${r.getLabel()})`)}return n}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=Xe(".action-container");this._defaultAction.render(Oe(this._container,t)),this._register(xe(t,Je.KEY_DOWN,r=>{const o=new Oi(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const n=Xe(".dropdown-action-container");this._dropdown.render(Oe(this._container,n)),this._register(xe(n,Je.KEY_DOWN,r=>{var o;const s=new Oi(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};DU=t5([Ja(2,ci),Ja(3,zr),Ja(4,$l),Ja(5,mu),Ja(6,Wt),Ja(7,md)],DU);let IU=class extends Y_t{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===ho.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,a0t,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ft(my)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};IU=t5([Ja(1,og)],IU);function ySe(i,e,t){return e instanceof bc?i.createInstance(s_,e,t):e instanceof dI?e.item.isSelection?i.createInstance(IU,e):e.item.rememberDefaultAction?i.createInstance(DU,e,{...t,persistLastActionId:!0}):i.createInstance(EU,e,t):void 0}class du extends me{constructor(e,t={}){var n,r,o,s,a,l,c;super(),this._actionRunnerDisposables=this._register(new Fe),this.viewItemDisposables=this._register(new nY),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new ae({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new ae),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new ae),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(qp("element",!0)),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Hb,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(xe(this.domNode,Je.KEY_DOWN,h=>{const f=new Oi(h);let g=!0;const p=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?g=this.focusPrevious():d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&p instanceof zd&&p.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register(xe(this.domNode,Je.KEY_UP,h=>{const f=new Oi(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(ph(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(ps()===this.domNode||!ts(ps(),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(n=>n instanceof zd&&n.isEnabled());t instanceof zd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof zd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),t}updateFocusedItem(){var e,t;for(let n=0;nt.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new dS(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,xe(s,Je.CONTEXT_MENU,c=>{gn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof zd&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ps(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===ho.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===ho.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var r,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;tI(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&tI(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===ho.ID&&(a=!1),a?(n||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=s.showHover)===null||o===void 0||o.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof zd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const kU=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,x7=/(&)?(&)([^\s&])/g;var MO;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(MO||(MO={}));class gw extends du{constructor(e,t,n,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Dn||ka?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,r),this._register(Li.addTarget(o)),this._register(xe(o,Je.KEY_DOWN,c=>{new Oi(c).equals(2)&&c.preventDefault()})),n.enableMnemonics&&this._register(xe(o,Je.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){gn.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof Zce&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(u,d)}}})),ka&&this._register(xe(o,Je.KEY_DOWN,c=>{const u=new Oi(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),gn.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),gn.stop(c,!0))})),this._register(xe(this.domNode,Je.MOUSE_OUT,c=>{const u=c.relatedTarget;ts(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(xe(this.actionsList,Je.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!ts(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(Li.addTarget(this.actionsList)),this._register(xe(this.actionsList,Ei.Tap,c=>{let u=c.initialTarget;if(!(!u||!ts(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 s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new ST(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(xe(o,Ei.Change,c=>{gn.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(xe(a,Je.MOUSE_UP,c=>{c.preventDefault()}));const l=Bt(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,u)=>{var d;return!((d=n.submenuIds)===null||d===void 0)&&d.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof ho&&(u===t.length-1||u===0||t[u-1]instanceof ho))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof Qce)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(VA(e)?this.styleSheet=_c(e):(gw.globalStyleSheet||(gw.globalStyleSheet=_c()),this.styleSheet=gw.globalStyleSheet)),this.styleSheet.textContent=d0t(t,VA(e))}styleScrollElement(e,t){var n,r;const o=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(xe(this.element,Je.MOUSE_UP,o=>{if(gn.stop(o,!0),lu){if(new Gu(Bt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(xe(this.element,Je.CONTEXT_MENU,o=>{gn.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Oe(this.element,Xe("a.action-menu-item")),this._action.id===ho.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Oe(this.item,Xe("span.menu-item-check"+Vt.asCSSSelector(tt.menuSelection))),this.check.setAttribute("role","none"),this.label=Oe(this.item,Xe("span.action-label")),this.options.label&&this.options.keybinding&&(Oe(this.item,Xe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Ps(this.label);let t=RZ(this.action.label);if(t){const n=u0t(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const r=kU.exec(t);if(r){t=OA(t),x7.lastIndex=0;let o=x7.exec(t);for(;o&&o[1];)o=x7.exec(t);const s=a=>a.replace(/&&/g,"&");o?this.label.append(uT(s(t.substr(0,o.index))," "),Xe("u",{"aria-hidden":"true"},o[3]),s1e(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=n??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Zce extends wSe{constructor(e,t,n,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=n,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new Fe),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:MO.Right,this.showScheduler=new mi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new mi(()=>{this.element&&!ts(ps(),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=Oe(this.item,Xe("span.submenu-indicator"+Vt.asCSSSelector(tt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(xe(this.element,Je.KEY_UP,t=>{const n=new Oi(t);(n.equals(17)||n.equals(3))&&(gn.stop(t,!0),this.createSubmenu(!0))})),this._register(xe(this.element,Je.KEY_DOWN,t=>{const n=new Oi(t);ps()===this.item&&(n.equals(17)||n.equals(3))&&gn.stop(t,!0)})),this._register(xe(this.element,Je.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(xe(this.element,Je.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(xe(this.element,Je.FOCUS_OUT,t=>{this.element&&!ts(ps(),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){gn.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,n,r){const o={top:0,left:0};return o.left=Ey(e.width,t.width,{position:r===MO.Right?0:1,offset:n.left,size:n.width}),o.left>=n.left&&o.left{new Oi(u).equals(15)&&(gn.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(xe(this.submenuContainer,Je.KEY_DOWN,u=>{new Oi(u).equals(15)&&gn.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===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Qce extends dS{constructor(e,t,n,r){super(e,t,n),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function u0t(i){const e=kU,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function Jce(i){const e=n1e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function d0t(i,e){let t=` +`)}}const $_t={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:Ce.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Ce.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Ce.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},H_t={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function V_t(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let r=t-1;for(;r>=0&&i[r]===e-(t-r);)n.push(i[r--]);for(n.reverse(),r=t;r=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){t.push(i[n]),n++,r++;continue}else i[n]=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){n++,r++;continue}else i[n]i-e;class U_t{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,n,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,n[o++],r)}disposeElement(e,t,n,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,n[s],r),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class j_t{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const r=this.accessibilityProvider.getAriaLabel(e);r?n.setAttribute("aria-label",r):n.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?n.setAttribute("aria-level",`${o}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class K_t{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 n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,e,t)}onDragOver(e,t,n,r,o){return this.dnd.onDragOver(e,t,n,r,o)}onDragLeave(e,t,n,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,n,r)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,r,o){this.dnd.drop(e,t,n,r,o)}dispose(){this.dnd.dispose()}}class Ec{get onDidChangeFocus(){return ot.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ot.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=ot.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,o=>o.map(s=>new Oi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>gn.stop(s,!0)).filter(()=>!1)),n=ot.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new Oi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>gn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=ot.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Gu(Bt(this.view.domNode),l),browserEvent:l})));return ot.any(t,n,r)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return ot.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return ot.signal(this.disposables.add(new xn(this.view.domNode,"blur",!0)).event)}constructor(e,t,n,r,o=H_t){var s,a,l,c;this.user=e,this._options=o,this.focus=new IO("focused"),this.anchor=new IO("anchor"),this.eventBufferer=new rY,this._ariaLabel="",this.disposables=new Fe,this._onDidDispose=new ae,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new M_t(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new j_t(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new U_t(f.templateId,[...d,f]));const h={...o,dnd:o.dnd&&new K_t(this,o.dnd)};if(this.view=this.createListView(t,n,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=_c(this.view.domNode);this.styleController=new vSe(f,this.view.domId)}if(this.spliceable=new w_t([new w7(this.focus,this.view,o.identityProvider),new w7(this.selection,this.view,o.identityProvider),new w7(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new B_t(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new fSe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||O_t;this.typeNavigationController=new F_t(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,n,r){return new bu(e,t,n,r)}createMouseController(e){return new mSe(this)}updateOptions(e={}){var t,n;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new l0(this.user,`Invalid start index: ${e}`);if(t<0)throw new l0(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}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 n of e)if(n<0||n>=this.length)throw new l0(this.user,`Invalid index ${n}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new l0(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return GX(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new l0(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],n)}async focusNextPage(e,t){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const r=this.getFocus()[0];if(r!==n&&(r===void 0||n>r)){const o=this.findPreviousIndex(n,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([n],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;n>r&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await Zv(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,n=()=>0){let r;const o=n(),s=this.view.getScrollTop()+o;s===0?r=this.view.indexAt(s):r=this.view.indexAfter(s-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=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+n()!==l&&(this.setFocus([]),await Zv(0),await this.focusPreviousPage(e,t,n))}}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const r=this.findNextIndex(e,!1,n);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,n){for(let r=0;r=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let r=0;rthis.view.element(e))}reveal(e,t,n=0){if(e<0||e>=this.length)throw new l0(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(Gv(t)){const a=s-this.view.renderHeight+n;this.view.setScrollTop(a*fa(t,0,1)+o-n)}else{const a=o+s,l=r+this.view.renderHeight;o=l||(o=l&&s>=this.view.renderHeight?this.view.setScrollTop(o-n):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new l0(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(rn+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((n+t-r)/s)}isDOMFocused(){return pT(this.view.domNode)}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(n=>this.view.element(n)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",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()}}O_([Ar],Ec.prototype,"onDidChangeFocus",null);O_([Ar],Ec.prototype,"onDidChangeSelection",null);O_([Ar],Ec.prototype,"onContextMenu",null);O_([Ar],Ec.prototype,"onKeyDown",null);O_([Ar],Ec.prototype,"onDidFocus",null);O_([Ar],Ec.prototype,"onDidBlur",null);const J0=Xe,_Se="selectOption.entry.template";class G_t{get templateId(){return _Se}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Oe(e,J0(".option-text")),t.detail=Oe(e,J0(".option-detail")),t.decoratorRight=Oe(e,J0(".option-decorator-right")),t}renderElement(e,t,n){const r=n,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class bf extends me{constructor(e,t,n,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=bf.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._hover=this._register(LC(qp("mouse"),this.selectElement,"")),this._onDidSelect=new ae,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return _Se}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Xe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Oe(this.selectDropDownContainer,J0(".select-box-details-pane"));const t=Oe(this.selectDropDownContainer,J0(".select-box-dropdown-container-width-control")),n=Oe(t,J0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Oe(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=_c(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(xe(this.selectDropDownContainer,Je.DRAG_START,r=>{gn.stop(r,!0)}))}registerListeners(){this._register(Lr(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._hover.update(this.options[this.selected].text)})),this._register(xe(this.selectElement,Je.CLICK,t=>{gn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(xe(this.selectElement,Je.MOUSE_DOWN,t=>{gn.stop(t)}));let e;this._register(xe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(xe(this.selectElement,"touchend",t=>{gn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(xe(this.selectElement,Je.KEY_DOWN,t=>{const n=new Oi(t);let r=!1;Dn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(r=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),gn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){lr(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.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._hover.update(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,n;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=bp(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!n,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),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=Bt(this.selectElement),n=Hr(this.selectElement),r=Bt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-bf.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 h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=d+o+h,g=Math.floor((s-o-h)/this.getHeight()),p=Math.floor((a-o-h)/this.getHeight());if(e)return n.top+n.height>t.innerHeight-22||n.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(n.top+n.height>t.innerHeight-22||n.tops&&(d=g*this.getHeight())}else f>a&&(d=p*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+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"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 n=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(n=s,r=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=ha(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Oe(e,J0(".select-box-dropdown-list-container")),this.listRenderer=new G_t,this.selectList=new Ec("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>w({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Dn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=ot.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new Oi(o)));this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ot.chain(n,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(xe(this.selectList.getHTMLElement(),Je.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(xe(this.selectDropDownContainer,Je.FOCUS_OUT,r=>{!this._isVisible||ts(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;gn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const r=Number(n.getAttribute("data-index")),o=n.classList.contains("option-disabled");r>=0&&r{for(let s=0;sthis.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&&(gn.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){gn.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{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){gn.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){gn.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=Vg.toString(e.keyCode);let n=-1;for(let r=0;r{this._register(xe(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Lr(this.selectElement,"click",e=>{gn.stop(e,!0)})),this._register(Lr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Lr(this.selectElement,"keydown",e=>{let t=!1;Dn?(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||!lr(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{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 Vb)),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(Li.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,lu&&this._register(xe(e,Je.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(zI.TEXT,this._action.label)}))),this._register(xe(t,Ei.Tap,r=>this.onClick(r,!0))),this._register(xe(t,Je.MOUSE_DOWN,r=>{n||gn.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),Dn&&this._register(xe(t,Je.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(xe(t,Je.CLICK,r=>{gn.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(xe(t,Je.DBLCLICK,r=>{gn.stop(r,!0)})),[Je.MOUSE_UP,Je.MOUSE_OUT].forEach(r=>{this._register(xe(t,r,o=>{gn.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var n;gn.stop(e,!0);const r=sc(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,n;if(!this.element)return;const r=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=r;else if(this.customHover)this.customHover.update(r);else{const o=(n=this.options.hoverDelegate)!==null&&n!==void 0?n:qp("element");this.customHover=LC(o,this.element,r),this._store.add(this.customHover)}}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class dS extends zd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),Yn(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 n=document.createElement("span");n.classList.add("keybinding"),n.textContent=this.options.keybinding,this.element.appendChild(n)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===ho.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=w({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===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Y_t extends zd{constructor(e,t,n,r,o,s,a){super(e,t),this.selectBox=new X_t(n,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Z_t extends Vb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new ae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Oe(e,Xe(".monaco-dropdown")),this._label=Oe(this._element,Xe(".dropdown-label"));let n=t.labelRenderer;n||(n=o=>(o.textContent=t.label||"",null));for(const o of[Je.CLICK,Je.MOUSE_DOWN,Ei.Tap])this._register(xe(this.element,o,s=>gn.stop(s,!0)));for(const o of[Je.MOUSE_DOWN,Ei.Tap])this._register(xe(this._label,o,s=>{wY(s)&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(xe(this._label,Je.KEY_UP,o=>{const s=new Oi(o);(s.equals(3)||s.equals(10))&&(gn.stop(o,!0),this.visible?this.hide():this.show())}));const r=n(this._label);r&&this._register(r),this._register(Li.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 Q_t extends Z_t{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 TO extends zd{constructor(e,t,n,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new ae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=Oe(o,Xe("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(LC(qp("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Q_t(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function J_t(i){return i?i.condition!==void 0:!1}var hw;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(hw||(hw={}));var Iy;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(Iy||(Iy={}));class fw extends me{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Ob),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Iy.None,this.cache=new Map,this.flushDelayer=this._register(new m1e(fw.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(n=e.deleted)===null||n===void 0||n.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Iy.Closed)return;let n=!1;sc(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return sc(n)?t:n}getBoolean(e,t){const n=this.get(e);return sc(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return sc(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===Iy.Closed)return;if(sc(t))return this.delete(e,n);const r=ba(t)||Array.isArray(t)?avt(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:n}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Iy.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===void 0||t()})}async doFlush(e){return this.options.hint===hw.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}fw.DEFAULT_FLUSH_DELAY=100;class S7{constructor(){this.onDidChangeItemsExternal=ot.None,this.items=new Map}async updateItems(e){var t,n;(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(n=e.delete)===null||n===void 0||n.forEach(r=>this.items.delete(r))}}const tP="__$__targetStorageMarker",md=Sn("storageService");var UI;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(UI||(UI={}));function e0t(i){const e=i.get(tP);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class e5 extends me{constructor(e={flushInterval:e5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Ob),this._onDidChangeTarget=this._register(new Ob),this._onWillSaveState=this._register(new ae),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return ot.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:r}=t;if(n===tP){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:n,target:this.getKeyTargets(e)[n],external:r})}get(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,n)}getBoolean(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,n)}getNumber(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,n)}store(e,t,n,r,o=!1){if(sc(t)){this.remove(e,n,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,r),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,o)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,r=!1){var o,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(o=this.getStorage(t))===null||o===void 0||o.set(tP,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(tP,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?e0t(t):Object.create(null)}}e5.DEFAULT_FLUSH_INTERVAL=60*1e3;class t0t extends e5{constructor(){super(),this.applicationStorage=this._register(new fw(new S7,{hint:hw.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fw(new S7,{hint:hw.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fw(new S7,{hint:hw.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 n0t(i,e){const t={...e};for(const n in i){const r=i[n];t[n]=r!==void 0?ft(r):void 0}return t}const i0t={keybindingLabelBackground:ft(Dct),keybindingLabelForeground:ft(Ict),keybindingLabelBorder:ft(kct),keybindingLabelBottomBorder:ft(Tct),keybindingLabelShadow:ft(np)},r0t={buttonForeground:ft(zL),buttonSeparator:ft(pct),buttonBackground:ft(UL),buttonHoverBackground:ft(mct),buttonSecondaryForeground:ft(_ct),buttonSecondaryBackground:ft(Lz),buttonSecondaryHoverBackground:ft(bct),buttonBorder:ft(vct)},o0t={progressBarBackground:ft(yct)},NO={inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY),inputActiveOptionBackground:ft(q0)};ft(sut),ft(lut),ft(aut);ft(Pr),ft(rp),ft(np),ft(Ln),ft(xut),ft(Lut),ft(Eut),ft(rct);const RO={inputBackground:ft(Eye),inputForeground:ft(Dye),inputBorder:ft(Iye),inputValidationInfoBorder:ft(act),inputValidationInfoBackground:ft(oct),inputValidationInfoForeground:ft(sct),inputValidationWarningBorder:ft(uct),inputValidationWarningBackground:ft(lct),inputValidationWarningForeground:ft(cct),inputValidationErrorBorder:ft(fct),inputValidationErrorBackground:ft(dct),inputValidationErrorForeground:ft(hct)},s0t={listFilterWidgetBackground:ft(Jct),listFilterWidgetOutline:ft(eut),listFilterWidgetNoMatchesOutline:ft(tut),listFilterWidgetShadow:ft(nut),inputBoxStyles:RO,toggleStyles:NO},bSe={badgeBackground:ft(jM),badgeForeground:ft(Cct),badgeBorder:ft(Ln)};ft(vut),ft(mut),ft(ole),ft(ole),ft(_ut);const F_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ft(Vct),listFocusForeground:ft(zct),listFocusOutline:ft(Uct),listActiveSelectionBackground:ft(cp),listActiveSelectionForeground:ft(Df),listActiveSelectionIconForeground:ft(XL),listFocusAndSelectionOutline:ft(jct),listFocusAndSelectionBackground:ft(cp),listFocusAndSelectionForeground:ft(Df),listInactiveSelectionBackground:ft(Kct),listInactiveSelectionIconForeground:ft(qct),listInactiveSelectionForeground:ft(Gct),listInactiveFocusBackground:ft(Xct),listInactiveFocusOutline:ft(Yct),listHoverBackground:ft(Rye),listHoverForeground:ft(Mye),listDropOverBackground:ft(Zct),listDropBetweenBackground:ft(Qct),listSelectionOutline:ft(Ki),listHoverOutline:ft(Ki),treeIndentGuidesStroke:ft(YL),treeInactiveIndentGuidesStroke:ft(iut),tableColumnsBorder:ft(rut),tableOddRowsBackgroundColor:ft(out)};function ZS(i){return n0t(i,F_)}const a0t={selectBackground:ft(Lf),selectListBackground:ft(gct),selectForeground:ft(ip),decoratorRightForeground:ft(kye),selectBorder:ft(my),focusBorder:ft(Qc),listFocusBackground:ft(Y0),listInactiveSelectionIconForeground:ft(vy),listFocusForeground:ft(X0),listFocusOutline:nct(Ki,Ce.transparent.toString()),listHoverBackground:ft(Rye),listHoverForeground:ft(Mye),listHoverOutline:ft(Ki),selectListBorder:ft(op),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},l0t={shadowColor:ft(np),borderColor:ft(cut),foregroundColor:ft(uut),backgroundColor:ft(dut),selectionForegroundColor:ft(hut),selectionBackgroundColor:ft(fut),selectionBorderColor:ft(gut),separatorColor:ft(put),scrollbarShadow:ft(jL),scrollbarSliderBackground:ft(KL),scrollbarSliderHoverBackground:ft(GL),scrollbarSliderActiveBackground:ft(qL)};var t5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ja=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function c0t(i,e,t,n){const r=i.getActions(e),o=tp.getInstance(),s=o.keyStatus.altKey||(Os||ka)&&o.keyStatus.shiftKey;CSe(r,t,s,n?a=>a===n:a=>a==="navigation")}function n5(i,e,t,n,r,o){const s=i.getActions(e);CSe(s,t,!1,typeof n=="string"?l=>l===n:n,r,o)}function CSe(i,e,t,n=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&o&&d.push(new ho)):(d=a,d.length>0&&d.push(new ho));for(let h of u){t&&(h=h instanceof bc&&h.alt?h.alt:h);const f=d.push(h);h instanceof jw&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let a_=class extends dS{constructor(e,t,n,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Vo),this._altKey=tp.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 n=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(xe(e,"mouseleave",r=>{t=!1,n()})),this._register(xe(e,"mouseenter",r=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=n?w("titleAndKb","{0} ({1})",r,n):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?w("titleAndKb","{0} ({1})",s,l):s;o=w("titleAndKbAndAlt",`{0} +[{1}] {2}`,o,FZ.modifierLabels[Ll].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:n}=this;if(!t||!n)return;const r=this._commandAction.checked&&J_t(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Vt.isThemeIcon(r)){const o=Vt.asClassNameArray(r);n.classList.add(...o),this._itemClassDispose.value=Ot(()=>{n.classList.remove(...o)})}else n.style.backgroundImage=tS(this._themeService.getColorTheme().type)?Jv(r.dark):Jv(r.light),n.classList.add("icon"),this._itemClassDispose.value=td(Ot(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};a_=t5([Ja(2,ci),Ja(3,zr),Ja(4,Gt),Ja(5,Mo),Ja(6,$l),Ja(7,pd)],a_);let EU=class extends TO{constructor(e,t,n,r,o){var s,a,l;const c={...t,menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Vt.isThemeIcon(e.item.icon)?Vt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)};super(e,{getActions:()=>e.actions},r,c),this._keybindingService=n,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),Yn(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Vt.isThemeIcon(n)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=tS(this._themeService.getColorTheme().type)?Jv(n.dark):Jv(n.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};EU=t5([Ja(2,ci),Ja(3,$l),Ja(4,Mo)],EU);let DU=class extends zd{constructor(e,t,n,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(a_,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new Vb};this._dropdown=new TO(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof bc&&this.update(p.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(a_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Vb{async runAction(n,r){await n.run(void 0)}},this._container&&this._defaultAction.render(xY(this._container,Xe(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(n=`(${r.getLabel()})`)}return n}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=Xe(".action-container");this._defaultAction.render(Oe(this._container,t)),this._register(xe(t,Je.KEY_DOWN,r=>{const o=new Oi(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const n=Xe(".dropdown-action-container");this._dropdown.render(Oe(this._container,n)),this._register(xe(n,Je.KEY_DOWN,r=>{var o;const s=new Oi(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};DU=t5([Ja(2,ci),Ja(3,zr),Ja(4,$l),Ja(5,mu),Ja(6,Wt),Ja(7,md)],DU);let IU=class extends Y_t{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===ho.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,a0t,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ft(my)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};IU=t5([Ja(1,og)],IU);function ySe(i,e,t){return e instanceof bc?i.createInstance(a_,e,t):e instanceof dI?e.item.isSelection?i.createInstance(IU,e):e.item.rememberDefaultAction?i.createInstance(DU,e,{...t,persistLastActionId:!0}):i.createInstance(EU,e,t):void 0}class du extends me{constructor(e,t={}){var n,r,o,s,a,l,c;super(),this._actionRunnerDisposables=this._register(new Fe),this.viewItemDisposables=this._register(new nY),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new ae({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new ae),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new ae),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(qp("element",!0)),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Vb,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(xe(this.domNode,Je.KEY_DOWN,h=>{const f=new Oi(h);let g=!0;const p=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?g=this.focusPrevious():d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&p instanceof zd&&p.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register(xe(this.domNode,Je.KEY_UP,h=>{const f=new Oi(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(ph(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(ps()===this.domNode||!ts(ps(),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(n=>n instanceof zd&&n.isEnabled());t instanceof zd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof zd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),t}updateFocusedItem(){var e,t;for(let n=0;nt.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new dS(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,xe(s,Je.CONTEXT_MENU,c=>{gn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof zd&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ps(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===ho.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===ho.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var r,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;tI(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&tI(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===ho.ID&&(a=!1),a?(n||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=s.showHover)===null||o===void 0||o.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof zd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const kU=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,x7=/(&)?(&)([^\s&])/g;var MO;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(MO||(MO={}));class gw extends du{constructor(e,t,n,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Dn||ka?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,r),this._register(Li.addTarget(o)),this._register(xe(o,Je.KEY_DOWN,c=>{new Oi(c).equals(2)&&c.preventDefault()})),n.enableMnemonics&&this._register(xe(o,Je.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){gn.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof Zce&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(u,d)}}})),ka&&this._register(xe(o,Je.KEY_DOWN,c=>{const u=new Oi(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),gn.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),gn.stop(c,!0))})),this._register(xe(this.domNode,Je.MOUSE_OUT,c=>{const u=c.relatedTarget;ts(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(xe(this.actionsList,Je.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!ts(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(Li.addTarget(this.actionsList)),this._register(xe(this.actionsList,Ei.Tap,c=>{let u=c.initialTarget;if(!(!u||!ts(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 s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new ST(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(xe(o,Ei.Change,c=>{gn.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(xe(a,Je.MOUSE_UP,c=>{c.preventDefault()}));const l=Bt(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,u)=>{var d;return!((d=n.submenuIds)===null||d===void 0)&&d.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof ho&&(u===t.length-1||u===0||t[u-1]instanceof ho))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof Qce)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(VA(e)?this.styleSheet=_c(e):(gw.globalStyleSheet||(gw.globalStyleSheet=_c()),this.styleSheet=gw.globalStyleSheet)),this.styleSheet.textContent=d0t(t,VA(e))}styleScrollElement(e,t){var n,r;const o=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(xe(this.element,Je.MOUSE_UP,o=>{if(gn.stop(o,!0),lu){if(new Gu(Bt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(xe(this.element,Je.CONTEXT_MENU,o=>{gn.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Oe(this.element,Xe("a.action-menu-item")),this._action.id===ho.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Oe(this.item,Xe("span.menu-item-check"+Vt.asCSSSelector(tt.menuSelection))),this.check.setAttribute("role","none"),this.label=Oe(this.item,Xe("span.action-label")),this.options.label&&this.options.keybinding&&(Oe(this.item,Xe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Ps(this.label);let t=RZ(this.action.label);if(t){const n=u0t(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const r=kU.exec(t);if(r){t=OA(t),x7.lastIndex=0;let o=x7.exec(t);for(;o&&o[1];)o=x7.exec(t);const s=a=>a.replace(/&&/g,"&");o?this.label.append(uT(s(t.substr(0,o.index))," "),Xe("u",{"aria-hidden":"true"},o[3]),s1e(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=n??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Zce extends wSe{constructor(e,t,n,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=n,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new Fe),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:MO.Right,this.showScheduler=new mi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new mi(()=>{this.element&&!ts(ps(),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=Oe(this.item,Xe("span.submenu-indicator"+Vt.asCSSSelector(tt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(xe(this.element,Je.KEY_UP,t=>{const n=new Oi(t);(n.equals(17)||n.equals(3))&&(gn.stop(t,!0),this.createSubmenu(!0))})),this._register(xe(this.element,Je.KEY_DOWN,t=>{const n=new Oi(t);ps()===this.item&&(n.equals(17)||n.equals(3))&&gn.stop(t,!0)})),this._register(xe(this.element,Je.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(xe(this.element,Je.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(xe(this.element,Je.FOCUS_OUT,t=>{this.element&&!ts(ps(),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){gn.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,n,r){const o={top:0,left:0};return o.left=Ey(e.width,t.width,{position:r===MO.Right?0:1,offset:n.left,size:n.width}),o.left>=n.left&&o.left{new Oi(u).equals(15)&&(gn.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(xe(this.submenuContainer,Je.KEY_DOWN,u=>{new Oi(u).equals(15)&&gn.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===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Qce extends dS{constructor(e,t,n,r){super(e,t,n),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function u0t(i){const e=kU,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function Jce(i){const e=n1e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function d0t(i,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; @@ -1126,26 +1126,26 @@ ${Jce(tt.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${s}; } - `)}return t}class h0t{constructor(e,t,n,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,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=ps();let n;const r=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(Xe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=xe(this.block,Je.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Fe,c=e.actionRunner||new Hb;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new gw(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},l0t),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const u=Bt(o);return l.add(xe(u,Je.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(xe(u,Je.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Gu(u,d);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),td(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(ps()===this.lastContainer||ts(ps(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Th(e.error)&&this.notificationService.error(e.error)}}var f0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},w1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let TU=class extends me{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new h0t(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new ae),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new ae)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=NU.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}}),tp.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};TU=f0t([w1(0,ia),w1(1,zr),w1(2,og),w1(3,ci),w1(4,mu),w1(5,Gt)],TU);var NU;(function(i){function e(n){return n&&n.menuId instanceof H}function t(n,r,o){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return{...n,getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);c0t(u,a,c),u.dispose()}return n.getActions?ho.join(n.getActions(),c):c}}}i.transform=t})(NU||(NU={}));var PO;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(PO||(PO={}));var WZ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},AO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let RU=class{constructor(e){this._commandService=e}async open(e,t){if(!_Y(e,cn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ft.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=uU(decodeURIComponent(e.query))}catch{try{n=uU(e.query)}catch{}}return Array.isArray(n)||(n=[n]),await this._commandService.executeCommand(e.path,...n),!0}};RU=WZ([AO(0,cr)],RU);let MU=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=Ft.parse(e));const{selection:n,uri:r}=Lmt(e);return e=r,e.scheme===cn.file&&(e=qft(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:n,source:t!=null&&t.fromUserGesture?PO.USER:PO.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};MU=WZ([AO(0,jn)],MU);let PU=class{constructor(e,t){this._openers=new Ca,this._validators=new Ca,this._resolvers=new Ca,this._resolvedUriTargets=new Mr(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ca,this._defaultExternalOpener={openExternal:async n=>(Qse(n,cn.http,cn.https)?F1e(n):hi.location.href=n,!0)},this._openers.push({open:async(n,r)=>r!=null&&r.openExternal||Qse(n,cn.mailto,cn.http,cn.https,cn.vsls)?(await this._doOpenExternal(n,r),!0):!1}),this._openers.push(new RU(t)),this._openers.push(new MU(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var n;const r=typeof e=="string"?Ft.parse(e):e,o=(n=this._resolvedUriTargets.get(r))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!await s.shouldOpen(o,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 n of this._resolvers)try{const r=await n.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 n=typeof e=="string"?Ft.parse(e):e;let r;try{r=(await this.resolveExternalUri(n,t)).resolved}catch{r=n}let o;if(typeof e=="string"&&n.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:n,preferredOpenerId:s},wn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:n},wn.None)}dispose(){this._validators.clear()}};PU=WZ([AO(0,jn),AO(1,cr)],PU);const vd=Sn("editorWorkerService");var vr;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(vr||(vr={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=w("sev.error","Error"),t[i.Warning]=w("sev.warning","Warning"),t[i.Info]=w("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function r(s){switch(s){case Rr.Error:return i.Error;case Rr.Warning:return i.Warning;case Rr.Info:return i.Info;case Rr.Ignore:return i.Hint}}i.fromSeverity=r;function o(s){switch(s){case i.Error:return Rr.Error;case i.Warning:return Rr.Warning;case i.Info:return Rr.Info;case i.Hint:return Rr.Ignore}}i.toSeverity=o})(vr||(vr={}));var OO;(function(i){const e="";function t(r){return n(r,!0)}i.makeKey=t;function n(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(vr.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}i.makeKeyOptionalMessage=n})(OO||(OO={}));const sg=Sn("markerService");function g0t(i,e){const t=[],n=[];for(const r of i)e.has(r)||t.push(r);for(const r of e)i.has(r)||n.push(r);return{removed:t,added:n}}function p0t(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var m0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let AU=class extends me{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new ae),this._markerDecorations=new Mr,e.getModels().forEach(n=>this._onModelAdded(n)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new v0t(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===cn.inMemory||e.uri.scheme===cn.internal||e.uri.scheme===cn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};AU=m0t([eue(0,rr),eue(1,sg)],AU);class v0t extends me{constructor(e){super(),this.model=e,this._map=new Xat,this._register(Ot(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=g0t(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const r=n.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of n)this._map.delete(a);for(let a=0;a=r)return n;const o=e.getWordAtPosition(n.getStartPosition());o&&(n=new W(n.startLineNumber,o.startColumn,n.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r=0:!1}}var _0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},W1;function c0(i){return i.toString()}class b0t{constructor(e,t,n){this.model=e,this._modelEventListeners=new Fe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>n(e,r)))}dispose(){this._modelEventListeners.dispose()}}const C0t=ka||Dn?1:2;class y0t{constructor(e,t,n,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let FO=W1=class extends me{constructor(e,t,n,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new ae),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new ae),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new ae),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 n;let r=Ts.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=Ts.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=C0t;const l=e.eol;l===`\r + `)}return t}class h0t{constructor(e,t,n,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,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=ps();let n;const r=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(Xe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=xe(this.block,Je.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Fe,c=e.actionRunner||new Vb;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new gw(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},l0t),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const u=Bt(o);return l.add(xe(u,Je.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(xe(u,Je.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Gu(u,d);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),td(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(ps()===this.lastContainer||ts(ps(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Th(e.error)&&this.notificationService.error(e.error)}}var f0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},w1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let TU=class extends me{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new h0t(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new ae),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new ae)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=NU.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}}),tp.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};TU=f0t([w1(0,ia),w1(1,zr),w1(2,og),w1(3,ci),w1(4,mu),w1(5,Gt)],TU);var NU;(function(i){function e(n){return n&&n.menuId instanceof H}function t(n,r,o){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return{...n,getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);c0t(u,a,c),u.dispose()}return n.getActions?ho.join(n.getActions(),c):c}}}i.transform=t})(NU||(NU={}));var PO;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(PO||(PO={}));var WZ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},AO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let RU=class{constructor(e){this._commandService=e}async open(e,t){if(!_Y(e,cn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ft.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=uU(decodeURIComponent(e.query))}catch{try{n=uU(e.query)}catch{}}return Array.isArray(n)||(n=[n]),await this._commandService.executeCommand(e.path,...n),!0}};RU=WZ([AO(0,cr)],RU);let MU=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=Ft.parse(e));const{selection:n,uri:r}=Lmt(e);return e=r,e.scheme===cn.file&&(e=qft(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:n,source:t!=null&&t.fromUserGesture?PO.USER:PO.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};MU=WZ([AO(0,jn)],MU);let PU=class{constructor(e,t){this._openers=new Ca,this._validators=new Ca,this._resolvers=new Ca,this._resolvedUriTargets=new Mr(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ca,this._defaultExternalOpener={openExternal:async n=>(Qse(n,cn.http,cn.https)?F1e(n):hi.location.href=n,!0)},this._openers.push({open:async(n,r)=>r!=null&&r.openExternal||Qse(n,cn.mailto,cn.http,cn.https,cn.vsls)?(await this._doOpenExternal(n,r),!0):!1}),this._openers.push(new RU(t)),this._openers.push(new MU(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var n;const r=typeof e=="string"?Ft.parse(e):e,o=(n=this._resolvedUriTargets.get(r))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!await s.shouldOpen(o,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 n of this._resolvers)try{const r=await n.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 n=typeof e=="string"?Ft.parse(e):e;let r;try{r=(await this.resolveExternalUri(n,t)).resolved}catch{r=n}let o;if(typeof e=="string"&&n.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:n,preferredOpenerId:s},wn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:n},wn.None)}dispose(){this._validators.clear()}};PU=WZ([AO(0,jn),AO(1,cr)],PU);const vd=Sn("editorWorkerService");var vr;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(vr||(vr={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=w("sev.error","Error"),t[i.Warning]=w("sev.warning","Warning"),t[i.Info]=w("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function r(s){switch(s){case Rr.Error:return i.Error;case Rr.Warning:return i.Warning;case Rr.Info:return i.Info;case Rr.Ignore:return i.Hint}}i.fromSeverity=r;function o(s){switch(s){case i.Error:return Rr.Error;case i.Warning:return Rr.Warning;case i.Info:return Rr.Info;case i.Hint:return Rr.Ignore}}i.toSeverity=o})(vr||(vr={}));var OO;(function(i){const e="";function t(r){return n(r,!0)}i.makeKey=t;function n(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(vr.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}i.makeKeyOptionalMessage=n})(OO||(OO={}));const sg=Sn("markerService");function g0t(i,e){const t=[],n=[];for(const r of i)e.has(r)||t.push(r);for(const r of e)i.has(r)||n.push(r);return{removed:t,added:n}}function p0t(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var m0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let AU=class extends me{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new ae),this._markerDecorations=new Mr,e.getModels().forEach(n=>this._onModelAdded(n)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new v0t(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===cn.inMemory||e.uri.scheme===cn.internal||e.uri.scheme===cn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};AU=m0t([eue(0,or),eue(1,sg)],AU);class v0t extends me{constructor(e){super(),this.model=e,this._map=new Xat,this._register(Ot(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=g0t(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const r=n.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of n)this._map.delete(a);for(let a=0;a=r)return n;const o=e.getWordAtPosition(n.getStartPosition());o&&(n=new W(n.startLineNumber,o.startColumn,n.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r=0:!1}}var _0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},W1;function u0(i){return i.toString()}class b0t{constructor(e,t,n){this.model=e,this._modelEventListeners=new Fe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>n(e,r)))}dispose(){this._modelEventListeners.dispose()}}const C0t=ka||Dn?1:2;class y0t{constructor(e,t,n,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let FO=W1=class extends me{constructor(e,t,n,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new ae),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new ae),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new ae),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 n;let r=Ts.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=Ts.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=C0t;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let c=Ts.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let u=Ts.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(u=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ts.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ts.bracketPairColorizationOptions;return!((n=e.editor)===null||n===void 0)&&n.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:r,indentSize:o,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&typeof n=="string"&&n!=="auto"?n:Ll===3||Ll===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=W1._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let r=0,o=n.length;re){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,r)=>n.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){const o=this.getCreationOptions(t,n,r),s=new Gf(e,t,o,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(c0(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)Wg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)Wg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>Wg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=c0(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new b0t(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,r=!1){let o;return t?o=this._createModelData(e,t,n,r):o=this._createModelData(e,mc,n,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n0||c.future.length>0){for(const u of c.past)Wg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)Wg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=W1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Wg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new y0t(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);W1._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new i5}};FO.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;FO=W1=_0t([gL(0,mn),gL(1,mye),gL(2,z3),gL(3,qi),gL(4,Ti)],FO);class i5{canComputeSHA1(e){return e.getValueLength()<=i5.MAX_MODEL_SIZE}computeSHA1(e){const t=new c3,n=e.createSnapshot();let r;for(;r=n.read();)t.update(r);return t.digest()}}i5.MAX_MODEL_SIZE=10*1024*1024;class w0t{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:me.None}}renderElement(e,t,n,r){var o;if((o=n.disposable)===null||o===void 0||o.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,r);const a=new xr,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.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 S0t{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 x0t(i,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new S0t(i,e.accessibilityProvider)}}class L0t{constructor(e,t,n,r,o={}){const s=()=>this.model,a=r.map(l=>new w0t(l,s));this.list=new Ec(e,t,n,a,x0t(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ot.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return ot.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return ot.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,ua(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 QS=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const E0t=!1;var BO;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(BO||(BO={}));let D0t=4;const I0t=new ae;let k0t=300;const T0t=new ae;class $Z{constructor(e){this.el=e,this.disposables=new Fe}get onPointerMove(){return this.disposables.add(new xn(Bt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(Bt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}QS([Ar],$Z.prototype,"onPointerMove",null);QS([Ar],$Z.prototype,"onPointerUp",null);class HZ{get onPointerMove(){return this.disposables.add(new xn(this.el,Ei.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Ei.End)).event}constructor(e){this.el=e,this.disposables=new Fe}dispose(){this.disposables.dispose()}}QS([Ar],HZ.prototype,"onPointerMove",null);QS([Ar],HZ.prototype,"onPointerUp",null);class WO{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}QS([Ar],WO.prototype,"onPointerMove",null);QS([Ar],WO.prototype,"onPointerUp",null);const tue="pointer-events-disabled";class Is extends me{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=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Oe(this.el,Xe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ot(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Is.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Oe(this.el,Xe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ot(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Is.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=k0t,this.hoverDelayer=this._register(new ad(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new ae),this._onDidStart=this._register(new ae),this._onDidChange=this._register(new ae),this._onDidReset=this._register(new ae),this._onDidEnd=this._register(new ae),this.orthogonalStartSashDisposables=this._register(new Fe),this.orthogonalStartDragHandleDisposables=this._register(new Fe),this.orthogonalEndSashDisposables=this._register(new Fe),this.orthogonalEndDragHandleDisposables=this._register(new Fe),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=Oe(e,Xe(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Dn&&this.el.classList.add("mac");const r=this._register(new xn(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new $Z(e)),this));const o=this._register(new xn(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>Is.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>Is.onMouseLeave(this))),this._register(Li.addTarget(this.el));const l=this._register(new xn(this.el,Ei.Start)).event;this._register(l(d=>this.onPointerStart(d,new HZ(this.el)),this));const c=this._register(new xn(this.el,Ei.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 n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=D0t,this._register(I0t.event(d=>{this.size=d,this.layout()}))),this._register(T0t.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.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",E0t),this.layout()}onPointerStart(e,t){gn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new WO(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new WO(t))),!this.state)return;const r=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of r)g.classList.add(tue);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=_c(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Dn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Dn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Fe;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{gn.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{gn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of r)p.classList.remove(tue)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Is.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Is.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Is.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const N0t={separatorBorder:Ce.transparent};class SSe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var n,r;if(e!==this.visible){e?(this.size=fa(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=(n=this.view).setVisible)===null||r===void 0||r.call(n,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(n){console.error("Splitview: Failed to layout view"),console.error(n)}}dispose(){this.disposable.dispose()}}class R0t extends SSe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class M0t extends SSe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Pg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(Pg||(Pg={}));var $O;(function(i){i.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}i.Split=e;function t(r){return{type:"auto",index:r}}i.Auto=t;function n(r){return{type:"invisible",cachedVisibleSize:r}}i.Invisible=n})($O||($O={}));class xSe extends me{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var n,r,o,s,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Pg.Idle,this._onDidSashChange=this._register(new ae),this._onDidSashReset=this._register(new ae),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Oe(this.el,Xe(".sash-container")),this.viewContainer=Xe(".split-view-container"),this.scrollable=this._register(new XS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>Ml(Bt(this.el),c)})),this.scrollableElement=this._register(new A3(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),Oe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||N0t),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=xl(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this._contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,r){this.doAddView(e,t,n,r)}layout(e,t){const n=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o0&&(s.size=fa(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=ua(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,o,s)}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:n}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=td(xe(this.el.ownerDocument.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),xe(this.el.ownerDocument.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const p=this.viewItems[r];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[r+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=ua(r,-1),p=ua(r+1,this.viewItems.length),m=g.reduce((k,T)=>k+(this.viewItems[T].minimumSize-c[T]),0),v=g.reduce((k,T)=>k+(this.viewItems[T].viewMaximumSize-c[T]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].viewMaximumSize),0),S=Math.max(m,y),L=Math.min(_,v),E=this.findFirstSnapIndex(g),D=this.findFirstSnapIndex(p);if(typeof E=="number"){const k=this.viewItems[E],T=Math.floor(k.viewMinimumSize/2);h={index:E,limitDelta:k.visible?S-T:S+T,size:k.size}}if(typeof D=="number"){const k=this.viewItems[D],T=Math.floor(k.viewMinimumSize/2);f={index:D,limitDelta:k.visible?L+T:L-T,size:k.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:o}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],m=p.size-p.maximumSize,v=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,m,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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=fa(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Pg.Idle)throw new Error("Cant modify splitview");this.state=Pg.Busy;try{const n=ua(this.viewItems.length).filter(a=>a!==e),r=[...n.filter(a=>this.viewItems[a].priority===1),e],o=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=fa(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o)}finally{this.state=Pg.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 n=Math.floor(t/e.length);for(const a of e)a.size=fa(n,a.minimumSize,a.maximumSize);const r=ua(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,r){if(this.state!==Pg.Idle)throw new Error("Cant modify splitview");this.state=Pg.Busy;try{const o=Xe(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=Ot(()=>this.viewContainer.removeChild(o)),l=td(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new R0t(o,e,c,l):new M0t(o,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Is(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new Is(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,orientation:0}),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),m=ot.map(f.onDidStart,g)(this.onSashStart,this),_=ot.map(f.onDidChange,g)(this.onSashChange,this),S=ot.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const k=this.sashItems.findIndex(R=>R.sash===f),T=ua(k,-1),M=ua(k+1,this.viewItems.length),P=this.findFirstSnapIndex(T),N=this.findFirstSnapIndex(M);typeof P=="number"&&!this.viewItems[P].visible||typeof N=="number"&&!this.viewItems[N].visible||this._onDidSashReset.fire(k)}),E=td(m,_,S,L,f),D={sash:f,disposable:E};this.sashItems.splice(n-1,0,D)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([n],d),!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Pg.Idle}}relayout(e,t){const n=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=ua(e,-1),d=ua(e+1,this.viewItems.length);if(o)for(const D of o)c9(u,D),c9(d,D);if(r)for(const D of r)AR(u,D),AR(d,D);const h=u.map(D=>this.viewItems[D]),f=u.map(D=>n[D]),g=d.map(D=>this.viewItems[D]),p=d.map(D=>n[D]),m=u.reduce((D,k)=>D+(this.viewItems[k].minimumSize-n[k]),0),v=u.reduce((D,k)=>D+(this.viewItems[k].maximumSize-n[k]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].maximumSize),0),S=Math.max(m,y,s),L=Math.min(_,v,a);let E=!1;if(l){const D=this.viewItems[l.index],k=t>=l.limitDelta;E=k!==D.visible,D.setVisible(k,l.size)}if(!E&&c){const D=this.viewItems[c.index],k=ta+l.size,0);let n=this.size-t;const r=ua(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)c9(r,a);for(const a of o)AR(r,a);typeof e=="number"&&AR(r,e);for(let a=0;n!==0&&at+n.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 n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class PT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=PT.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Oe(e,Xe(".monaco-table-tr")),n=[],r=[];for(let s=0;sthis.disposables.add(new A0t(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 xSe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new PT(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new Ec(e,this.domNode,P0t(n),[c],s)),ot.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=_c(this.domNode),this.style($_t)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=W1._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let r=0,o=n.length;re){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,r)=>n.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){const o=this.getCreationOptions(t,n,r),s=new Gf(e,t,o,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(u0(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)Wg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)Wg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>Wg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=u0(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new b0t(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,r=!1){let o;return t?o=this._createModelData(e,t,n,r):o=this._createModelData(e,mc,n,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n0||c.future.length>0){for(const u of c.past)Wg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)Wg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=W1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Wg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new y0t(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);W1._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new i5}};FO.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;FO=W1=_0t([gL(0,mn),gL(1,mye),gL(2,z3),gL(3,qi),gL(4,Ti)],FO);class i5{canComputeSHA1(e){return e.getValueLength()<=i5.MAX_MODEL_SIZE}computeSHA1(e){const t=new c3,n=e.createSnapshot();let r;for(;r=n.read();)t.update(r);return t.digest()}}i5.MAX_MODEL_SIZE=10*1024*1024;class w0t{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:me.None}}renderElement(e,t,n,r){var o;if((o=n.disposable)===null||o===void 0||o.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,r);const a=new xr,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.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 S0t{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 x0t(i,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new S0t(i,e.accessibilityProvider)}}class L0t{constructor(e,t,n,r,o={}){const s=()=>this.model,a=r.map(l=>new w0t(l,s));this.list=new Ec(e,t,n,a,x0t(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ot.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return ot.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return ot.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,ua(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 QS=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const E0t=!1;var BO;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(BO||(BO={}));let D0t=4;const I0t=new ae;let k0t=300;const T0t=new ae;class $Z{constructor(e){this.el=e,this.disposables=new Fe}get onPointerMove(){return this.disposables.add(new xn(Bt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(Bt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}QS([Ar],$Z.prototype,"onPointerMove",null);QS([Ar],$Z.prototype,"onPointerUp",null);class HZ{get onPointerMove(){return this.disposables.add(new xn(this.el,Ei.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Ei.End)).event}constructor(e){this.el=e,this.disposables=new Fe}dispose(){this.disposables.dispose()}}QS([Ar],HZ.prototype,"onPointerMove",null);QS([Ar],HZ.prototype,"onPointerUp",null);class WO{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}QS([Ar],WO.prototype,"onPointerMove",null);QS([Ar],WO.prototype,"onPointerUp",null);const tue="pointer-events-disabled";class Is extends me{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=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Oe(this.el,Xe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ot(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Is.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Oe(this.el,Xe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ot(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Is.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=k0t,this.hoverDelayer=this._register(new ad(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new ae),this._onDidStart=this._register(new ae),this._onDidChange=this._register(new ae),this._onDidReset=this._register(new ae),this._onDidEnd=this._register(new ae),this.orthogonalStartSashDisposables=this._register(new Fe),this.orthogonalStartDragHandleDisposables=this._register(new Fe),this.orthogonalEndSashDisposables=this._register(new Fe),this.orthogonalEndDragHandleDisposables=this._register(new Fe),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=Oe(e,Xe(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Dn&&this.el.classList.add("mac");const r=this._register(new xn(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new $Z(e)),this));const o=this._register(new xn(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>Is.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>Is.onMouseLeave(this))),this._register(Li.addTarget(this.el));const l=this._register(new xn(this.el,Ei.Start)).event;this._register(l(d=>this.onPointerStart(d,new HZ(this.el)),this));const c=this._register(new xn(this.el,Ei.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 n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=D0t,this._register(I0t.event(d=>{this.size=d,this.layout()}))),this._register(T0t.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.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",E0t),this.layout()}onPointerStart(e,t){gn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new WO(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new WO(t))),!this.state)return;const r=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of r)g.classList.add(tue);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=_c(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Dn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Dn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Fe;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{gn.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{gn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of r)p.classList.remove(tue)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Is.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Is.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Is.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const N0t={separatorBorder:Ce.transparent};class SSe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var n,r;if(e!==this.visible){e?(this.size=fa(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=(n=this.view).setVisible)===null||r===void 0||r.call(n,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(n){console.error("Splitview: Failed to layout view"),console.error(n)}}dispose(){this.disposable.dispose()}}class R0t extends SSe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class M0t extends SSe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Pg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(Pg||(Pg={}));var $O;(function(i){i.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}i.Split=e;function t(r){return{type:"auto",index:r}}i.Auto=t;function n(r){return{type:"invisible",cachedVisibleSize:r}}i.Invisible=n})($O||($O={}));class xSe extends me{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var n,r,o,s,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Pg.Idle,this._onDidSashChange=this._register(new ae),this._onDidSashReset=this._register(new ae),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Oe(this.el,Xe(".sash-container")),this.viewContainer=Xe(".split-view-container"),this.scrollable=this._register(new XS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>Ml(Bt(this.el),c)})),this.scrollableElement=this._register(new A3(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),Oe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||N0t),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=xl(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this._contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,r){this.doAddView(e,t,n,r)}layout(e,t){const n=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o0&&(s.size=fa(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=ua(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,o,s)}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:n}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=td(xe(this.el.ownerDocument.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),xe(this.el.ownerDocument.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const p=this.viewItems[r];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[r+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=ua(r,-1),p=ua(r+1,this.viewItems.length),m=g.reduce((k,T)=>k+(this.viewItems[T].minimumSize-c[T]),0),v=g.reduce((k,T)=>k+(this.viewItems[T].viewMaximumSize-c[T]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].viewMaximumSize),0),S=Math.max(m,y),L=Math.min(_,v),E=this.findFirstSnapIndex(g),D=this.findFirstSnapIndex(p);if(typeof E=="number"){const k=this.viewItems[E],T=Math.floor(k.viewMinimumSize/2);h={index:E,limitDelta:k.visible?S-T:S+T,size:k.size}}if(typeof D=="number"){const k=this.viewItems[D],T=Math.floor(k.viewMinimumSize/2);f={index:D,limitDelta:k.visible?L+T:L-T,size:k.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:o}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],m=p.size-p.maximumSize,v=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,m,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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=fa(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Pg.Idle)throw new Error("Cant modify splitview");this.state=Pg.Busy;try{const n=ua(this.viewItems.length).filter(a=>a!==e),r=[...n.filter(a=>this.viewItems[a].priority===1),e],o=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=fa(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o)}finally{this.state=Pg.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 n=Math.floor(t/e.length);for(const a of e)a.size=fa(n,a.minimumSize,a.maximumSize);const r=ua(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,r){if(this.state!==Pg.Idle)throw new Error("Cant modify splitview");this.state=Pg.Busy;try{const o=Xe(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=Ot(()=>this.viewContainer.removeChild(o)),l=td(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new R0t(o,e,c,l):new M0t(o,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Is(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new Is(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,orientation:0}),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),m=ot.map(f.onDidStart,g)(this.onSashStart,this),_=ot.map(f.onDidChange,g)(this.onSashChange,this),S=ot.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const k=this.sashItems.findIndex(R=>R.sash===f),T=ua(k,-1),M=ua(k+1,this.viewItems.length),P=this.findFirstSnapIndex(T),N=this.findFirstSnapIndex(M);typeof P=="number"&&!this.viewItems[P].visible||typeof N=="number"&&!this.viewItems[N].visible||this._onDidSashReset.fire(k)}),E=td(m,_,S,L,f),D={sash:f,disposable:E};this.sashItems.splice(n-1,0,D)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([n],d),!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Pg.Idle}}relayout(e,t){const n=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=ua(e,-1),d=ua(e+1,this.viewItems.length);if(o)for(const D of o)c9(u,D),c9(d,D);if(r)for(const D of r)AR(u,D),AR(d,D);const h=u.map(D=>this.viewItems[D]),f=u.map(D=>n[D]),g=d.map(D=>this.viewItems[D]),p=d.map(D=>n[D]),m=u.reduce((D,k)=>D+(this.viewItems[k].minimumSize-n[k]),0),v=u.reduce((D,k)=>D+(this.viewItems[k].maximumSize-n[k]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].maximumSize),0),S=Math.max(m,y,s),L=Math.min(_,v,a);let E=!1;if(l){const D=this.viewItems[l.index],k=t>=l.limitDelta;E=k!==D.visible,D.setVisible(k,l.size)}if(!E&&c){const D=this.viewItems[c.index],k=ta+l.size,0);let n=this.size-t;const r=ua(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)c9(r,a);for(const a of o)AR(r,a);typeof e=="number"&&AR(r,e);for(let a=0;n!==0&&at+n.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 n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class PT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=PT.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Oe(e,Xe(".monaco-table-tr")),n=[],r=[];for(let s=0;sthis.disposables.add(new A0t(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 xSe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new PT(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new Ec(e,this.domNode,P0t(n),[c],s)),ot.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=_c(this.domNode),this.style($_t)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { 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()}}r5.InstanceCount=0;class JS extends Lc{constructor(e){super(),this._onChange=this._register(new ae),this.onChange=this._onChange.event,this._onKeyDown=this._register(new ae),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(...Vt.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(LC(qp("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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const O0t=w("caseDescription","Match Case"),F0t=w("wordsDescription","Match Whole Word"),B0t=w("regexDescription","Use Regular Expression");class LSe extends JS{constructor(e){super({icon:tt.caseSensitive,title:O0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ESe extends JS{constructor(e){super({icon:tt.wholeWord,title:F0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class DSe extends JS{constructor(e){super({icon:tt.regex,title:B0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class W0t{constructor(e,t=0,n=e.length,r=t-1){this.items=e,this.start=t,this.end=n,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 $0t{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 W0t(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 pL=Xe;let H0t=class extends Lc{constructor(e,t,n){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new ae),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Oe(e,pL(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=Oe(this.element,pL(".ibwrapper"));if(this.input=Oe(s,pL(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Oe(s,pL("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Vye(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Oe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(e.ownerDocument,"selectionchange")),l=ot.filter(a.event,()=>{const c=e.ownerDocument.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new du(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:ep(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return pT(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&pc(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${bp(n.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=ha(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=Oe(r,pL(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Dmt(this.message.content,a):Emt(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Oe(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=w("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=w("alertWarningMessage","Warning: {0}",this.message.content):n=w("alertInfoMessage","Info: {0}",this.message.content),Pl(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,n;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(n=r.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${bp(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=ep(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,n=t.selectionStart,r=t.selectionEnd,o=t.value;n!==null&&r!==null&&(this.value=o.substr(0,n)+e+o.substr(r),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class ISe extends H0t{constructor(e,t,n){const r=w({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","⇅"),o=w({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,n),this._onDidFocus=this._register(new ae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event,this.history=new $0t(n.history,100);const s=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?r:o,l=this.placeholder+a;n.showPlaceholderOnFocus&&!pT(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||s()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>s()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return n.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||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??"",jf(this.value?this.value:w("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,jf(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 V0t=w("defaultLabel","input");class kSe extends Lc{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Vo),this.additionalToggles=[],this._onDidOptionChange=this._register(new ae),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new ae),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new ae),this._onKeyUp=this._register(new ae),this._onCaseSensitiveKeyDown=this._register(new ae),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new ae),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||V0t,this.showCommonFindToggles=!!n.showCommonFindToggles;const r=n.appendCaseSensitiveLabel||"",o=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ISe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new DSe({appendTitle:s,isChecked:!1,...n.toggleStyles})),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new ESe({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new LSe({appendTitle:r,isChecked:!1,...n.toggleStyles})),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),gn.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(xe(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(xe(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.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 Fe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var ec;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(ec||(ec={}));var J0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(J0||(J0={}));class lc extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class VZ{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 zZ(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function jI(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function L7(i){return typeof i.collapsible=="boolean"}class z0t{constructor(e,t,n,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new rY,this._onDidChangeCollapseState=new ae,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new ae,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new ae,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new ad(p1e),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=In.empty(),r={}){if(e.length===0)throw new lc(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,n,r):this.spliceSimple(e,t,n,r)}spliceSmart(e,t,n,r,o,s){var a;r===void 0&&(r=In.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,r,o);const c=[...r],u=t[t.length-1],d=new gf({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,o);const h=t.slice(0,-1),f=(m,v,_)=>{if(s>0)for(let y=0;y<_;y++)m--,v--,this.spliceSmart(e,[...h,m,0],Number.MAX_SAFE_INTEGER,c[v].children,o,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const m of d.changes.sort((v,_)=>_.originalStart-v.originalStart))f(g,p,g-(m.originalStart+m.originalLength)),g=m.originalStart,p=m.modifiedStart-u,this.spliceSimple([...h,g],m.originalLength,In.slice(c,p,p+m.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,n=In.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=In.map(n,L=>this.createTreeNode(L,a,a.visible?1:0,c,d,r)),f=e[e.length-1];let g=0;for(let L=f;L>=0&&Ls.getId(L.element).toString())):a.lastDiffIds=a.children.map(L=>s.getId(L.element).toString()):a.lastDiffIds=void 0;let y=0;for(const L of _)L.visible&&y++;if(y!==0)for(let L=f+p.length;LE+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-L),this.list.splice(l,L,d)}if(_.length>0&&o){const L=E=>{o(E),E.children.forEach(L)};_.forEach(L)}this._onDidSplice.fire({insertedNodes:p,deletedNodes:_});let S=a;for(;S;){if(S.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}S=S.parent}}rerender(e){if(e.length===0)throw new lc(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:r}=this.getTreeNodeWithListIndex(e);return n&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:n,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,r,o,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!L7(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,r){const o=this._setNodeCollapseState(e,r,!1);if(!n||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,n){let r;if(e===this.root?r=!1:(L7(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:n})),!L7(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,n,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,r&&o.push(a);const c=e.children||In.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,n,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,r&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):zZ(n)?(e.filterData=n.data,jI(n.visibility)):(e.filterData=void 0,jI(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...r]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(r,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...r]=e;if(n<0||n>t.children.length)throw new lc(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new lc(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new lc(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function E7(i){return i instanceof RT?new U0t(i):i}class j0t{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=me.None,this.disposables=new Fe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,E7(e),t)}onDragOver(e,t,n,r,o,s=!0){const a=this.dnd.onDragOver(E7(e),t&&t.element,n,r,o),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=Zv(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!s){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[n]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),m=f.getNode(p),v=p&&f.getListIndex(p);return this.onDragOver(e,m,v,r,o,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),h=c.getListRenderCount(u);return{...a,feedback:ua(d,d+h)}}drop(e,t,n,r,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(E7(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function K0t(i,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new j0t(i,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 n=i(),r=n.getNodeLocation(t),o=n.getParentNodeLocation(r);return n.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class UZ{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 n,r;(r=(n=this.delegate).setDynamicHeight)===null||r===void 0||r.call(n,e.element,t)}}var KI;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(KI||(KI={}));class G0t{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Fe,this.onDidChange=ot.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class GI{constructor(e,t,n,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=GI.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=me.None,this.disposables=new Fe,this.templateId=e.templateId,this.updateOptions(s),ot.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=fa(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,r]of this.renderedNodes)this.renderTreeElement(n,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==KI.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,r]of this.renderedNodes)this._renderIndentGuides(n,r);if(this.indentGuidesDisposable.dispose(),t){const n=new Fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Oe(e,Xe(".monaco-tl-row")),n=Oe(t,Xe(".monaco-tl-indent")),r=Oe(t,Xe(".monaco-tl-twistie")),o=Oe(t,Xe(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:n,twistie:r,indentGuidesDisposable:me.None,templateData:s}}renderElement(e,t,n,r){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,r)}disposeElement(e,t,n,r){var o,s;n.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,n.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 n=GI.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Vt.asClassNameArray(tt.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(...Vt.asClassNameArray(tt.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(Ps(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Fe,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=Xe(".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),n.add(Ot(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(r=>{const o=n.getNodeLocation(r);try{const s=n.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}GI.DefaultIndent=8;class q0t{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Fe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:zZ(s)?n=jI(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:ah.Default,visibility:n};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:ah.Default,visibility:n};let l;if(this.tree.findMatchType===Kb.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=Ub(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===hp.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:ah.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var hp;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(hp||(hp={}));var Kb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(Kb||(Kb={}));let X0t=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,n,r,o,s={}){var a,l;this.tree=e,this.view=n,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new ae,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new ae,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new ae,this._onDidChangeOpenState=new ae,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Fe,this.disposables=new Fe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:hp.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Kb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:w("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!ah.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Y0t(i,e){return i.position===e.position&&TSe(i,e)}function TSe(i,e){return i.node.element===e.node.element&&i.startIndex===e.startIndex&&i.height===e.height&&i.endIndex===e.endIndex}class Z0t{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return lr(this.stickyNodes,e.stickyNodes,Y0t)}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(!lr(this.stickyNodes,e.stickyNodes,TSe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],n=e.stickyNodes[e.count-1];return t.position!==n.position}}class Q0t{constrainStickyScrollNodes(e,t,n){for(let r=0;rn||r>=t)return e.slice(0,r)}return e}}let nue=class extends me{constructor(e,t,n,r,o,s={}){var a;super(),this.tree=e,this.model=t,this.view=n,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(s);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=s.stickyScrollDelegate)!==null&&a!==void 0?a:new Q0t,this._widget=this._register(new J0t(n.getScrollableElement(),n,e,r,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(n.onDidScroll(()=>this.update())),this._register(n.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}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 n=e,r=0,o=this.getNextStickyNode(n,void 0,r);for(;o&&(t.push(o),r+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(n=this.getNextVisibleNode(o),!n)));)o=this.getNextStickyNode(n,o.node,r);const s=this.constrainStickyNodes(t);return s.length?new Z0t(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,n){const r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,n))))return this.createStickyScrollNode(r,n)}nodeTopAlignsWithStickyNodesBottom(e,t){const n=this.getNodeIndex(e),r=this.view.getElementTop(n),o=t;return this.view.scrollTop===r-o}createStickyScrollNode(e,t){const n=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:o}=this.getNodeRange(e),s=this.calculateStickyNodePosition(o,t,n);return{node:e,position:s,height:n,startIndex:r,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let n=e,r=this.getParentNode(n);for(;r;){if(r===t)return n;n=r,r=this.getParentNode(n)}if(t===void 0)return n}calculateStickyNodePosition(e,t,n){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-n:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,n=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&n.position+n.height<=t)return e;const r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];const o=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return r}getParentNode(e){const t=this.model.getNodeLocation(e),n=this.model.getParentNodeLocation(t);return n?this.model.getNode(n):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),n=this.model.getListIndex(t);if(n<0)throw new Error("Node not found in tree");const r=this.model.getListRenderCount(t),o=n+r-1;return{startIndex:n,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let n=this.getParentNode(e);for(;n;)t.push(n),n=this.getParentNode(n);let r=0;for(let o=0;o0,n=!!e&&e.count>0;if(!t&&!n||t&&n&&this._previousState.equal(e))return;if(t!==n&&this.setVisible(n),!n){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 o=Array(e.count);for(let s=e.count-1;s>=0;s--){const a=e.stickyNodes[s],{element:l,disposable:c}=this.createElement(a,s,e.count);o[s]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,n){const r=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,o.style.height=`${e.height}px`,o.style.lineHeight=`${e.height}px`,o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${r}`),o.setAttribute("data-parity",r%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(r)),this.setAccessibilityAttributes(o,e.node.element,t,n);const s=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(d=>d.templateId===s);if(!a)throw new Error(`No renderer found for template id ${s}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const c=a.renderTemplate(o);a.renderElement(l,e.startIndex,c,e.height);const u=Ot(()=>{a.disposeElement(l,e.startIndex,c,e.height),a.disposeTemplate(c),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,n,r){var o;if(!this.accessibilityProvider)return;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,n,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,n))),this.accessibilityProvider.getRole&&e.setAttribute("role",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const s=this.accessibilityProvider.getAriaLabel(t);s&&e.setAttribute("aria-label",s);const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);typeof a=="number"&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1))}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 ebt extends me{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 ae,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new ae,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(n=>this.onKeyDown(n))),this._register(this.view.onMouseDown(n=>this.onMouseDown(n))),this._register(this.view.onContextMenu(n=>this.handleContextMenu(n)))}handleContextMenu(e){const t=e.browserEvent.target;if(!kO(t)&&!tD(t)){this.focusedLast()&&this.view.domFocus();return}if(!SY(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const s=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(s===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(s);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,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:r,anchor:o,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;!kO(t)&&!tD(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 n=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const r=fa(n,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),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=r?r.position+r.height+n.height:n.height;this.view.scrollTop=o-s}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){e.classList.toggle("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.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function iue(i){let e=J0.Unknown;return x9(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=J0.Twistie:x9(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=J0.Element:x9(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=J0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function nP(i,e){e(i),i.children.forEach(t=>nP(t,e))}class D7{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 ae,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&lr(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:n})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>nP(u,c)),this.set([...l.values()]);return}const n=new Set,r=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>nP(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>nP(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class tbt extends mSe{constructor(e,t,n){super(e),this.tree=t,this.stickyScrollProvider=n}onViewPointer(e){if(hSe(e.browserEvent.target)||Rv(e.browserEvent.target)||iE(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 n=e.browserEvent.target,r=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=tD(e.browserEvent.target);let s=!1;if(o?s=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?s=this.tree.expandOnlyOnTwistieClick(t.element):s=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||r)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s&&r){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(P_t(e.browserEvent.target)||A_t(e.browserEvent.target))return;const n=this.stickyScrollProvider();if(!n)throw new Error("Sticky scroll controller not found");const r=this.list.indexOf(t),o=this.list.getElementTop(r),s=n.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,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(!kO(t)&&!tD(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!kO(t)&&!tD(t)){super.onContextMenu(e);return}}}class nbt extends Ec{constructor(e,t,n,r,o,s,a,l){super(e,t,n,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new tbt(this,e.tree,e.stickyScrollProvider)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const r=[],o=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(Ap([...super.getFocus(),...r])),o.length>0&&super.setSelection(Ap([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||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 NSe{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 ot.filter(ot.map(this.view.onMouseDblClick,iue),e=>e.target!==J0.Filter)}get onPointer(){return ot.map(this.view.onPointer,iue)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ot.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:hp.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Kb.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,n,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new rY,this.onDidChangeFindOpenState=ot.None,this.onDidChangeStickyScrollFocused=ot.None,this.disposables=new Fe,this._onWillRefilter=new ae,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new ae,this.treeDelegate=new UZ(n);const a=new Fse,l=new Fse,c=this.disposables.add(new G0t(l.event)),u=new MY;this.renderers=r.map(p=>new GI(p,()=>this.model,a.event,c,u,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new q0t(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new D7(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new D7(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new D7(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new nbt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...K0t(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=ot.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const f=this.disposables.add(new ae),g=this.disposables.add(new ad(0));if(this.disposables.add(ot.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);f.fire([...p.values()])})})),l.input=f.event,o.keyboardSupport!==!1){const p=ot.chain(this.view.onKeyDown,m=>m.filter(v=>!Rv(v.target)).map(v=>new Oi(v)));ot.chain(p,m=>m.filter(v=>v.keyCode===15))(this.onLeftArrow,this,this.disposables),ot.chain(p,m=>m.filter(v=>v.keyCode===17))(this.onRightArrow,this,this.disposables),ot.chain(p,m=>m.filter(v=>v.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new X0t(this,this.model,this.view,d,o.contextViewProvider,p),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=ot.None,this.onDidChangeFindMatchType=ot.None;o.enableStickyScroll&&(this.stickyScrollController=new nue(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=_c(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===KI.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===KI.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new nue(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=ot.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||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}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),Kv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){var t;const n=`.${this.view.domId}`,r=[];e.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),e.listFocusForeground&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=bp(e.listFocusAndSelectionOutline,bp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));o&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=r.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 n=e.map(o=>this.model.getNode(o));this.selection.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.focus.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)})}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);if(n!==-1)if(!this.stickyScrollController)this.view.reveal(n,t);else{const r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(n,t,r)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){var e;si(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class jZ{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new z0t(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(r,o){return n.sorter.compare(r.element,o.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=In.empty(),n={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),n)}_setChildren(e,t=In.empty(),n){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...n,onDidCreateNode:s,onDidDeleteNode:a})}preserveCollapseState(e=In.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),In.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===ec.Collapsed||t.collapsed===ec.PreserveOrCollapsed?s=!0:t.collapsed===ec.Expanded||t.collapsed===ec.PreserveOrExpanded?s=!1:s=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:s}}const r=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===ec.PreserveOrCollapsed||t.collapsed===ec.PreserveOrExpanded?o=n.collapsed:t.collapsed===ec.Collapsed?o=!0:t.collapsed===ec.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:r,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,n)}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 lc(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new lc(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function iP(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:In.map(In.from(i.children),iP),collapsible:i.collapsible,collapsed:i.collapsed}}function rP(i){const e=[i.element],t=i.incompressible||!1;let n,r;for(;[r,n]=In.consume(In.from(i.children),2),!(r.length!==1||r[0].incompressible);)i=r[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:In.map(In.concat(r,n),rP),collapsible:i.collapsible,collapsed:i.collapsed}}function OU(i,e=0){let t;return eOU(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function rue(i){return OU(i,0)}function RSe(i,e,t){return i.element===e?{...i,children:t}:{...i,children:In.map(In.from(i.children),n=>RSe(n,e,t))}}const ibt=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class rbt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new jZ(e,t,n),this.enabled=typeof n.compressionEnabled>"u"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=In.empty(),n){const r=n.diffIdentityProvider&&ibt(n.diffIdentityProvider);if(e===null){const g=In.map(t,this.enabled?rP:iP);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new lc(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=rue(s),u=RSe(c,e,t),d=(this.enabled?rP:iP)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(lr(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||In.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,r=In.map(n,rue),o=In.map(r,e?rP:iP);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...n,onDidCreateNode:o,onDidDeleteNode:s})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);return t}}const obt=i=>i[i.length-1];class KZ{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new KZ(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 sbt(i,e){return{splice(t,n,r){e.splice(t,n,r.map(o=>i.map(o)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function abt(i,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}}}class lbt{get onDidSplice(){return ot.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return ot.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ot.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||obt;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new VZ(o=>new KZ(r,o)),this.model=new rbt(e,sbt(this.nodeMapper,t),abt(r,n))}setChildren(e,t=In.empty(),n={}){this.model.setChildren(e,t,n)}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,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var cbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class GZ extends NSe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,r,o={}){super(e,t,n,r,o),this.user=e}setChildren(e,t=In.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new jZ(e,t,n)}}class MSe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,n){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,r)):(n.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,n.data,r))}disposeElement(e,t,n,r){var o,s,a,l;n.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,n.compressedTreeNode,t,n.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}cbt([Ar],MSe.prototype,"compressedTreeNodeProvider",null);class ubt{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,n){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;rn||r>=t-1&&tthis,a=new ubt(()=>this.model),l=r.map(c=>new MSe(s,a,c));super(e,t,n,l,{...dbt(s,o),stickyScrollDelegate:a})}setChildren(e,t=In.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new lbt(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function I7(i){return{...i,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function FU(i,e){return e.parent?e.parent===i?!0:FU(i,e.parent):!1}function hbt(i,e){return i===e||FU(i,e)||FU(e,i)}class qZ{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new qZ(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 fbt{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Vt.asClassNameArray(tt.treeItemLoading)),!0):(t.classList.remove(...Vt.asClassNameArray(tt.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function oue(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function sue(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class gbt extends RT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function k7(i){return i instanceof RT?new gbt(i):i}class pbt{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(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,k7(e),t)}onDragOver(e,t,n,r,o,s=!0){return this.dnd.onDragOver(k7(e),t&&t.element,n,r,o)}drop(e,t,n,r,o){this.dnd.drop(k7(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function ASe(i){return i&&{...i,collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new pbt(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:i.accessibilityProvider&&{...i.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))},filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&{...i.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick>"u"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility>"u"?2:i.defaultFindVisibility(e.element)}}function BU(i,e){e(i),i.children.forEach(t=>BU(t,e))}class OSe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ot.map(this.tree.onDidChangeFocus,oue)}get onDidChangeSelection(){return ot.map(this.tree.onDidChangeSelection,oue)}get onMouseDblClick(){return ot.map(this.tree.onMouseDblClick,sue)}get onPointer(){return ot.map(this.tree.onPointer,sue)}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,n,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new ae,this._onDidChangeNodeSlowState=new ae,this.nodeMapper=new VZ(a=>new qZ(a)),this.disposables=new Fe,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=a=>s.collapseByDefault?s.collapseByDefault(a)?ec.PreserveOrCollapsed:ec.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,n,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=I7({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,n,r,o){const s=new UZ(n),a=r.map(c=>new fbt(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=ASe(o)||{};return new GZ(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,n=!1,r,o){if(typeof this.root.element>"u")throw new lc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,r,o),n)try{this.tree.rerender(s)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new lc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const r=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event)),r}setSelection(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setFocus(n,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),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new lc(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,n,r){await this.refreshNode(e,t,n),!this.disposables.isDisposed&&this.render(e,n,r)}async refreshNode(e,t,n){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&hbt(s,e)&&(r=o.then(()=>this.refreshNode(e,t,n)))}),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,n);return}return this.doRefreshSubTree(e,t,n)}async doRefreshSubTree(e,t,n){let r;e.refreshPromise=new Promise(o=>r=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,n);e.stale=!1,await ez.settled(o.map(s=>this.doRefreshSubTree(s,t,n)))}finally{r()}}async doRefreshNode(e,t,n){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(In.empty());else{const o=this.doGetChildren(e);if(Nse(o))r=Promise.resolve(o);else{const s=Yv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=await r;return this.setChildren(e,o,t,n)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Th(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const n=this.dataSource.getChildren(e.element);return Nse(n)?this.processChildren(n):(t=No(async()=>this.processChildren(await n)),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(nn))}setChildren(e,t,n,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)s.set(u.element,u),this.identityProvider&&a.set(u.id,{node:u,collapsed:this.tree.hasElement(u)&&this.tree.isCollapsed(u)});const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=I7({element:u,parent:e,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return d&&p.defaultCollapseState===ec.PreserveOrExpanded&&l.push(p),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(m=>BU(m,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&!f.collapsed&&l.push(p),p}const g=I7({element:u,parent:e,id:h,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1||d&&g.defaultCollapseState===ec.PreserveOrExpanded)&&l.push(g),g});for(const u of s.values())BU(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,n){const r=e.children.map(s=>this.asTreeElement(s,t)),o=n&&{...n,diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}};this.tree.setChildren(e===this.root?null:e,r,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:e.forceExpanded?(n=!1,e.forceExpanded=!1):n=e.defaultCollapseState,{element:e,children:e.hasChildren?In.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class XZ{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 XZ(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 mbt{constructor(e,t,n,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderCompressedElements(e,t,n,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Vt.asClassNameArray(tt.treeItemLoading)),!0):(t.classList.remove(...Vt.asClassNameArray(tt.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeCompressedElements(e,t,n,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function vbt(i){const e=i&&ASe(i);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}}}}class _bt extends OSe{constructor(e,t,n,r,o,s,a={}){super(e,t,n,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new VZ(l=>new XZ(l)),this.filter=a.filter}createTree(e,t,n,r,o){const s=new UZ(n),a=r.map(c=>new mbt(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=vbt(o)||{};return new PSe(e,t,s,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,n){if(!this.identityProvider)return super.render(e,t);const r=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const m=this.tree.getCompressedTreeNode(p===this.root?null:p);if(m.element)for(const v of m.element.elements)g.add(r(v.element))}return g},s=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,n);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const h=f=>{const g=f.element;if(g)for(let p=0;p{const n=this.filter.filter(t,1),r=bbt(n);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function bbt(i){return typeof i=="boolean"?i?1:0:zZ(i)?jI(i.visibility):jI(i)}class Cbt extends NSe{constructor(e,t,n,r,o,s={}){super(e,t,n,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,n){return new jZ(e,t,n)}}new ct("isMac",Dn,w("isMac","Whether the operating system is macOS"));new ct("isLinux",ka,w("isLinux","Whether the operating system is Linux"));const o5=new ct("isWindows",Os,w("isWindows","Whether the operating system is Windows")),FSe=new ct("isWeb",I_,w("isWeb","Whether the platform is a web browser"));new ct("isMacNative",Dn&&!I_,w("isMacNative","Whether the operating system is macOS on a non-browser platform"));new ct("isIOS",fh,w("isIOS","Whether the operating system is iOS"));new ct("isMobile",OCe,w("isMobile","Whether the platform is a mobile web browser"));new ct("isDevelopment",!1,!0);new ct("productQualityType","",w("productQualityType","Quality type of VS Code"));const BSe="inputFocus",ybt=new ct(BSe,!1,w("inputFocus","Whether keyboard focus is inside an input box"));var Yp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Cu=Sn("listService");class wbt{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Fe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new vSe(_c(),"").style(O_)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),pT(e.getHTMLElement())&&this.setLastFocusedList(e),td(e.onDidFocus(()=>this.setLastFocusedList(e)),Ot(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const qI=new ct("listScrollAtBoundary","none");Re.or(qI.isEqualTo("top"),qI.isEqualTo("both"));Re.or(qI.isEqualTo("bottom"),qI.isEqualTo("both"));const WSe=new ct("listFocus",!0),$Se=new ct("treestickyScrollFocused",!1),s5=new ct("listSupportsMultiselect",!0),HSe=Re.and(WSe,Re.not(BSe),$Se.negate()),YZ=new ct("listHasSelectionOrFocus",!1),ZZ=new ct("listDoubleSelection",!1),QZ=new ct("listMultiSelection",!1),a5=new ct("listSelectionNavigation",!1),Sbt=new ct("listSupportsFind",!0),JZ=new ct("treeElementCanCollapse",!1),xbt=new ct("treeElementHasParent",!1),eQ=new ct("treeElementCanExpand",!1),Lbt=new ct("treeElementHasChild",!1),Ebt=new ct("treeFindOpen",!1),VSe="listTypeNavigationMode",zSe="listAutomaticKeyboardNavigation";function l5(i,e){const t=i.createScoped(e.getHTMLElement());return WSe.bindTo(t),t}function c5(i,e){const t=qI.bindTo(i),n=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const EC="workbench.list.multiSelectModifier",oP="workbench.list.openMode",ou="workbench.list.horizontalScrolling",tQ="workbench.list.defaultFindMode",nQ="workbench.list.typeNavigationMode",HO="workbench.list.keyboardNavigation",bh="workbench.list.scrollByPage",iQ="workbench.list.defaultFindMatchType",XI="workbench.tree.indent",VO="workbench.tree.renderIndentGuides",Ch="workbench.list.smoothScrolling",Xf="workbench.list.mouseWheelScrollSensitivity",Yf="workbench.list.fastScrollSensitivity",zO="workbench.tree.expandMode",UO="workbench.tree.enableStickyScroll",jO="workbench.tree.stickyScrollMaxItemCount";function Zf(i){return i.getValue(EC)==="alt"}class Dbt extends me{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Zf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(EC)&&(this.useAltAsMultipleSelectionModifier=Zf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:gSe(e)}isSelectionRangeChangeEvent(e){return pSe(e)}}function u5(i,e){var t;const n=i.get(mn),r=i.get(ci),o=new Fe;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!n.getValue(Ch),mouseWheelScrollSensitivity:n.getValue(Xf),fastScrollSensitivity:n.getValue(Yf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new Dbt(n)),keyboardNavigationEventFilter:Tbt(r),scrollByPage:!!n.getValue(bh)},o]}let WU=class extends Ec{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(ou),[d,h]=c.invokeFunction(u5,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(h),this.contextKeyService=l5(s,this),this.disposables.add(c5(this.contextKeyService,this)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.listDoubleSelection=ZZ.bindTo(this.contextKeyService),this.listMultiSelection=QZ.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Zf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(l));let p={};if(g.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const m=!!l.getValue(ou);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(bh)){const m=!!l.getValue(bh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(Ch)){const m=!!l.getValue(Ch);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Xf)){const m=l.getValue(Xf);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Yf)){const m=l.getValue(Yf);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new USe(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):O_)}};WU=Yp([Fi(5,Gt),Fi(6,Cu),Fi(7,mn),Fi(8,Wt)],WU);let aue=class extends L0t{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(ou),[d,h]=c.invokeFunction(u5,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables=new Fe,this.disposables.add(h),this.contextKeyService=l5(s,this),this.disposables.add(c5(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Zf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(l));let p={};if(g.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const m=!!l.getValue(ou);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(bh)){const m=!!l.getValue(bh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(Ch)){const m=!!l.getValue(Ch);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Xf)){const m=l.getValue(Xf);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Yf)){const m=l.getValue(Yf);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new USe(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):O_)}dispose(){this.disposables.dispose(),super.dispose()}};aue=Yp([Fi(5,Gt),Fi(6,Cu),Fi(7,mn),Fi(8,Wt)],aue);let lue=class extends r5{constructor(e,t,n,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(ou),[h,f]=u.invokeFunction(u5,s);super(e,t,n,r,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(f),this.contextKeyService=l5(a,this),this.disposables.add(c5(this.contextKeyService,this)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.listDoubleSelection=ZZ.bindTo(this.contextKeyService),this.listMultiSelection=QZ.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Zf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(c));let m={};if(p.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const v=!!c.getValue(ou);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(bh)){const v=!!c.getValue(bh);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Ch)){const v=!!c.getValue(Ch);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xf)){const v=c.getValue(Xf);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Yf)){const v=c.getValue(Yf);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new Ibt(this,{configurationService:c,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):O_)}dispose(){this.disposables.dispose(),super.dispose()}};lue=Yp([Fi(6,Gt),Fi(7,Cu),Fi(8,mn),Fi(9,Wt)],lue);class rQ extends me{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new ae),this.onDidOpen=this._onDidOpen.event,this._register(ot.filter(this.widget.onDidChangeSelection,r=>SY(r.browserEvent))(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oP))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(oP)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oP))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!n,o=!1;this._open(this.getSelectedElement(),n,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,n,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class USe extends rQ{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Ibt extends rQ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class kbt extends rQ{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Tbt(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let cue=class extends GZ{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(AT,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Gb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};cue=Yp([Fi(5,Wt),Fi(6,Gt),Fi(7,Cu),Fi(8,mn)],cue);let uue=class extends PSe{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(AT,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Gb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};uue=Yp([Fi(5,Wt),Fi(6,Gt),Fi(7,Cu),Fi(8,mn)],uue);let due=class extends Cbt{constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(AT,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Gb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};due=Yp([Fi(6,Wt),Fi(7,Gt),Fi(8,Cu),Fi(9,mn)],due);let $U=class extends OSe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(AT,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Gb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};$U=Yp([Fi(6,Wt),Fi(7,Gt),Fi(8,Cu),Fi(9,mn)],$U);let hue=class extends _bt{constructor(e,t,n,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(AT,a);super(e,t,n,r,o,s,h),this.disposables.add(g),this.internals=new Gb(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};hue=Yp([Fi(7,Wt),Fi(8,Gt),Fi(9,Cu),Fi(10,mn)],hue);function jSe(i){const e=i.getValue(tQ);if(e==="highlight")return hp.Highlight;if(e==="filter")return hp.Filter;const t=i.getValue(HO);if(t==="simple"||t==="highlight")return hp.Highlight;if(t==="filter")return hp.Filter}function KSe(i){const e=i.getValue(iQ);if(e==="fuzzy")return Kb.Fuzzy;if(e==="contiguous")return Kb.Contiguous}function AT(i,e){var t;const n=i.get(mn),r=i.get(og),o=i.get(Gt),s=i.get(Wt),a=()=>{const f=o.getContextKeyValue(VSe);if(f==="automatic")return _f.Automatic;if(f==="trigger"||o.getContextKeyValue(zSe)===!1)return _f.Trigger;const p=n.getValue(nQ);if(p==="automatic")return _f.Automatic;if(p==="trigger")return _f.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!n.getValue(ou),[c,u]=s.invokeFunction(u5,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(VO);return{getTypeNavigationMode:a,disposable:u,options:{keyboardSupport:!1,...c,indent:typeof n.getValue(XI)=="number"?n.getValue(XI):void 0,renderIndentGuides:h,smoothScrolling:!!n.getValue(Ch),defaultFindMode:jSe(n),defaultFindMatchType:KSe(n),horizontalScrolling:l,scrollByPage:!!n.getValue(bh),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(zO)==="doubleClick",contextViewProvider:r,findWidgetStyles:s0t,enableStickyScroll:!!n.getValue(UO),stickyScrollMaxItemCount:Number(n.getValue(jO))}}}let Gb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=l5(o,e),this.disposables.push(c5(this.contextKeyService,e)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Sbt.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.hasDoubleSelection=ZZ.bindTo(this.contextKeyService),this.hasMultiSelection=QZ.bindTo(this.contextKeyService),this.treeElementCanCollapse=JZ.bindTo(this.contextKeyService),this.treeElementHasParent=xbt.bindTo(this.contextKeyService),this.treeElementCanExpand=eQ.bindTo(this.contextKeyService),this.treeElementHasChild=Lbt.bindTo(this.contextKeyService),this.treeFindOpen=Ebt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=$Se.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Zf(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(VSe),d.add(zSe),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(a)),h.affectsConfiguration(XI)){const g=a.getValue(XI);f={...f,indent:g}}if(h.affectsConfiguration(VO)&&t.renderIndentGuides===void 0){const g=a.getValue(VO);f={...f,renderIndentGuides:g}}if(h.affectsConfiguration(Ch)){const g=!!a.getValue(Ch);f={...f,smoothScrolling:g}}if(h.affectsConfiguration(tQ)||h.affectsConfiguration(HO)){const g=jSe(a);f={...f,defaultFindMode:g}}if(h.affectsConfiguration(nQ)||h.affectsConfiguration(HO)){const g=n();f={...f,typeNavigationMode:g}}if(h.affectsConfiguration(iQ)){const g=KSe(a);f={...f,defaultFindMatchType:g}}if(h.affectsConfiguration(ou)&&t.horizontalScrolling===void 0){const g=!!a.getValue(ou);f={...f,horizontalScrolling:g}}if(h.affectsConfiguration(bh)){const g=!!a.getValue(bh);f={...f,scrollByPage:g}}if(h.affectsConfiguration(zO)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(zO)==="doubleClick"}),h.affectsConfiguration(UO)){const g=a.getValue(UO);f={...f,enableStickyScroll:g}}if(h.affectsConfiguration(jO)){const g=Math.max(1,a.getValue(jO));f={...f,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(Xf)){const g=a.getValue(Xf);f={...f,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Yf)){const g=a.getValue(Yf);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new kbt(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?ZS(e):O_)}dispose(){this.disposables=si(this.disposables)}};Gb=Yp([Fi(4,Gt),Fi(5,Cu),Fi(6,mn)],Gb);const Nbt=ur.as(Rh.Configuration);Nbt.registerConfiguration({id:"workbench",order:7,title:w("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[EC]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[w("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:w({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.")},[oP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w({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.")},[ou]:{type:"boolean",default:!1,description:w("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[bh]:{type:"boolean",default:!1,description:w("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[XI]:{type:"number",default:8,minimum:4,maximum:40,description:w("tree indent setting","Controls tree indentation in pixels.")},[VO]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:w("render tree indent guides","Controls whether the tree should render indent guides.")},[Ch]:{type:"boolean",default:!1,description:w("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Xf]:{type:"number",default:1,markdownDescription:w("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Yf]:{type:"number",default:5,markdownDescription:w("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[tQ]:{type:"string",enum:["highlight","filter"],enumDescriptions:[w("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),w("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:w("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[HO]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[w("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),w("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),w("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:w("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:w("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[iQ]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[w("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),w("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:w("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[zO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w("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.")},[UO]:{type:"boolean",default:!0,description:w("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[jO]:{type:"number",minimum:1,default:7,markdownDescription:w("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[nQ]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:w("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var HU;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(HU||(HU={}));const DC={Quickaccess:"workbench.contributions.quickaccess"};class Rbt{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,n)=>n.prefix.length-t.prefix.length),Ot(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return hh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}ur.add(DC.Quickaccess,new Rbt);const Mbt={ctrlCmd:!1,alt:!1};var YI;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(YI||(YI={}));var Od;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(Od||(Od={}));const Ph=Sn("quickInputService");var Pbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let VU=class extends me{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ur.as(DC.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===HU.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Fe,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||n!=null&&n.quickNavigateConfiguration)&&(u.itemActivation=(r=n==null?void 0:n.itemActivation)!==null&&r!==void 0?r:Od.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new s3,c.add(ot.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,n==null?void 0:n.providerOptions));const h=c.add(new xr);if(o&&c.add(o.provide(u,h.token,n==null?void 0:n.providerOptions)),ot.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var r;let o;n!=null&&n.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,n,r,o){const s=new Fe,a=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return s.add(Ot(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};VU=Pbt([fue(0,Ph),fue(1,Wt)],VU);class Mv{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Oe(e,Xe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",r){e||(e=""),r&&(e=Mv.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&pc(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{r=o===`\r -`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return n+=r,"⏎"})}}class mL{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class KO extends me{constructor(e,t){var n;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new mL(Oe(e,Xe(".monaco-icon-label")))),this.labelContainer=Oe(this.domNode.element,Xe(".monaco-icon-label-container")),this.nameContainer=Oe(this.labelContainer,Xe("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new Fbt(this.nameContainer,!!t.supportIcons):this.nameNode=new Abt(this.nameContainer),this.hoverDelegate=(n=t==null?void 0:t.hoverDelegate)!==null&&n!==void 0?n:qp("mouse")}get element(){return this.domNode.element}setLabel(e,t,n){var r;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let a="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&s.push("disabled"),n.title&&(typeof n.title=="string"?a+=n.title:a+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=s.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Mv?(l.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(l.element,n==null?void 0:n.descriptionTitle)):(l.textContent=t&&(n!=null&&n.labelEscapeNewLines)?Mv.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(n==null?void 0:n.descriptionTitle)||""),l.empty=!t)}if(n!=null&&n.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(r=n==null?void 0:n.suffix)!==null&&r!==void 0?r:""}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)C_t(e,t);else{const r=LC(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 mL(Rot(this.nameContainer,Xe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new mL(Oe(e.element,Xe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new mL(Oe(this.labelContainer,Xe("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Mv(Oe(t.element,Xe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new mL(Oe(t.element,Xe("span.label-description"))))}return this.descriptionNode}}class Abt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&pc(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=Oe(this.container,Xe("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 n=0;n{const o={start:n,end:n+r.length},s=t.map(a=>Es.intersect(o,a)).filter(a=>!Es.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=o.end+e.length,s})}class Fbt{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&pc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Mv(Oe(this.container,Xe("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 n=(t==null?void 0:t.separator)||"/",r=Obt(e,n,t==null?void 0:t.matches);for(let o=0;o{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});function Bbt(i,e,t=!1){const n=i||"",r=e||"",o=gue.value.collator.compare(n,r);return gue.value.collatorIsNumeric&&o===0&&n!==r?nr.length)return 1}return 0}var Hbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class qSe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Hbt([Ar],qSe.prototype,"toString",null);const Vbt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function zbt(i){const e=[];let t=0,n;for(;n=Vbt.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,r,o,,s]=n;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=n.index+n[0].length}return t{kot(f)&&gn.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new xn(a,Je.CLICK)).event,u=t.disposables.add(new xn(a,Je.KEY_DOWN)).event,d=ot.chain(u,f=>f.filter(g=>{const p=new Oi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Li.addTarget(a));const h=t.disposables.add(new xn(a,Ei.Tap)).event;ot.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var XSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const Id=Xe;class Gbt{constructor(e,t,n,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=n,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?ot.map(ot.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):ot.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new tg(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=nE(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>nvt(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class OT{constructor(e,t){this.themeService=e,this.hoverDelegate=t}get templateId(){return OT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Oe(e,Id(".quick-input-list-entry"));const n=Oe(t.entry,Id("label.quick-input-list-label"));t.toDisposeTemplate.push(Lr(n,Je.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Oe(n,Id("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Lr(t.checkbox,Je.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=Oe(n,Id(".quick-input-list-rows")),o=Oe(r,Id(".quick-input-list-row")),s=Oe(r,Id(".quick-input-list-row"));t.label=new KO(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.label),t.icon=xY(t.label.element,Id(".quick-input-list-icon"));const a=Oe(o,Id(".quick-input-list-entry-keybinding"));t.keybinding=new ex(a,Ll);const l=Oe(s,Id(".quick-input-list-label-meta"));return t.detail=new KO(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.detail),t.separator=Oe(t.entry,Id(".quick-input-list-separator")),t.actionBar=new du(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var r,o,s,a;n.element=e,e.element=(r=n.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(p=>n.checkbox.checked=p));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const p=tS(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,m=Ft.revive(p);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Qv(m)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";let h;!e.saneTooltip&&e.saneDescription&&(h={markdown:{value:e.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDescription});const f={matches:c||[],descriptionTitle:h,descriptionMatches:u||[],labelEscapeNewLines:!0};if(l.type!=="separator"?(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,f),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail){let p;e.saneTooltip||(p={markdown:{value:e.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDetail}),n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:p,labelEscapeNewLines:!0})}else n.detail.element.style.display="none";e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=l.buttons;g&&g.length?(n.actionBar.push(g.map((p,m)=>zU(p,`id-${m}`,()=>l.type!=="separator"?e.fireButtonTriggered({button:p,item:l}):e.fireSeparatorButtonTriggered({button:p,separator:l}))),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}OT.ID="listelement";class qbt{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return OT.ID}}var Bo;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Bo||(Bo={}));class oQ{constructor(e,t,n,r){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new ae,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new ae,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new ae,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new ae,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new ae,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new ae,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new ae,this.onKeyDown=this._onKeyDown.event,this._onLeave=new ae,this.onLeave=this._onLeave.event,this._listElementChecked=new ae,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Oe(this.parent,Id(".quick-input-list"));const o=new qbt,s=new Zbt;this.list=n.createList("QuickInput",this.container,o,[new OT(r,n.hoverDelegate)],{identityProvider:{getId:l=>{var c,u,d,h,f,g,p,m;return(m=(g=(h=(u=(c=l.item)===null||c===void 0?void 0:c.id)!==null&&u!==void 0?u:(d=l.item)===null||d===void 0?void 0:d.label)!==null&&h!==void 0?h:(f=l.separator)===null||f===void 0?void 0:f.id)!==null&&g!==void 0?g:(p=l.separator)===null||p===void 0?void 0:p.label)!==null&&m!==void 0?m:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(l=>{const c=new Oi(l);switch(c.keyCode){case 10:this.toggleCheckbox();break;case 31:(Dn?l.metaKey:l.ctrlKey)&&this.list.setFocus(ua(this.list.length));break;case 16:{const u=this.list.getFocus();u.length===1&&u[0]===0&&this._onLeave.fire();break}case 18:{const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(c)})),this.disposables.push(this.list.onMouseDown(l=>{l.browserEvent.button!==2&&l.browserEvent.preventDefault()})),this.disposables.push(xe(this.container,Je.CLICK,l=>{(l.x||l.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(l=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(l=>{typeof l.index=="number"&&(l.browserEvent.preventDefault(),this.list.setSelection([l.index]))}));const a=new m1e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(async l=>{var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&ts(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{await a.trigger(async()=>{l.element&&this.showHover(l.element)})}catch(u){if(!Th(u))throw u}})),this.disposables.push(this.list.onMouseOut(l=>{var c;ts(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a),this.disposables.push(this._listElementChecked.event(l=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return ot.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return ot.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,r=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new Gbt(a,u,l,o,t,n,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Bo.Second&&this.list.length<2&&(e=Bo.First),e){case Bo.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Bo.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Bo.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Bo.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Bo.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Bo.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Bo.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,r;this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=_7(e,nE(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Xbt(t,nE(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=_7(e,nE(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=_7(e,nE(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const n=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();n.sort((o,s)=>Ybt(o,s,r))}return this.elementsToIndexes=n.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Fe;n.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}XSe([Ar],oQ.prototype,"onDidChangeFocus",null);XSe([Ar],oQ.prototype,"onDidChangeSelection",null);function Xbt(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return pue(i,t);const r=uT(t," "),o=t.length-r.length,s=pue(i,r);if(s)for(const a of s){const l=n[a.start+o]+o;a.start+=l,a.end+=l}return s}function pue(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function Ybt(i,e,t){const n=i.labelHighlights||[],r=e.labelHighlights||[];return n.length&&!r.length?-1:!n.length&&r.length?1:n.length===0&&r.length===0?0:Wbt(i.saneSortLabel,e.saneSortLabel,t)}class Zbt{getWidgetAriaLabel(){return w("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Qbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UU={iconClass:Vt.asClassName(tt.quickInputBack),tooltip:w("quickInput.back","Back"),handle:-1};class FT extends me{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=FT.noPromptMessage,this._severity=Rr.Ignore,this.onDidTriggerButtonEmitter=this._register(new ae),this.onDidHideEmitter=this._register(new ae),this.onDisposeEmitter=this._register(new ae),this.visibleDisposables=this._register(new Fe),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&&!fh;this._ignoreFocusOut=e&&!fh,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=YI.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ms(this.ui.widget,this._widget):ms(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new gd,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(l=>l===UU).map((l,c)=>zU(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==UU).map((l,c)=>zU(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof JS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ms(this.ui.message),Kbt(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?w("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Rr.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()}}FT.noPromptMessage=w("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ZI extends FT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new ae),this.onWillAcceptEmitter=this._register(new ae),this.onDidAcceptEmitter=this._register(new ae),this.onDidCustomEmitter=this._register(new ae),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=Od.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new ae),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new ae),this.onDidTriggerItemButtonEmitter=this._register(new ae),this.onDidTriggerSeparatorButtonEmitter=this._register(new ae),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get 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?Mbt:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Bo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Bo.Next),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Bo.Previous):this.ui.list.focus(Bo.Last),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 12:this.ui.list.focus(Bo.NextPage),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 11:this.ui.list.focus(Bo.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Bo.First),gn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Bo.Last),gn.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&lr(e,this._activeItems,(t,n)=>t===n)||(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&&lr(e,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(wY(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&lr(e,this._selectedItems,(t,n)=>t===n)||(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 xe(this.ui.container,Je.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Oi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===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,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let r=this.ariaLabel;if(!r&&n.inputBox&&(r=this.placeholder||ZI.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Od.NONE:this._itemActivation=Od.FIRST;break;case Od.SECOND:this.ui.list.focus(Bo.Second),this._itemActivation=Od.FIRST;break;case Od.LAST:this.ui.list.focus(Bo.Last),this._itemActivation=Od.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Bo.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ZI.DEFAULT_ARIA_LABEL=w("quickInputBox.ariaLabel","Type to narrow down results.");class Jbt extends FT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new ae),this.onDidAcceptEmitter=this._register(new ae),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}let jU=class extends yO{constructor(e,t){super("element",!1,n=>this.getOverrideOptions(n),e,t)}getOverrideOptions(e){var t;const n=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:n,skipFadeInAnimation:!0}}}};jU=Qbt([mue(0,mn),mue(1,SZ)],jU);Ce.white.toString(),Ce.white.toString();class GO extends me{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new ae),this._onDidEscape=this._register(new ae),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=n||"",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.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Li.addTarget(this._element)),[Je.CLICK,Ei.Tap].forEach(o=>{this._register(xe(this._element,o,s=>{if(!this.enabled){gn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(xe(this._element,Je.KEY_DOWN,o=>{const s=new Oi(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&gn.stop(s,!0)})),this._register(xe(this._element,Je.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(xe(this._element,Je.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(ph(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 n of Tv(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const r=document.createElement("span");r.textContent=n,t.push(r)}else t.push(n);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Bf(this._label)&&Bf(e)&&ivt(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Bf(e)){const o=X3(e,{inline:!0});o.dispose();const s=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(s){const a=S1e(s,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=a}else ms(n)}else this.options.supportIcons?ms(n,...this.getContentElements(e)):n.textContent=e;let r="";typeof this.options.title=="string"?r=this.options.title:this.options.title&&(r=dvt(e)),this._hover?this._hover.update(r):this._hover=this._register(LC(qp("mouse"),this._element,r)),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",this._element.title),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Vt.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")}}class KU{constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Oe(e,Xe(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Ob(this.countFormat,this.count),this.element.title=Ob(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const vue="done",_ue="active",N7="infinite",R7="infinite-long-running",bue="discrete";class d5 extends me{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new mi(()=>Sl(this.element),0)),this.longRunningScheduler=this._register(new mi(()=>this.infiniteLongRunning(),d5.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(_ue,N7,R7,bue),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(vue),this.element.classList.contains(N7)?(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(bue,vue,R7),this.element.classList.add(_ue,N7),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(R7)}getContainer(){return this.element}}d5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const eCt=Xe;class tCt extends me{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=o=>Lr(this.findInput.inputBox.inputElement,Je.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=Oe(this.parent,eCt(".quick-input-box")),this.findInput=this._register(new kSe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Rr.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Rr.Info?1:e===Rr.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Rr.Info?1:e===Rr.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const bl=Xe;class h5 extends me{get container(){return this._container}constructor(e,t,n){super(),this.options=e,this.themeService=t,this.layoutService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new ae),this.onDidCustomEmitter=this._register(new ae),this.onDidTriggerButtonEmitter=this._register(new ae),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new ae),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new ae),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(ot.runAndSubscribe(u3,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:hi,disposables:this._store})),this._register(pot(r=>{this.ui&&Bt(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const n=r=>{this.keyMods.ctrlCmd=r.ctrlKey||r.metaKey,this.keyMods.alt=r.altKey};for(const r of[Je.KEY_DOWN,Je.KEY_UP,Je.MOUSE_DOWN])t.add(xe(e,r,n,!0))}getUI(e){if(this.ui)return e&&Bt(this._container)!==Bt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Oe(this._container,bl(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const n=_c(t),r=Oe(t,bl(".quick-input-titlebar")),o=this._register(new du(r,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=Oe(r,bl(".quick-input-title")),a=this._register(new du(r,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Oe(t,bl(".quick-input-header")),c=Oe(l,bl("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",w("quickInput.checkAll","Toggle all checkboxes")),this._register(Lr(c,Je.CHANGE,R=>{const O=c.checked;P.setAllVisibleChecked(O)})),this._register(xe(c,Je.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const u=Oe(l,bl(".quick-input-description")),d=Oe(l,bl(".quick-input-and-message")),h=Oe(d,bl(".quick-input-filter")),f=this._register(new tCt(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Oe(h,bl(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new KU(g,{countFormat:w({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),m=Oe(h,bl(".quick-input-count"));m.setAttribute("aria-live","polite");const v=new KU(m,{countFormat:w({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),_=Oe(l,bl(".quick-input-action")),y=this._register(new GO(_,this.styles.button));y.label=w("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const S=Oe(l,bl(".quick-input-action")),L=this._register(new GO(S,{...this.styles.button,supportIcons:!0}));L.label=w("custom","Custom"),this._register(L.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const E=Oe(d,bl(`#${this.idPrefix}message.quick-input-message`)),D=this._register(new d5(t,this.styles.progressBar));D.getContainer().classList.add("quick-input-progress");const k=Oe(t,bl(".quick-input-html-widget"));k.tabIndex=-1;const T=Oe(t,bl(".quick-input-description")),M=this.idPrefix+"list",P=this._register(new oQ(t,M,this.options,this.themeService));f.setAttribute("aria-controls",M),this._register(P.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=P.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(P.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(P.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(P.onChangedCheckedCount(R=>{v.setCount(R)})),this._register(P.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof ZI&&this.controller.canSelectMany&&P.clearFocus())},0)}));const N=ph(t);return this._register(N),this._register(xe(t,Je.FOCUS,R=>{ts(R.relatedTarget,t)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(N.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(YI.Blur),this.previousFocusElement=void 0})),this._register(xe(t,Je.FOCUS,R=>{f.setFocus()})),this._register(Lr(t,Je.KEY_DOWN,R=>{if(!ts(R.target,k))switch(R.keyCode){case 3:gn.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:gn.stop(R,!0),this.hide(YI.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const O=[".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")?O.push("input"):O.push("input[type=text]"),this.getUI().list.isDisplayed()&&O.push(".monaco-list"),this.getUI().message&&O.push(".quick-input-message a"),this.getUI().widget){if(ts(R.target,this.getUI().widget))break;O.push(".quick-input-html-widget")}const B=t.querySelectorAll(O.join(", "));R.shiftKey&&R.target===B[0]?(gn.stop(R,!0),P.clearFocus()):!R.shiftKey&&ts(R.target,B[B.length-1])&&(gn.stop(R,!0),B[0].focus())}break;case 10:R.ctrlKey&&(gn.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:n,leftActionBar:o,titleBar:r,title:s,description1:T,description2:u,widget:k,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:m,count:v,okContainer:_,ok:y,message:E,customButtonContainer:S,customButton:L,list:P,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Oe(this._container,this.ui.container))}pick(e,t={},n=wn.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...u,removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(m=>m!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new ZI(e)}createInputBox(){const e=this.getUI(!0);return new Jbt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ms(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Rr.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ms(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();UU.tooltip=r?w("quickInput.backWithKeybinding","Back ({0})",r):w("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}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.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n;const r=this.controller;if(!r)return;const o=(t=this.ui)===null||t===void 0?void 0:t.container,s=o&&!R1e(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(n=a.parentElement)!==null&&n!==void 0?n:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.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,h5.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:n,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=n??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}h5.MAX_WIDTH=600;var nCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let GU=class extends mdt{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(VU))),this._quickAccess}constructor(e,t,n,r,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=o,this._onShow=this._register(new ae),this._onHide=this._register(new ae),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(hl).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(WU,o,s,a,l,c),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(jU))},r=this._register(new h5({...n,...t},this.themeService,this.layoutService));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Bt(e.activeContainer)===Bt(r.container)&&r.layout(o,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 ct(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={},n=wn.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ft(nle),quickInputForeground:ft(xct),quickInputTitleBackground:ft(Lct),widgetBorder:ft(Lye),widgetShadow:ft(np)},inputBox:RO,toggle:NO,countBadge:bSe,button:r0t,progressBar:o0t,keybindingLabel:i0t,list:ZS({listBackground:nle,listFocusBackground:X0,listFocusForeground:q0,listInactiveFocusForeground:q0,listInactiveSelectionIconForeground:vy,listInactiveFocusBackground:X0,listFocusOutline:Ki,listInactiveFocusOutline:Ki}),pickerGroup:{pickerGroupBorder:ft(Ect),pickerGroupForeground:ft(kye)}}}};GU=nCt([vL(0,Wt),vL(1,Gt),vL(2,Mo),vL(3,xC),vL(4,mn)],GU);var YSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},P0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qU=class extends GU{constructor(e,t,n,r,o,s){super(t,n,r,new Jz(e.getContainerDomNode(),o),s),this.host=void 0;const a=hS.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},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 ot.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return ot.None},get onDidAddContainer(){return ot.None},get whenActiveContainerStylesLoaded(){return Promise.resolve()},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)}};qU=YSe([P0(1,Wt),P0(2,Gt),P0(3,Mo),P0(4,jn),P0(5,mn)],qU);let XU=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 n=t=this.instantiationService.createInstance(qU,e);this.mapEditorToService.set(e,t),Gv(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=wn.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};XU=YSe([P0(0,Wt),P0(1,jn)],XU);class hS{static get(e){return e.getContribution(hS.ID)}constructor(e){this.editor=e,this.widget=new f5(this.editor)}dispose(){this.widget.dispose()}}hS.ID="editor.controller.quickInput";class f5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return f5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}f5.ID="editor.contrib.quickInputWidget";Kn(hS.ID,hS,4);class iCt{constructor(e,t,n,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=r,this.background=o}}function rCt(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,r=i.length;n{const h=uCt(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",r="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(r=u.background)}const o=new aCt;for(const u of e)o.getId(u);const s=o.getId(n),a=o.getId(r),l=new sQ(t,s,a),c=new aQ(l);for(let u=0,d=i.length;u"u"){const r=this._match(t),o=cCt(t);n=(r.metadata|o<<8)>>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const lCt=/\b(comment|string|regex|regexp)\b/;function cCt(i){const e=i.match(lCt);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 uCt(i,e){return ie?1:0}class sQ{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new sQ(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class aQ{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let n,r;t===-1?(n=e,r=""):(n=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(n);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,n,r){if(e===""){this._mainRule.acceptOverwrite(t,n,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new aQ(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,r)}}function dCt(i){const e=[];for(let t=1,n=i.length;t{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const O0t=w("caseDescription","Match Case"),F0t=w("wordsDescription","Match Whole Word"),B0t=w("regexDescription","Use Regular Expression");class LSe extends JS{constructor(e){super({icon:tt.caseSensitive,title:O0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ESe extends JS{constructor(e){super({icon:tt.wholeWord,title:F0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class DSe extends JS{constructor(e){super({icon:tt.regex,title:B0t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class W0t{constructor(e,t=0,n=e.length,r=t-1){this.items=e,this.start=t,this.end=n,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 $0t{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 W0t(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 pL=Xe;let H0t=class extends Lc{constructor(e,t,n){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new ae),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new ae),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Oe(e,pL(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=Oe(this.element,pL(".ibwrapper"));if(this.input=Oe(s,pL(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Oe(s,pL("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Vye(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Oe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(e.ownerDocument,"selectionchange")),l=ot.filter(a.event,()=>{const c=e.ownerDocument.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new du(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:ep(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return pT(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&pc(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${bp(n.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=ha(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=Oe(r,pL(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Dmt(this.message.content,a):Emt(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Oe(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=w("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=w("alertWarningMessage","Warning: {0}",this.message.content):n=w("alertInfoMessage","Info: {0}",this.message.content),Pl(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,n;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(n=r.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${bp(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=ep(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,n=t.selectionStart,r=t.selectionEnd,o=t.value;n!==null&&r!==null&&(this.value=o.substr(0,n)+e+o.substr(r),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class ISe extends H0t{constructor(e,t,n){const r=w({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","⇅"),o=w({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,n),this._onDidFocus=this._register(new ae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ae),this.onDidBlur=this._onDidBlur.event,this.history=new $0t(n.history,100);const s=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?r:o,l=this.placeholder+a;n.showPlaceholderOnFocus&&!pT(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||s()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>s()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return n.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||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??"",jf(this.value?this.value:w("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,jf(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 V0t=w("defaultLabel","input");class kSe extends Lc{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Vo),this.additionalToggles=[],this._onDidOptionChange=this._register(new ae),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new ae),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new ae),this._onKeyUp=this._register(new ae),this._onCaseSensitiveKeyDown=this._register(new ae),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new ae),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||V0t,this.showCommonFindToggles=!!n.showCommonFindToggles;const r=n.appendCaseSensitiveLabel||"",o=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ISe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new DSe({appendTitle:s,isChecked:!1,...n.toggleStyles})),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new ESe({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new LSe({appendTitle:r,isChecked:!1,...n.toggleStyles})),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),gn.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(xe(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(xe(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.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 Fe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var ec;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(ec||(ec={}));var eb;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(eb||(eb={}));class lc extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class VZ{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 zZ(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function jI(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function L7(i){return typeof i.collapsible=="boolean"}class z0t{constructor(e,t,n,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new rY,this._onDidChangeCollapseState=new ae,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new ae,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new ae,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new ad(p1e),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=In.empty(),r={}){if(e.length===0)throw new lc(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,n,r):this.spliceSimple(e,t,n,r)}spliceSmart(e,t,n,r,o,s){var a;r===void 0&&(r=In.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,r,o);const c=[...r],u=t[t.length-1],d=new gf({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,o);const h=t.slice(0,-1),f=(m,v,_)=>{if(s>0)for(let y=0;y<_;y++)m--,v--,this.spliceSmart(e,[...h,m,0],Number.MAX_SAFE_INTEGER,c[v].children,o,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const m of d.changes.sort((v,_)=>_.originalStart-v.originalStart))f(g,p,g-(m.originalStart+m.originalLength)),g=m.originalStart,p=m.modifiedStart-u,this.spliceSimple([...h,g],m.originalLength,In.slice(c,p,p+m.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,n=In.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=In.map(n,L=>this.createTreeNode(L,a,a.visible?1:0,c,d,r)),f=e[e.length-1];let g=0;for(let L=f;L>=0&&Ls.getId(L.element).toString())):a.lastDiffIds=a.children.map(L=>s.getId(L.element).toString()):a.lastDiffIds=void 0;let y=0;for(const L of _)L.visible&&y++;if(y!==0)for(let L=f+p.length;LE+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-L),this.list.splice(l,L,d)}if(_.length>0&&o){const L=E=>{o(E),E.children.forEach(L)};_.forEach(L)}this._onDidSplice.fire({insertedNodes:p,deletedNodes:_});let S=a;for(;S;){if(S.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}S=S.parent}}rerender(e){if(e.length===0)throw new lc(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:r}=this.getTreeNodeWithListIndex(e);return n&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:n,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,r,o,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!L7(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,r){const o=this._setNodeCollapseState(e,r,!1);if(!n||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,n){let r;if(e===this.root?r=!1:(L7(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:n})),!L7(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,n,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,r&&o.push(a);const c=e.children||In.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,n,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,r&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):zZ(n)?(e.filterData=n.data,jI(n.visibility)):(e.filterData=void 0,jI(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...r]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(r,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...r]=e;if(n<0||n>t.children.length)throw new lc(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new lc(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new lc(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function E7(i){return i instanceof RT?new U0t(i):i}class j0t{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=me.None,this.disposables=new Fe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,E7(e),t)}onDragOver(e,t,n,r,o,s=!0){const a=this.dnd.onDragOver(E7(e),t&&t.element,n,r,o),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=Qv(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!s){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[n]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),m=f.getNode(p),v=p&&f.getListIndex(p);return this.onDragOver(e,m,v,r,o,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),h=c.getListRenderCount(u);return{...a,feedback:ua(d,d+h)}}drop(e,t,n,r,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(E7(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function K0t(i,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new j0t(i,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 n=i(),r=n.getNodeLocation(t),o=n.getParentNodeLocation(r);return n.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class UZ{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 n,r;(r=(n=this.delegate).setDynamicHeight)===null||r===void 0||r.call(n,e.element,t)}}var KI;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(KI||(KI={}));class G0t{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Fe,this.onDidChange=ot.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class GI{constructor(e,t,n,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=GI.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=me.None,this.disposables=new Fe,this.templateId=e.templateId,this.updateOptions(s),ot.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=fa(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,r]of this.renderedNodes)this.renderTreeElement(n,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==KI.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,r]of this.renderedNodes)this._renderIndentGuides(n,r);if(this.indentGuidesDisposable.dispose(),t){const n=new Fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Oe(e,Xe(".monaco-tl-row")),n=Oe(t,Xe(".monaco-tl-indent")),r=Oe(t,Xe(".monaco-tl-twistie")),o=Oe(t,Xe(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:n,twistie:r,indentGuidesDisposable:me.None,templateData:s}}renderElement(e,t,n,r){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,r)}disposeElement(e,t,n,r){var o,s;n.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,n.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 n=GI.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Vt.asClassNameArray(tt.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(...Vt.asClassNameArray(tt.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(Ps(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Fe,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=Xe(".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),n.add(Ot(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(r=>{const o=n.getNodeLocation(r);try{const s=n.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}GI.DefaultIndent=8;class q0t{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Fe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:zZ(s)?n=jI(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:ah.Default,visibility:n};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:ah.Default,visibility:n};let l;if(this.tree.findMatchType===Gb.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=jb(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===hp.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:ah.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var hp;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(hp||(hp={}));var Gb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(Gb||(Gb={}));let X0t=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,n,r,o,s={}){var a,l;this.tree=e,this.view=n,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new ae,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new ae,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new ae,this._onDidChangeOpenState=new ae,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Fe,this.disposables=new Fe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:hp.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Gb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:w("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!ah.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Y0t(i,e){return i.position===e.position&&TSe(i,e)}function TSe(i,e){return i.node.element===e.node.element&&i.startIndex===e.startIndex&&i.height===e.height&&i.endIndex===e.endIndex}class Z0t{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return lr(this.stickyNodes,e.stickyNodes,Y0t)}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(!lr(this.stickyNodes,e.stickyNodes,TSe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],n=e.stickyNodes[e.count-1];return t.position!==n.position}}class Q0t{constrainStickyScrollNodes(e,t,n){for(let r=0;rn||r>=t)return e.slice(0,r)}return e}}let nue=class extends me{constructor(e,t,n,r,o,s={}){var a;super(),this.tree=e,this.model=t,this.view=n,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(s);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=s.stickyScrollDelegate)!==null&&a!==void 0?a:new Q0t,this._widget=this._register(new J0t(n.getScrollableElement(),n,e,r,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(n.onDidScroll(()=>this.update())),this._register(n.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}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 n=e,r=0,o=this.getNextStickyNode(n,void 0,r);for(;o&&(t.push(o),r+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(n=this.getNextVisibleNode(o),!n)));)o=this.getNextStickyNode(n,o.node,r);const s=this.constrainStickyNodes(t);return s.length?new Z0t(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,n){const r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,n))))return this.createStickyScrollNode(r,n)}nodeTopAlignsWithStickyNodesBottom(e,t){const n=this.getNodeIndex(e),r=this.view.getElementTop(n),o=t;return this.view.scrollTop===r-o}createStickyScrollNode(e,t){const n=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:o}=this.getNodeRange(e),s=this.calculateStickyNodePosition(o,t,n);return{node:e,position:s,height:n,startIndex:r,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let n=e,r=this.getParentNode(n);for(;r;){if(r===t)return n;n=r,r=this.getParentNode(n)}if(t===void 0)return n}calculateStickyNodePosition(e,t,n){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-n:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,n=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&n.position+n.height<=t)return e;const r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];const o=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return r}getParentNode(e){const t=this.model.getNodeLocation(e),n=this.model.getParentNodeLocation(t);return n?this.model.getNode(n):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),n=this.model.getListIndex(t);if(n<0)throw new Error("Node not found in tree");const r=this.model.getListRenderCount(t),o=n+r-1;return{startIndex:n,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let n=this.getParentNode(e);for(;n;)t.push(n),n=this.getParentNode(n);let r=0;for(let o=0;o0,n=!!e&&e.count>0;if(!t&&!n||t&&n&&this._previousState.equal(e))return;if(t!==n&&this.setVisible(n),!n){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 o=Array(e.count);for(let s=e.count-1;s>=0;s--){const a=e.stickyNodes[s],{element:l,disposable:c}=this.createElement(a,s,e.count);o[s]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,n){const r=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,o.style.height=`${e.height}px`,o.style.lineHeight=`${e.height}px`,o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${r}`),o.setAttribute("data-parity",r%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(r)),this.setAccessibilityAttributes(o,e.node.element,t,n);const s=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(d=>d.templateId===s);if(!a)throw new Error(`No renderer found for template id ${s}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const c=a.renderTemplate(o);a.renderElement(l,e.startIndex,c,e.height);const u=Ot(()=>{a.disposeElement(l,e.startIndex,c,e.height),a.disposeTemplate(c),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,n,r){var o;if(!this.accessibilityProvider)return;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,n,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,n))),this.accessibilityProvider.getRole&&e.setAttribute("role",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const s=this.accessibilityProvider.getAriaLabel(t);s&&e.setAttribute("aria-label",s);const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);typeof a=="number"&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1))}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 ebt extends me{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 ae,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new ae,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(n=>this.onKeyDown(n))),this._register(this.view.onMouseDown(n=>this.onMouseDown(n))),this._register(this.view.onContextMenu(n=>this.handleContextMenu(n)))}handleContextMenu(e){const t=e.browserEvent.target;if(!kO(t)&&!tD(t)){this.focusedLast()&&this.view.domFocus();return}if(!SY(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const s=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(s===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(s);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,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:r,anchor:o,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;!kO(t)&&!tD(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 n=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const r=fa(n,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),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=r?r.position+r.height+n.height:n.height;this.view.scrollTop=o-s}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){e.classList.toggle("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.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function iue(i){let e=eb.Unknown;return x9(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=eb.Twistie:x9(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=eb.Element:x9(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=eb.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function nP(i,e){e(i),i.children.forEach(t=>nP(t,e))}class D7{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 ae,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&lr(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:n})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>nP(u,c)),this.set([...l.values()]);return}const n=new Set,r=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>nP(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>nP(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class tbt extends mSe{constructor(e,t,n){super(e),this.tree=t,this.stickyScrollProvider=n}onViewPointer(e){if(hSe(e.browserEvent.target)||Rv(e.browserEvent.target)||iE(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 n=e.browserEvent.target,r=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=tD(e.browserEvent.target);let s=!1;if(o?s=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?s=this.tree.expandOnlyOnTwistieClick(t.element):s=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||r)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s&&r){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(P_t(e.browserEvent.target)||A_t(e.browserEvent.target))return;const n=this.stickyScrollProvider();if(!n)throw new Error("Sticky scroll controller not found");const r=this.list.indexOf(t),o=this.list.getElementTop(r),s=n.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,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(!kO(t)&&!tD(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!kO(t)&&!tD(t)){super.onContextMenu(e);return}}}class nbt extends Ec{constructor(e,t,n,r,o,s,a,l){super(e,t,n,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new tbt(this,e.tree,e.stickyScrollProvider)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const r=[],o=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(Ap([...super.getFocus(),...r])),o.length>0&&super.setSelection(Ap([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||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 NSe{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 ot.filter(ot.map(this.view.onMouseDblClick,iue),e=>e.target!==eb.Filter)}get onPointer(){return ot.map(this.view.onPointer,iue)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ot.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:hp.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Gb.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,n,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new rY,this.onDidChangeFindOpenState=ot.None,this.onDidChangeStickyScrollFocused=ot.None,this.disposables=new Fe,this._onWillRefilter=new ae,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new ae,this.treeDelegate=new UZ(n);const a=new Fse,l=new Fse,c=this.disposables.add(new G0t(l.event)),u=new MY;this.renderers=r.map(p=>new GI(p,()=>this.model,a.event,c,u,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new q0t(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new D7(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new D7(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new D7(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new nbt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...K0t(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=ot.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const f=this.disposables.add(new ae),g=this.disposables.add(new ad(0));if(this.disposables.add(ot.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);f.fire([...p.values()])})})),l.input=f.event,o.keyboardSupport!==!1){const p=ot.chain(this.view.onKeyDown,m=>m.filter(v=>!Rv(v.target)).map(v=>new Oi(v)));ot.chain(p,m=>m.filter(v=>v.keyCode===15))(this.onLeftArrow,this,this.disposables),ot.chain(p,m=>m.filter(v=>v.keyCode===17))(this.onRightArrow,this,this.disposables),ot.chain(p,m=>m.filter(v=>v.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new X0t(this,this.model,this.view,d,o.contextViewProvider,p),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=ot.None,this.onDidChangeFindMatchType=ot.None;o.enableStickyScroll&&(this.stickyScrollController=new nue(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=_c(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===KI.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===KI.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new nue(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=ot.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||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}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),Gv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){var t;const n=`.${this.view.domId}`,r=[];e.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),e.listFocusForeground&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=bp(e.listFocusAndSelectionOutline,bp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));o&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=r.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 n=e.map(o=>this.model.getNode(o));this.selection.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.focus.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)})}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);if(n!==-1)if(!this.stickyScrollController)this.view.reveal(n,t);else{const r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(n,t,r)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){var e;si(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class jZ{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new z0t(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(r,o){return n.sorter.compare(r.element,o.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=In.empty(),n={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),n)}_setChildren(e,t=In.empty(),n){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...n,onDidCreateNode:s,onDidDeleteNode:a})}preserveCollapseState(e=In.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),In.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===ec.Collapsed||t.collapsed===ec.PreserveOrCollapsed?s=!0:t.collapsed===ec.Expanded||t.collapsed===ec.PreserveOrExpanded?s=!1:s=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:s}}const r=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===ec.PreserveOrCollapsed||t.collapsed===ec.PreserveOrExpanded?o=n.collapsed:t.collapsed===ec.Collapsed?o=!0:t.collapsed===ec.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:r,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,n)}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 lc(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new lc(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function iP(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:In.map(In.from(i.children),iP),collapsible:i.collapsible,collapsed:i.collapsed}}function rP(i){const e=[i.element],t=i.incompressible||!1;let n,r;for(;[r,n]=In.consume(In.from(i.children),2),!(r.length!==1||r[0].incompressible);)i=r[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:In.map(In.concat(r,n),rP),collapsible:i.collapsible,collapsed:i.collapsed}}function OU(i,e=0){let t;return eOU(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function rue(i){return OU(i,0)}function RSe(i,e,t){return i.element===e?{...i,children:t}:{...i,children:In.map(In.from(i.children),n=>RSe(n,e,t))}}const ibt=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class rbt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new jZ(e,t,n),this.enabled=typeof n.compressionEnabled>"u"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=In.empty(),n){const r=n.diffIdentityProvider&&ibt(n.diffIdentityProvider);if(e===null){const g=In.map(t,this.enabled?rP:iP);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new lc(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=rue(s),u=RSe(c,e,t),d=(this.enabled?rP:iP)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(lr(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||In.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,r=In.map(n,rue),o=In.map(r,e?rP:iP);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...n,onDidCreateNode:o,onDidDeleteNode:s})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new lc(this.user,`Tree element not found: ${e}`);return t}}const obt=i=>i[i.length-1];class KZ{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new KZ(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 sbt(i,e){return{splice(t,n,r){e.splice(t,n,r.map(o=>i.map(o)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function abt(i,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}}}class lbt{get onDidSplice(){return ot.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return ot.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ot.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||obt;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new VZ(o=>new KZ(r,o)),this.model=new rbt(e,sbt(this.nodeMapper,t),abt(r,n))}setChildren(e,t=In.empty(),n={}){this.model.setChildren(e,t,n)}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,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var cbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class GZ extends NSe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,r,o={}){super(e,t,n,r,o),this.user=e}setChildren(e,t=In.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new jZ(e,t,n)}}class MSe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,n){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,r)):(n.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,n.data,r))}disposeElement(e,t,n,r){var o,s,a,l;n.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,n.compressedTreeNode,t,n.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}cbt([Ar],MSe.prototype,"compressedTreeNodeProvider",null);class ubt{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,n){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;rn||r>=t-1&&tthis,a=new ubt(()=>this.model),l=r.map(c=>new MSe(s,a,c));super(e,t,n,l,{...dbt(s,o),stickyScrollDelegate:a})}setChildren(e,t=In.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new lbt(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function I7(i){return{...i,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function FU(i,e){return e.parent?e.parent===i?!0:FU(i,e.parent):!1}function hbt(i,e){return i===e||FU(i,e)||FU(e,i)}class qZ{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new qZ(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 fbt{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Vt.asClassNameArray(tt.treeItemLoading)),!0):(t.classList.remove(...Vt.asClassNameArray(tt.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function oue(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function sue(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class gbt extends RT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function k7(i){return i instanceof RT?new gbt(i):i}class pbt{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(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,k7(e),t)}onDragOver(e,t,n,r,o,s=!0){return this.dnd.onDragOver(k7(e),t&&t.element,n,r,o)}drop(e,t,n,r,o){this.dnd.drop(k7(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function ASe(i){return i&&{...i,collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new pbt(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:i.accessibilityProvider&&{...i.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))},filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&{...i.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick>"u"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility>"u"?2:i.defaultFindVisibility(e.element)}}function BU(i,e){e(i),i.children.forEach(t=>BU(t,e))}class OSe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ot.map(this.tree.onDidChangeFocus,oue)}get onDidChangeSelection(){return ot.map(this.tree.onDidChangeSelection,oue)}get onMouseDblClick(){return ot.map(this.tree.onMouseDblClick,sue)}get onPointer(){return ot.map(this.tree.onPointer,sue)}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,n,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new ae,this._onDidChangeNodeSlowState=new ae,this.nodeMapper=new VZ(a=>new qZ(a)),this.disposables=new Fe,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=a=>s.collapseByDefault?s.collapseByDefault(a)?ec.PreserveOrCollapsed:ec.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,n,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=I7({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,n,r,o){const s=new UZ(n),a=r.map(c=>new fbt(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=ASe(o)||{};return new GZ(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,n=!1,r,o){if(typeof this.root.element>"u")throw new lc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,r,o),n)try{this.tree.rerender(s)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new lc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const r=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(await this.root.refreshPromise,await ot.toPromise(this._onDidRender.event)),r}setSelection(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setFocus(n,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),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new lc(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,n,r){await this.refreshNode(e,t,n),!this.disposables.isDisposed&&this.render(e,n,r)}async refreshNode(e,t,n){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&hbt(s,e)&&(r=o.then(()=>this.refreshNode(e,t,n)))}),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,n);return}return this.doRefreshSubTree(e,t,n)}async doRefreshSubTree(e,t,n){let r;e.refreshPromise=new Promise(o=>r=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,n);e.stale=!1,await ez.settled(o.map(s=>this.doRefreshSubTree(s,t,n)))}finally{r()}}async doRefreshNode(e,t,n){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(In.empty());else{const o=this.doGetChildren(e);if(Nse(o))r=Promise.resolve(o);else{const s=Zv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=await r;return this.setChildren(e,o,t,n)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Th(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const n=this.dataSource.getChildren(e.element);return Nse(n)?this.processChildren(n):(t=No(async()=>this.processChildren(await n)),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(nn))}setChildren(e,t,n,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)s.set(u.element,u),this.identityProvider&&a.set(u.id,{node:u,collapsed:this.tree.hasElement(u)&&this.tree.isCollapsed(u)});const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=I7({element:u,parent:e,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return d&&p.defaultCollapseState===ec.PreserveOrExpanded&&l.push(p),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(m=>BU(m,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&!f.collapsed&&l.push(p),p}const g=I7({element:u,parent:e,id:h,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1||d&&g.defaultCollapseState===ec.PreserveOrExpanded)&&l.push(g),g});for(const u of s.values())BU(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,n){const r=e.children.map(s=>this.asTreeElement(s,t)),o=n&&{...n,diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}};this.tree.setChildren(e===this.root?null:e,r,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:e.forceExpanded?(n=!1,e.forceExpanded=!1):n=e.defaultCollapseState,{element:e,children:e.hasChildren?In.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class XZ{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 XZ(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 mbt{constructor(e,t,n,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderCompressedElements(e,t,n,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Vt.asClassNameArray(tt.treeItemLoading)),!0):(t.classList.remove(...Vt.asClassNameArray(tt.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeCompressedElements(e,t,n,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function vbt(i){const e=i&&ASe(i);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}}}}class _bt extends OSe{constructor(e,t,n,r,o,s,a={}){super(e,t,n,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new VZ(l=>new XZ(l)),this.filter=a.filter}createTree(e,t,n,r,o){const s=new UZ(n),a=r.map(c=>new mbt(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=vbt(o)||{};return new PSe(e,t,s,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,n){if(!this.identityProvider)return super.render(e,t);const r=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const m=this.tree.getCompressedTreeNode(p===this.root?null:p);if(m.element)for(const v of m.element.elements)g.add(r(v.element))}return g},s=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,n);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const h=f=>{const g=f.element;if(g)for(let p=0;p{const n=this.filter.filter(t,1),r=bbt(n);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function bbt(i){return typeof i=="boolean"?i?1:0:zZ(i)?jI(i.visibility):jI(i)}class Cbt extends NSe{constructor(e,t,n,r,o,s={}){super(e,t,n,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,n){return new jZ(e,t,n)}}new ct("isMac",Dn,w("isMac","Whether the operating system is macOS"));new ct("isLinux",ka,w("isLinux","Whether the operating system is Linux"));const o5=new ct("isWindows",Os,w("isWindows","Whether the operating system is Windows")),FSe=new ct("isWeb",k_,w("isWeb","Whether the platform is a web browser"));new ct("isMacNative",Dn&&!k_,w("isMacNative","Whether the operating system is macOS on a non-browser platform"));new ct("isIOS",fh,w("isIOS","Whether the operating system is iOS"));new ct("isMobile",OCe,w("isMobile","Whether the platform is a mobile web browser"));new ct("isDevelopment",!1,!0);new ct("productQualityType","",w("productQualityType","Quality type of VS Code"));const BSe="inputFocus",ybt=new ct(BSe,!1,w("inputFocus","Whether keyboard focus is inside an input box"));var Yp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Cu=Sn("listService");class wbt{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Fe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new vSe(_c(),"").style(F_)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),pT(e.getHTMLElement())&&this.setLastFocusedList(e),td(e.onDidFocus(()=>this.setLastFocusedList(e)),Ot(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const qI=new ct("listScrollAtBoundary","none");Re.or(qI.isEqualTo("top"),qI.isEqualTo("both"));Re.or(qI.isEqualTo("bottom"),qI.isEqualTo("both"));const WSe=new ct("listFocus",!0),$Se=new ct("treestickyScrollFocused",!1),s5=new ct("listSupportsMultiselect",!0),HSe=Re.and(WSe,Re.not(BSe),$Se.negate()),YZ=new ct("listHasSelectionOrFocus",!1),ZZ=new ct("listDoubleSelection",!1),QZ=new ct("listMultiSelection",!1),a5=new ct("listSelectionNavigation",!1),Sbt=new ct("listSupportsFind",!0),JZ=new ct("treeElementCanCollapse",!1),xbt=new ct("treeElementHasParent",!1),eQ=new ct("treeElementCanExpand",!1),Lbt=new ct("treeElementHasChild",!1),Ebt=new ct("treeFindOpen",!1),VSe="listTypeNavigationMode",zSe="listAutomaticKeyboardNavigation";function l5(i,e){const t=i.createScoped(e.getHTMLElement());return WSe.bindTo(t),t}function c5(i,e){const t=qI.bindTo(i),n=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const EC="workbench.list.multiSelectModifier",oP="workbench.list.openMode",ou="workbench.list.horizontalScrolling",tQ="workbench.list.defaultFindMode",nQ="workbench.list.typeNavigationMode",HO="workbench.list.keyboardNavigation",bh="workbench.list.scrollByPage",iQ="workbench.list.defaultFindMatchType",XI="workbench.tree.indent",VO="workbench.tree.renderIndentGuides",Ch="workbench.list.smoothScrolling",Xf="workbench.list.mouseWheelScrollSensitivity",Yf="workbench.list.fastScrollSensitivity",zO="workbench.tree.expandMode",UO="workbench.tree.enableStickyScroll",jO="workbench.tree.stickyScrollMaxItemCount";function Zf(i){return i.getValue(EC)==="alt"}class Dbt extends me{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Zf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(EC)&&(this.useAltAsMultipleSelectionModifier=Zf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:gSe(e)}isSelectionRangeChangeEvent(e){return pSe(e)}}function u5(i,e){var t;const n=i.get(mn),r=i.get(ci),o=new Fe;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!n.getValue(Ch),mouseWheelScrollSensitivity:n.getValue(Xf),fastScrollSensitivity:n.getValue(Yf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new Dbt(n)),keyboardNavigationEventFilter:Tbt(r),scrollByPage:!!n.getValue(bh)},o]}let WU=class extends Ec{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(ou),[d,h]=c.invokeFunction(u5,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(h),this.contextKeyService=l5(s,this),this.disposables.add(c5(this.contextKeyService,this)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.listDoubleSelection=ZZ.bindTo(this.contextKeyService),this.listMultiSelection=QZ.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Zf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(l));let p={};if(g.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const m=!!l.getValue(ou);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(bh)){const m=!!l.getValue(bh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(Ch)){const m=!!l.getValue(Ch);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Xf)){const m=l.getValue(Xf);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Yf)){const m=l.getValue(Yf);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new USe(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):F_)}};WU=Yp([Fi(5,Gt),Fi(6,Cu),Fi(7,mn),Fi(8,Wt)],WU);let aue=class extends L0t{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(ou),[d,h]=c.invokeFunction(u5,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables=new Fe,this.disposables.add(h),this.contextKeyService=l5(s,this),this.disposables.add(c5(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Zf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(l));let p={};if(g.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const m=!!l.getValue(ou);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(bh)){const m=!!l.getValue(bh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(Ch)){const m=!!l.getValue(Ch);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Xf)){const m=l.getValue(Xf);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Yf)){const m=l.getValue(Yf);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new USe(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):F_)}dispose(){this.disposables.dispose(),super.dispose()}};aue=Yp([Fi(5,Gt),Fi(6,Cu),Fi(7,mn),Fi(8,Wt)],aue);let lue=class extends r5{constructor(e,t,n,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(ou),[h,f]=u.invokeFunction(u5,s);super(e,t,n,r,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(f),this.contextKeyService=l5(a,this),this.disposables.add(c5(this.contextKeyService,this)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.listDoubleSelection=ZZ.bindTo(this.contextKeyService),this.listMultiSelection=QZ.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Zf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(c));let m={};if(p.affectsConfiguration(ou)&&this.horizontalScrolling===void 0){const v=!!c.getValue(ou);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(bh)){const v=!!c.getValue(bh);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Ch)){const v=!!c.getValue(Ch);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xf)){const v=c.getValue(Xf);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Yf)){const v=c.getValue(Yf);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new Ibt(this,{configurationService:c,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ZS(e):F_)}dispose(){this.disposables.dispose(),super.dispose()}};lue=Yp([Fi(6,Gt),Fi(7,Cu),Fi(8,mn),Fi(9,Wt)],lue);class rQ extends me{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new ae),this.onDidOpen=this._onDidOpen.event,this._register(ot.filter(this.widget.onDidChangeSelection,r=>SY(r.browserEvent))(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oP))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(oP)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oP))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!n,o=!1;this._open(this.getSelectedElement(),n,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,n,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class USe extends rQ{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Ibt extends rQ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class kbt extends rQ{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Tbt(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let cue=class extends GZ{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(AT,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new qb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};cue=Yp([Fi(5,Wt),Fi(6,Gt),Fi(7,Cu),Fi(8,mn)],cue);let uue=class extends PSe{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(AT,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new qb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};uue=Yp([Fi(5,Wt),Fi(6,Gt),Fi(7,Cu),Fi(8,mn)],uue);let due=class extends Cbt{constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(AT,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new qb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};due=Yp([Fi(6,Wt),Fi(7,Gt),Fi(8,Cu),Fi(9,mn)],due);let $U=class extends OSe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(AT,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new qb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};$U=Yp([Fi(6,Wt),Fi(7,Gt),Fi(8,Cu),Fi(9,mn)],$U);let hue=class extends _bt{constructor(e,t,n,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(AT,a);super(e,t,n,r,o,s,h),this.disposables.add(g),this.internals=new qb(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};hue=Yp([Fi(7,Wt),Fi(8,Gt),Fi(9,Cu),Fi(10,mn)],hue);function jSe(i){const e=i.getValue(tQ);if(e==="highlight")return hp.Highlight;if(e==="filter")return hp.Filter;const t=i.getValue(HO);if(t==="simple"||t==="highlight")return hp.Highlight;if(t==="filter")return hp.Filter}function KSe(i){const e=i.getValue(iQ);if(e==="fuzzy")return Gb.Fuzzy;if(e==="contiguous")return Gb.Contiguous}function AT(i,e){var t;const n=i.get(mn),r=i.get(og),o=i.get(Gt),s=i.get(Wt),a=()=>{const f=o.getContextKeyValue(VSe);if(f==="automatic")return _f.Automatic;if(f==="trigger"||o.getContextKeyValue(zSe)===!1)return _f.Trigger;const p=n.getValue(nQ);if(p==="automatic")return _f.Automatic;if(p==="trigger")return _f.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!n.getValue(ou),[c,u]=s.invokeFunction(u5,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(VO);return{getTypeNavigationMode:a,disposable:u,options:{keyboardSupport:!1,...c,indent:typeof n.getValue(XI)=="number"?n.getValue(XI):void 0,renderIndentGuides:h,smoothScrolling:!!n.getValue(Ch),defaultFindMode:jSe(n),defaultFindMatchType:KSe(n),horizontalScrolling:l,scrollByPage:!!n.getValue(bh),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(zO)==="doubleClick",contextViewProvider:r,findWidgetStyles:s0t,enableStickyScroll:!!n.getValue(UO),stickyScrollMaxItemCount:Number(n.getValue(jO))}}}let qb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=l5(o,e),this.disposables.push(c5(this.contextKeyService,e)),this.listSupportsMultiSelect=s5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),a5.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Sbt.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=YZ.bindTo(this.contextKeyService),this.hasDoubleSelection=ZZ.bindTo(this.contextKeyService),this.hasMultiSelection=QZ.bindTo(this.contextKeyService),this.treeElementCanCollapse=JZ.bindTo(this.contextKeyService),this.treeElementHasParent=xbt.bindTo(this.contextKeyService),this.treeElementCanExpand=eQ.bindTo(this.contextKeyService),this.treeElementHasChild=Lbt.bindTo(this.contextKeyService),this.treeFindOpen=Ebt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=$Se.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Zf(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(VSe),d.add(zSe),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(EC)&&(this._useAltAsMultipleSelectionModifier=Zf(a)),h.affectsConfiguration(XI)){const g=a.getValue(XI);f={...f,indent:g}}if(h.affectsConfiguration(VO)&&t.renderIndentGuides===void 0){const g=a.getValue(VO);f={...f,renderIndentGuides:g}}if(h.affectsConfiguration(Ch)){const g=!!a.getValue(Ch);f={...f,smoothScrolling:g}}if(h.affectsConfiguration(tQ)||h.affectsConfiguration(HO)){const g=jSe(a);f={...f,defaultFindMode:g}}if(h.affectsConfiguration(nQ)||h.affectsConfiguration(HO)){const g=n();f={...f,typeNavigationMode:g}}if(h.affectsConfiguration(iQ)){const g=KSe(a);f={...f,defaultFindMatchType:g}}if(h.affectsConfiguration(ou)&&t.horizontalScrolling===void 0){const g=!!a.getValue(ou);f={...f,horizontalScrolling:g}}if(h.affectsConfiguration(bh)){const g=!!a.getValue(bh);f={...f,scrollByPage:g}}if(h.affectsConfiguration(zO)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(zO)==="doubleClick"}),h.affectsConfiguration(UO)){const g=a.getValue(UO);f={...f,enableStickyScroll:g}}if(h.affectsConfiguration(jO)){const g=Math.max(1,a.getValue(jO));f={...f,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(Xf)){const g=a.getValue(Xf);f={...f,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Yf)){const g=a.getValue(Yf);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new kbt(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?ZS(e):F_)}dispose(){this.disposables=si(this.disposables)}};qb=Yp([Fi(4,Gt),Fi(5,Cu),Fi(6,mn)],qb);const Nbt=ur.as(Rh.Configuration);Nbt.registerConfiguration({id:"workbench",order:7,title:w("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[EC]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[w("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:w({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.")},[oP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w({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.")},[ou]:{type:"boolean",default:!1,description:w("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[bh]:{type:"boolean",default:!1,description:w("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[XI]:{type:"number",default:8,minimum:4,maximum:40,description:w("tree indent setting","Controls tree indentation in pixels.")},[VO]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:w("render tree indent guides","Controls whether the tree should render indent guides.")},[Ch]:{type:"boolean",default:!1,description:w("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Xf]:{type:"number",default:1,markdownDescription:w("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Yf]:{type:"number",default:5,markdownDescription:w("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[tQ]:{type:"string",enum:["highlight","filter"],enumDescriptions:[w("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),w("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:w("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[HO]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[w("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),w("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),w("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:w("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:w("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[iQ]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[w("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),w("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:w("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[zO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w("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.")},[UO]:{type:"boolean",default:!0,description:w("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[jO]:{type:"number",minimum:1,default:7,markdownDescription:w("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[nQ]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:w("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var HU;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(HU||(HU={}));const DC={Quickaccess:"workbench.contributions.quickaccess"};class Rbt{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,n)=>n.prefix.length-t.prefix.length),Ot(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return hh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}ur.add(DC.Quickaccess,new Rbt);const Mbt={ctrlCmd:!1,alt:!1};var YI;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(YI||(YI={}));var Od;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(Od||(Od={}));const Ph=Sn("quickInputService");var Pbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let VU=class extends me{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ur.as(DC.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===HU.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Fe,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||n!=null&&n.quickNavigateConfiguration)&&(u.itemActivation=(r=n==null?void 0:n.itemActivation)!==null&&r!==void 0?r:Od.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new s3,c.add(ot.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,n==null?void 0:n.providerOptions));const h=c.add(new xr);if(o&&c.add(o.provide(u,h.token,n==null?void 0:n.providerOptions)),ot.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var r;let o;n!=null&&n.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,n,r,o){const s=new Fe,a=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return s.add(Ot(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};VU=Pbt([fue(0,Ph),fue(1,Wt)],VU);class Mv{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Oe(e,Xe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",r){e||(e=""),r&&(e=Mv.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&pc(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{r=o===`\r +`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return n+=r,"⏎"})}}class mL{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class KO extends me{constructor(e,t){var n;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new mL(Oe(e,Xe(".monaco-icon-label")))),this.labelContainer=Oe(this.domNode.element,Xe(".monaco-icon-label-container")),this.nameContainer=Oe(this.labelContainer,Xe("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new Fbt(this.nameContainer,!!t.supportIcons):this.nameNode=new Abt(this.nameContainer),this.hoverDelegate=(n=t==null?void 0:t.hoverDelegate)!==null&&n!==void 0?n:qp("mouse")}get element(){return this.domNode.element}setLabel(e,t,n){var r;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let a="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&s.push("disabled"),n.title&&(typeof n.title=="string"?a+=n.title:a+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=s.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Mv?(l.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(l.element,n==null?void 0:n.descriptionTitle)):(l.textContent=t&&(n!=null&&n.labelEscapeNewLines)?Mv.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(n==null?void 0:n.descriptionTitle)||""),l.empty=!t)}if(n!=null&&n.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(r=n==null?void 0:n.suffix)!==null&&r!==void 0?r:""}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)C_t(e,t);else{const r=LC(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 mL(Rot(this.nameContainer,Xe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new mL(Oe(e.element,Xe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new mL(Oe(this.labelContainer,Xe("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Mv(Oe(t.element,Xe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new mL(Oe(t.element,Xe("span.label-description"))))}return this.descriptionNode}}class Abt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&pc(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=Oe(this.container,Xe("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 n=0;n{const o={start:n,end:n+r.length},s=t.map(a=>Es.intersect(o,a)).filter(a=>!Es.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=o.end+e.length,s})}class Fbt{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&pc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Mv(Oe(this.container,Xe("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 n=(t==null?void 0:t.separator)||"/",r=Obt(e,n,t==null?void 0:t.matches);for(let o=0;o{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});function Bbt(i,e,t=!1){const n=i||"",r=e||"",o=gue.value.collator.compare(n,r);return gue.value.collatorIsNumeric&&o===0&&n!==r?nr.length)return 1}return 0}var Hbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class qSe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Hbt([Ar],qSe.prototype,"toString",null);const Vbt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function zbt(i){const e=[];let t=0,n;for(;n=Vbt.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,r,o,,s]=n;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=n.index+n[0].length}return t{kot(f)&&gn.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new xn(a,Je.CLICK)).event,u=t.disposables.add(new xn(a,Je.KEY_DOWN)).event,d=ot.chain(u,f=>f.filter(g=>{const p=new Oi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Li.addTarget(a));const h=t.disposables.add(new xn(a,Ei.Tap)).event;ot.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var XSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const Id=Xe;class Gbt{constructor(e,t,n,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=n,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?ot.map(ot.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):ot.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new tg(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=nE(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>nvt(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class OT{constructor(e,t){this.themeService=e,this.hoverDelegate=t}get templateId(){return OT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Oe(e,Id(".quick-input-list-entry"));const n=Oe(t.entry,Id("label.quick-input-list-label"));t.toDisposeTemplate.push(Lr(n,Je.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Oe(n,Id("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Lr(t.checkbox,Je.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=Oe(n,Id(".quick-input-list-rows")),o=Oe(r,Id(".quick-input-list-row")),s=Oe(r,Id(".quick-input-list-row"));t.label=new KO(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.label),t.icon=xY(t.label.element,Id(".quick-input-list-icon"));const a=Oe(o,Id(".quick-input-list-entry-keybinding"));t.keybinding=new ex(a,Ll);const l=Oe(s,Id(".quick-input-list-label-meta"));return t.detail=new KO(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.detail),t.separator=Oe(t.entry,Id(".quick-input-list-separator")),t.actionBar=new du(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var r,o,s,a;n.element=e,e.element=(r=n.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(p=>n.checkbox.checked=p));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const p=tS(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,m=Ft.revive(p);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Jv(m)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";let h;!e.saneTooltip&&e.saneDescription&&(h={markdown:{value:e.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDescription});const f={matches:c||[],descriptionTitle:h,descriptionMatches:u||[],labelEscapeNewLines:!0};if(l.type!=="separator"?(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,f),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail){let p;e.saneTooltip||(p={markdown:{value:e.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDetail}),n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:p,labelEscapeNewLines:!0})}else n.detail.element.style.display="none";e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=l.buttons;g&&g.length?(n.actionBar.push(g.map((p,m)=>zU(p,`id-${m}`,()=>l.type!=="separator"?e.fireButtonTriggered({button:p,item:l}):e.fireSeparatorButtonTriggered({button:p,separator:l}))),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}OT.ID="listelement";class qbt{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return OT.ID}}var Bo;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Bo||(Bo={}));class oQ{constructor(e,t,n,r){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new ae,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new ae,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new ae,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new ae,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new ae,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new ae,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new ae,this.onKeyDown=this._onKeyDown.event,this._onLeave=new ae,this.onLeave=this._onLeave.event,this._listElementChecked=new ae,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Oe(this.parent,Id(".quick-input-list"));const o=new qbt,s=new Zbt;this.list=n.createList("QuickInput",this.container,o,[new OT(r,n.hoverDelegate)],{identityProvider:{getId:l=>{var c,u,d,h,f,g,p,m;return(m=(g=(h=(u=(c=l.item)===null||c===void 0?void 0:c.id)!==null&&u!==void 0?u:(d=l.item)===null||d===void 0?void 0:d.label)!==null&&h!==void 0?h:(f=l.separator)===null||f===void 0?void 0:f.id)!==null&&g!==void 0?g:(p=l.separator)===null||p===void 0?void 0:p.label)!==null&&m!==void 0?m:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(l=>{const c=new Oi(l);switch(c.keyCode){case 10:this.toggleCheckbox();break;case 31:(Dn?l.metaKey:l.ctrlKey)&&this.list.setFocus(ua(this.list.length));break;case 16:{const u=this.list.getFocus();u.length===1&&u[0]===0&&this._onLeave.fire();break}case 18:{const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(c)})),this.disposables.push(this.list.onMouseDown(l=>{l.browserEvent.button!==2&&l.browserEvent.preventDefault()})),this.disposables.push(xe(this.container,Je.CLICK,l=>{(l.x||l.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(l=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(l=>{typeof l.index=="number"&&(l.browserEvent.preventDefault(),this.list.setSelection([l.index]))}));const a=new m1e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(async l=>{var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&ts(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{await a.trigger(async()=>{l.element&&this.showHover(l.element)})}catch(u){if(!Th(u))throw u}})),this.disposables.push(this.list.onMouseOut(l=>{var c;ts(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a),this.disposables.push(this._listElementChecked.event(l=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return ot.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return ot.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,r=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new Gbt(a,u,l,o,t,n,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Bo.Second&&this.list.length<2&&(e=Bo.First),e){case Bo.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Bo.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Bo.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Bo.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Bo.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Bo.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Bo.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,r;this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=_7(e,nE(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Xbt(t,nE(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=_7(e,nE(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=_7(e,nE(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const n=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();n.sort((o,s)=>Ybt(o,s,r))}return this.elementsToIndexes=n.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Fe;n.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}XSe([Ar],oQ.prototype,"onDidChangeFocus",null);XSe([Ar],oQ.prototype,"onDidChangeSelection",null);function Xbt(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return pue(i,t);const r=uT(t," "),o=t.length-r.length,s=pue(i,r);if(s)for(const a of s){const l=n[a.start+o]+o;a.start+=l,a.end+=l}return s}function pue(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function Ybt(i,e,t){const n=i.labelHighlights||[],r=e.labelHighlights||[];return n.length&&!r.length?-1:!n.length&&r.length?1:n.length===0&&r.length===0?0:Wbt(i.saneSortLabel,e.saneSortLabel,t)}class Zbt{getWidgetAriaLabel(){return w("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Qbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UU={iconClass:Vt.asClassName(tt.quickInputBack),tooltip:w("quickInput.back","Back"),handle:-1};class FT extends me{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=FT.noPromptMessage,this._severity=Rr.Ignore,this.onDidTriggerButtonEmitter=this._register(new ae),this.onDidHideEmitter=this._register(new ae),this.onDisposeEmitter=this._register(new ae),this.visibleDisposables=this._register(new Fe),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&&!fh;this._ignoreFocusOut=e&&!fh,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=YI.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ms(this.ui.widget,this._widget):ms(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new gd,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(l=>l===UU).map((l,c)=>zU(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==UU).map((l,c)=>zU(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof JS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ms(this.ui.message),Kbt(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?w("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Rr.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()}}FT.noPromptMessage=w("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ZI extends FT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new ae),this.onWillAcceptEmitter=this._register(new ae),this.onDidAcceptEmitter=this._register(new ae),this.onDidCustomEmitter=this._register(new ae),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=Od.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new ae),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new ae),this.onDidTriggerItemButtonEmitter=this._register(new ae),this.onDidTriggerSeparatorButtonEmitter=this._register(new ae),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get 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?Mbt:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Bo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Bo.Next),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Bo.Previous):this.ui.list.focus(Bo.Last),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 12:this.ui.list.focus(Bo.NextPage),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 11:this.ui.list.focus(Bo.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),gn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Bo.First),gn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Bo.Last),gn.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&lr(e,this._activeItems,(t,n)=>t===n)||(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&&lr(e,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(wY(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&lr(e,this._selectedItems,(t,n)=>t===n)||(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 xe(this.ui.container,Je.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Oi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===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,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let r=this.ariaLabel;if(!r&&n.inputBox&&(r=this.placeholder||ZI.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Od.NONE:this._itemActivation=Od.FIRST;break;case Od.SECOND:this.ui.list.focus(Bo.Second),this._itemActivation=Od.FIRST;break;case Od.LAST:this.ui.list.focus(Bo.Last),this._itemActivation=Od.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Bo.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ZI.DEFAULT_ARIA_LABEL=w("quickInputBox.ariaLabel","Type to narrow down results.");class Jbt extends FT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new ae),this.onDidAcceptEmitter=this._register(new ae),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}let jU=class extends yO{constructor(e,t){super("element",!1,n=>this.getOverrideOptions(n),e,t)}getOverrideOptions(e){var t;const n=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:n,skipFadeInAnimation:!0}}}};jU=Qbt([mue(0,mn),mue(1,SZ)],jU);Ce.white.toString(),Ce.white.toString();class GO extends me{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new ae),this._onDidEscape=this._register(new ae),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=n||"",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.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Li.addTarget(this._element)),[Je.CLICK,Ei.Tap].forEach(o=>{this._register(xe(this._element,o,s=>{if(!this.enabled){gn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(xe(this._element,Je.KEY_DOWN,o=>{const s=new Oi(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&gn.stop(s,!0)})),this._register(xe(this._element,Je.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(xe(this._element,Je.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(ph(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 n of Tv(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const r=document.createElement("span");r.textContent=n,t.push(r)}else t.push(n);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Bf(this._label)&&Bf(e)&&ivt(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Bf(e)){const o=X3(e,{inline:!0});o.dispose();const s=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(s){const a=S1e(s,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=a}else ms(n)}else this.options.supportIcons?ms(n,...this.getContentElements(e)):n.textContent=e;let r="";typeof this.options.title=="string"?r=this.options.title:this.options.title&&(r=dvt(e)),this._hover?this._hover.update(r):this._hover=this._register(LC(qp("mouse"),this._element,r)),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",this._element.title),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Vt.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")}}class KU{constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Oe(e,Xe(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Fb(this.countFormat,this.count),this.element.title=Fb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const vue="done",_ue="active",N7="infinite",R7="infinite-long-running",bue="discrete";class d5 extends me{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new mi(()=>Sl(this.element),0)),this.longRunningScheduler=this._register(new mi(()=>this.infiniteLongRunning(),d5.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(_ue,N7,R7,bue),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(vue),this.element.classList.contains(N7)?(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(bue,vue,R7),this.element.classList.add(_ue,N7),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(R7)}getContainer(){return this.element}}d5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const eCt=Xe;class tCt extends me{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=o=>Lr(this.findInput.inputBox.inputElement,Je.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=Oe(this.parent,eCt(".quick-input-box")),this.findInput=this._register(new kSe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Rr.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Rr.Info?1:e===Rr.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Rr.Info?1:e===Rr.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const bl=Xe;class h5 extends me{get container(){return this._container}constructor(e,t,n){super(),this.options=e,this.themeService=t,this.layoutService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new ae),this.onDidCustomEmitter=this._register(new ae),this.onDidTriggerButtonEmitter=this._register(new ae),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new ae),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new ae),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(ot.runAndSubscribe(u3,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:hi,disposables:this._store})),this._register(pot(r=>{this.ui&&Bt(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const n=r=>{this.keyMods.ctrlCmd=r.ctrlKey||r.metaKey,this.keyMods.alt=r.altKey};for(const r of[Je.KEY_DOWN,Je.KEY_UP,Je.MOUSE_DOWN])t.add(xe(e,r,n,!0))}getUI(e){if(this.ui)return e&&Bt(this._container)!==Bt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Oe(this._container,bl(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const n=_c(t),r=Oe(t,bl(".quick-input-titlebar")),o=this._register(new du(r,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=Oe(r,bl(".quick-input-title")),a=this._register(new du(r,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Oe(t,bl(".quick-input-header")),c=Oe(l,bl("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",w("quickInput.checkAll","Toggle all checkboxes")),this._register(Lr(c,Je.CHANGE,R=>{const O=c.checked;P.setAllVisibleChecked(O)})),this._register(xe(c,Je.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const u=Oe(l,bl(".quick-input-description")),d=Oe(l,bl(".quick-input-and-message")),h=Oe(d,bl(".quick-input-filter")),f=this._register(new tCt(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Oe(h,bl(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new KU(g,{countFormat:w({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),m=Oe(h,bl(".quick-input-count"));m.setAttribute("aria-live","polite");const v=new KU(m,{countFormat:w({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),_=Oe(l,bl(".quick-input-action")),y=this._register(new GO(_,this.styles.button));y.label=w("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const S=Oe(l,bl(".quick-input-action")),L=this._register(new GO(S,{...this.styles.button,supportIcons:!0}));L.label=w("custom","Custom"),this._register(L.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const E=Oe(d,bl(`#${this.idPrefix}message.quick-input-message`)),D=this._register(new d5(t,this.styles.progressBar));D.getContainer().classList.add("quick-input-progress");const k=Oe(t,bl(".quick-input-html-widget"));k.tabIndex=-1;const T=Oe(t,bl(".quick-input-description")),M=this.idPrefix+"list",P=this._register(new oQ(t,M,this.options,this.themeService));f.setAttribute("aria-controls",M),this._register(P.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=P.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(P.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(P.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(P.onChangedCheckedCount(R=>{v.setCount(R)})),this._register(P.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof ZI&&this.controller.canSelectMany&&P.clearFocus())},0)}));const N=ph(t);return this._register(N),this._register(xe(t,Je.FOCUS,R=>{ts(R.relatedTarget,t)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(N.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(YI.Blur),this.previousFocusElement=void 0})),this._register(xe(t,Je.FOCUS,R=>{f.setFocus()})),this._register(Lr(t,Je.KEY_DOWN,R=>{if(!ts(R.target,k))switch(R.keyCode){case 3:gn.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:gn.stop(R,!0),this.hide(YI.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const O=[".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")?O.push("input"):O.push("input[type=text]"),this.getUI().list.isDisplayed()&&O.push(".monaco-list"),this.getUI().message&&O.push(".quick-input-message a"),this.getUI().widget){if(ts(R.target,this.getUI().widget))break;O.push(".quick-input-html-widget")}const B=t.querySelectorAll(O.join(", "));R.shiftKey&&R.target===B[0]?(gn.stop(R,!0),P.clearFocus()):!R.shiftKey&&ts(R.target,B[B.length-1])&&(gn.stop(R,!0),B[0].focus())}break;case 10:R.ctrlKey&&(gn.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:n,leftActionBar:o,titleBar:r,title:s,description1:T,description2:u,widget:k,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:m,count:v,okContainer:_,ok:y,message:E,customButtonContainer:S,customButton:L,list:P,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Oe(this._container,this.ui.container))}pick(e,t={},n=wn.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...u,removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(m=>m!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new ZI(e)}createInputBox(){const e=this.getUI(!0);return new Jbt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ms(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Rr.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ms(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();UU.tooltip=r?w("quickInput.backWithKeybinding","Back ({0})",r):w("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}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.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n;const r=this.controller;if(!r)return;const o=(t=this.ui)===null||t===void 0?void 0:t.container,s=o&&!R1e(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(n=a.parentElement)!==null&&n!==void 0?n:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.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,h5.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:n,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=n??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}h5.MAX_WIDTH=600;var nCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let GU=class extends mdt{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(VU))),this._quickAccess}constructor(e,t,n,r,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=o,this._onShow=this._register(new ae),this._onHide=this._register(new ae),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(hl).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(WU,o,s,a,l,c),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(jU))},r=this._register(new h5({...n,...t},this.themeService,this.layoutService));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Bt(e.activeContainer)===Bt(r.container)&&r.layout(o,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 ct(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={},n=wn.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ft(nle),quickInputForeground:ft(xct),quickInputTitleBackground:ft(Lct),widgetBorder:ft(Lye),widgetShadow:ft(np)},inputBox:RO,toggle:NO,countBadge:bSe,button:r0t,progressBar:o0t,keybindingLabel:i0t,list:ZS({listBackground:nle,listFocusBackground:Y0,listFocusForeground:X0,listInactiveFocusForeground:X0,listInactiveSelectionIconForeground:vy,listInactiveFocusBackground:Y0,listFocusOutline:Ki,listInactiveFocusOutline:Ki}),pickerGroup:{pickerGroupBorder:ft(Ect),pickerGroupForeground:ft(kye)}}}};GU=nCt([vL(0,Wt),vL(1,Gt),vL(2,Mo),vL(3,xC),vL(4,mn)],GU);var YSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},A0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qU=class extends GU{constructor(e,t,n,r,o,s){super(t,n,r,new Jz(e.getContainerDomNode(),o),s),this.host=void 0;const a=hS.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},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 ot.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return ot.None},get onDidAddContainer(){return ot.None},get whenActiveContainerStylesLoaded(){return Promise.resolve()},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)}};qU=YSe([A0(1,Wt),A0(2,Gt),A0(3,Mo),A0(4,jn),A0(5,mn)],qU);let XU=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 n=t=this.instantiationService.createInstance(qU,e);this.mapEditorToService.set(e,t),qv(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=wn.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};XU=YSe([A0(0,Wt),A0(1,jn)],XU);class hS{static get(e){return e.getContribution(hS.ID)}constructor(e){this.editor=e,this.widget=new f5(this.editor)}dispose(){this.widget.dispose()}}hS.ID="editor.controller.quickInput";class f5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return f5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}f5.ID="editor.contrib.quickInputWidget";Kn(hS.ID,hS,4);class iCt{constructor(e,t,n,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=r,this.background=o}}function rCt(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,r=i.length;n{const h=uCt(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",r="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(r=u.background)}const o=new aCt;for(const u of e)o.getId(u);const s=o.getId(n),a=o.getId(r),l=new sQ(t,s,a),c=new aQ(l);for(let u=0,d=i.length;u"u"){const r=this._match(t),o=cCt(t);n=(r.metadata|o<<8)>>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const lCt=/\b(comment|string|regex|regexp)\b/;function cCt(i){const e=i.match(lCt);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 uCt(i,e){return ie?1:0}class sQ{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new sQ(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class aQ{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let n,r;t===-1?(n=e,r=""):(n=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(n);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,n,r){if(e===""){this._mainRule.acceptOverwrite(t,n,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new aQ(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,r)}}function dCt(i){const e=[];for(let t=1,n=i.length;t({format:r.format,location:r.location.toString()}))}}i.toJSONObject=e;function t(n){const r=o=>Ea(o)?o:void 0;if(n&&Array.isArray(n.src)&&n.src.every(o=>Ea(o.format)&&Ea(o.location)))return{weight:r(n.weight),style:r(n.style),src:n.src.map(o=>({format:o.format,location:Ft.parse(o.location)}))}}i.fromJSONObject=t})(yue||(yue={}));class vCt{constructor(){this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:w("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:w("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Vt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,r){const o=this.iconsById[e];if(o){if(n&&!o.description){o.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return o}const s={id:e,description:n,defaults:t,deprecationMessage:r};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return r&&(a.deprecationMessage=r),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,s)=>o.id.localeCompare(s.id),t=o=>{for(;Vt.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const r=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of r.filter(s=>!!s.description).sort(e))n.push(`||${o.id}|${Vt.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const o of r.filter(s=>!Vt.isThemeIcon(s.defaults)).sort(e))n.push(`||${o.id}|`);return n.join(` -`)}}const IC=new vCt;ur.add(mCt.IconContribution,IC);function Or(i,e,t,n){return IC.registerIcon(i,e,t,n)}function QSe(){return IC}function _Ct(){const i=n1e();for(const e in i){const t="\\"+i[e].toString(16);IC.registerIcon(e,{fontCharacter:t})}}_Ct();const JSe="vscode://schemas/icons",exe=ur.as(I3.JSONContribution);exe.registerSchema(JSe,IC.getIconSchema());const wue=new mi(()=>exe.notifySchemaChanged(JSe),200);IC.onDidChange(()=>{wue.isScheduled()||wue.schedule()});const txe=Or("widget-close",tt.close,w("widgetClose","Icon for the close action in widgets."));Or("goto-previous-location",tt.arrowUp,w("previousChangeIcon","Icon for goto previous editor location."));Or("goto-next-location",tt.arrowDown,w("nextChangeIcon","Icon for goto next editor location."));Vt.modify(tt.sync,"spin");Vt.modify(tt.loading,"spin");function bCt(i){const e=new Fe,t=e.add(new ae),n=QSe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=i?i.getProductIconTheme():new nxe,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${iae(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Qv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${iae(l)};${u}${d} font-display: block; }`)}return a.join(` -`)}}}class nxe{getIcon(e){const t=QSe();let n=e.defaults;for(;Vt.isThemeIcon(n);){const r=t.getIcon(n.id);if(!r)return;n=r.defaults}return n}}const Gg="vs",pw="vs-dark",vb="hc-black",_b="hc-light",ixe=ur.as(xye.ColorContribution),CCt=ur.as(zye.ThemingContribution);class rxe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(sP(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Ce.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=YU(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,Ce.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=ixe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Gg:return Jc.LIGHT;case vb:return Jc.HIGH_CONTRAST_DARK;case _b:return Jc.HIGH_CONTRAST_LIGHT;default:return Jc.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=YU(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(n||r){const o={token:""};n&&(o.foreground=n),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=ZSe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=fs.getForeground(o),a=fs.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function sP(i){return i===Gg||i===pw||i===vb||i===_b}function YU(i){switch(i){case Gg:return hCt;case pw:return fCt;case vb:return gCt;case _b:return pCt}}function L2(i){const e=YU(i);return new rxe(i,e)}class yCt extends me{constructor(){super(),this._onColorThemeChange=this._register(new ae),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new ae),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new nxe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Gg,L2(Gg)),this._knownThemes.set(pw,L2(pw)),this._knownThemes.set(vb,L2(vb)),this._knownThemes.set(_b,L2(_b));const e=this._register(bCt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Gg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),f1e(hi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return VA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=_c(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),me.None}_registerShadowDomContainer(e){const t=_c(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(Gg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=hi.matchMedia("(forced-colors: active)").matches;if(e!==sh(this._theme.type)){let t;tS(this._theme.type)?t=e?vb:pw:t=e?_b:Gg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};CCt.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const r=[];for(const s of ixe.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${VY(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(` +`)}}const IC=new vCt;ur.add(mCt.IconContribution,IC);function Or(i,e,t,n){return IC.registerIcon(i,e,t,n)}function QSe(){return IC}function _Ct(){const i=n1e();for(const e in i){const t="\\"+i[e].toString(16);IC.registerIcon(e,{fontCharacter:t})}}_Ct();const JSe="vscode://schemas/icons",exe=ur.as(I3.JSONContribution);exe.registerSchema(JSe,IC.getIconSchema());const wue=new mi(()=>exe.notifySchemaChanged(JSe),200);IC.onDidChange(()=>{wue.isScheduled()||wue.schedule()});const txe=Or("widget-close",tt.close,w("widgetClose","Icon for the close action in widgets."));Or("goto-previous-location",tt.arrowUp,w("previousChangeIcon","Icon for goto previous editor location."));Or("goto-next-location",tt.arrowDown,w("nextChangeIcon","Icon for goto next editor location."));Vt.modify(tt.sync,"spin");Vt.modify(tt.loading,"spin");function bCt(i){const e=new Fe,t=e.add(new ae),n=QSe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=i?i.getProductIconTheme():new nxe,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${iae(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Jv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${iae(l)};${u}${d} font-display: block; }`)}return a.join(` +`)}}}class nxe{getIcon(e){const t=QSe();let n=e.defaults;for(;Vt.isThemeIcon(n);){const r=t.getIcon(n.id);if(!r)return;n=r.defaults}return n}}const Gg="vs",pw="vs-dark",_b="hc-black",bb="hc-light",ixe=ur.as(xye.ColorContribution),CCt=ur.as(zye.ThemingContribution);class rxe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(sP(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Ce.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=YU(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,Ce.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=ixe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Gg:return Jc.LIGHT;case _b:return Jc.HIGH_CONTRAST_DARK;case bb:return Jc.HIGH_CONTRAST_LIGHT;default:return Jc.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=YU(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(n||r){const o={token:""};n&&(o.foreground=n),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=ZSe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=fs.getForeground(o),a=fs.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function sP(i){return i===Gg||i===pw||i===_b||i===bb}function YU(i){switch(i){case Gg:return hCt;case pw:return fCt;case _b:return gCt;case bb:return pCt}}function L2(i){const e=YU(i);return new rxe(i,e)}class yCt extends me{constructor(){super(),this._onColorThemeChange=this._register(new ae),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new ae),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new nxe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Gg,L2(Gg)),this._knownThemes.set(pw,L2(pw)),this._knownThemes.set(_b,L2(_b)),this._knownThemes.set(bb,L2(bb));const e=this._register(bCt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Gg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),f1e(hi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return VA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=_c(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),me.None}_registerShadowDomContainer(e){const t=_c(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(Gg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=hi.matchMedia("(forced-colors: active)").matches;if(e!==sh(this._theme.type)){let t;tS(this._theme.type)?t=e?_b:pw:t=e?bb:Gg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};CCt.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const r=[];for(const s of ixe.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${VY(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(dCt(o)),this._themeCSS=e.join(` `),this._updateCSS(),gr.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Dc=Sn("themeService");var wCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},M7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ZU=class extends me{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new ae,this._onDidChangeReducedMotion=new ae,this._accessibilityModeEnabledContext=CT.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=hi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(xe(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",n),this._layoutService.mainContainer.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};ZU=wCt([M7(0,Gt),M7(1,xC),M7(2,mn)],ZU);var g5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$1,Dm;let QU=class{constructor(e,t){this._commandService=e,this._hiddenStates=new qO(t)}createMenu(e,t,n){return new ej(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...n},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};QU=g5([qb(0,cr),qb(1,md)],QU);let qO=$1=class{constructor(e){this._storageService=e,this._disposables=new Fe,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get($1._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,$1._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get($1._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,r;const o=this._isHiddenByDefault(e,t),s=(r=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const o=this._data[e.id];if(n)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&rnt(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store($1._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};qO._key="menu.hiddenCommands";qO=$1=g5([qb(0,md)],qO);let JU=Dm=class{constructor(e,t,n,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=ns.getMenuItems(this._id);let t;e.sort(Dm._compareMenuItems);for(const n of e){const r=n.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Dm._fillInKbExprKeys(e.when,this._structureContextKeys),hy(e)){if(e.command.precondition&&Dm._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Dm._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&ns.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[r,o]=n,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=hy(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=SCt(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new bc(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new Dm(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=ho.join(...u.map(h=>h[1]));d.length>0&&s.push(new dI(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,r=t.group;if(n!==r){if(n){if(!r)return-1}else return 1;if(n==="navigation")return-1;if(r==="navigation")return 1;const a=n.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return os?1:Dm._compareTitles(hy(e)?e.command.title:e.title,hy(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return n.localeCompare(r)}};JU=Dm=g5([qb(3,cr),qb(4,Gt)],JU);let ej=class{constructor(e,t,n,r,o){this._disposables=new Fe,this._menuInfo=new JU(e,t,n.emitEventsForSubmenuChanges,r,o);const s=new mi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(ns.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Fe),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new KCe({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};ej=g5([qb(3,cr),qb(4,Gt)],ej);function SCt(i,e,t){const n=hst(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=Yy({id:`hide/${i.id}/${n}`,label:w("hide.label","Hide '{0}'",r),run(){t.updateHidden(i,n,!0)}}),s=Yy({id:`toggle/${i.id}/${n}`,label:r,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var xCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tj;let XO=tj=class extends me{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Fp||g1e)&&this.installWebKitWriteTextWorkaround(),this._register(ot.runAndSubscribe(u3,({window:n,disposables:r})=>{r.add(xe(n.document,"copy",()=>this.clearResources()))},{window:hi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new s3;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async n=>{(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)})};this._register(ot.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:n})=>{n.add(xe(t,"click",e)),n.add(xe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(n){console.error(n)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=zS(),n=t.activeElement,r=t.body.appendChild(Xe("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"),n instanceof HTMLElement&&n.focus(),t.body.removeChild(r)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return a3(e.substring(0,tj.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};XO.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;XO=tj=xCt([Sue(0,xC),Sue(1,Ra)],XO);const Zp=Sn("clipboardService");var LCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ECt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const nD="data-keybinding-context";let lQ=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}};class fS extends lQ{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}fS.INSTANCE=new fS;class QI extends lQ{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=dw.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Lue(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...In.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}n.fire(new Lue(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(QI._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(QI._keyPrefix.length),n=this._configurationService.getValue(t);let r;switch(typeof n){case"number":case"boolean":case"string":r=n;break;default:Array.isArray(n)?r=JSON.stringify(n):r=n}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}QI._keyPrefix="config.";class DCt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,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 xue{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Lue{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 ICt{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 kCt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class oxe extends me{constructor(e){super(),this._onDidChangeContext=this._register(new Ab({merge:t=>new ICt(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 DCt(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 TCt(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 n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new xue(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new xue(e))}getContext(e){return this._isDisposed?fS.INSTANCE:this.getContextValuesContainer(NCt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let nj=class extends oxe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new QI(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?fS.INSTANCE:this._contexts.get(e)||fS.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 lQ(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};nj=LCt([ECt(0,mn)],nj);class TCt extends oxe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Vo),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(nD)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(nD,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;kCt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(nD),super.dispose())}getContextValuesContainer(e){return this._isDisposed?fS.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 NCt(i){for(;i;){if(i.hasAttribute(nD)){const e=i.getAttribute(nD);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function RCt(i,e,t){i.get(Gt).createKey(String(e),MCt(t))}function MCt(i){return RCe(i,e=>{if(typeof e=="object"&&e.$mid===1)return Ft.revive(e).toString();if(e instanceof Ft)return e.toString()})}kn.registerCommand("_setContext",RCt);kn.registerCommand({id:"getContextKeyInfo",handler(){return[...ct.all()].sort((i,e)=>i.key.localeCompare(e.key))},metadata:{description:w("getContextKeyInfo","A command that returns information about context keys"),args:[]}});kn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of ct.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});let PCt=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Eue{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 n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new PCt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Dc=Sn("themeService");var wCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},M7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ZU=class extends me{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new ae,this._onDidChangeReducedMotion=new ae,this._accessibilityModeEnabledContext=CT.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=hi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(xe(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",n),this._layoutService.mainContainer.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};ZU=wCt([M7(0,Gt),M7(1,xC),M7(2,mn)],ZU);var g5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$1,Dm;let QU=class{constructor(e,t){this._commandService=e,this._hiddenStates=new qO(t)}createMenu(e,t,n){return new ej(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...n},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};QU=g5([Xb(0,cr),Xb(1,md)],QU);let qO=$1=class{constructor(e){this._storageService=e,this._disposables=new Fe,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get($1._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,$1._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get($1._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,r;const o=this._isHiddenByDefault(e,t),s=(r=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const o=this._data[e.id];if(n)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&rnt(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store($1._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};qO._key="menu.hiddenCommands";qO=$1=g5([Xb(0,md)],qO);let JU=Dm=class{constructor(e,t,n,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=ns.getMenuItems(this._id);let t;e.sort(Dm._compareMenuItems);for(const n of e){const r=n.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Dm._fillInKbExprKeys(e.when,this._structureContextKeys),hy(e)){if(e.command.precondition&&Dm._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Dm._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&ns.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[r,o]=n,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=hy(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=SCt(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new bc(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new Dm(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=ho.join(...u.map(h=>h[1]));d.length>0&&s.push(new dI(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,r=t.group;if(n!==r){if(n){if(!r)return-1}else return 1;if(n==="navigation")return-1;if(r==="navigation")return 1;const a=n.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return os?1:Dm._compareTitles(hy(e)?e.command.title:e.title,hy(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return n.localeCompare(r)}};JU=Dm=g5([Xb(3,cr),Xb(4,Gt)],JU);let ej=class{constructor(e,t,n,r,o){this._disposables=new Fe,this._menuInfo=new JU(e,t,n.emitEventsForSubmenuChanges,r,o);const s=new mi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(ns.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Fe),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new KCe({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};ej=g5([Xb(3,cr),Xb(4,Gt)],ej);function SCt(i,e,t){const n=hst(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=Yy({id:`hide/${i.id}/${n}`,label:w("hide.label","Hide '{0}'",r),run(){t.updateHidden(i,n,!0)}}),s=Yy({id:`toggle/${i.id}/${n}`,label:r,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var xCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tj;let XO=tj=class extends me{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Fp||g1e)&&this.installWebKitWriteTextWorkaround(),this._register(ot.runAndSubscribe(u3,({window:n,disposables:r})=>{r.add(xe(n.document,"copy",()=>this.clearResources()))},{window:hi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new s3;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async n=>{(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)})};this._register(ot.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:n})=>{n.add(xe(t,"click",e)),n.add(xe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(n){console.error(n)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=zS(),n=t.activeElement,r=t.body.appendChild(Xe("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"),n instanceof HTMLElement&&n.focus(),t.body.removeChild(r)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return a3(e.substring(0,tj.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};XO.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;XO=tj=xCt([Sue(0,xC),Sue(1,Ra)],XO);const Zp=Sn("clipboardService");var LCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ECt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const nD="data-keybinding-context";let lQ=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}};class fS extends lQ{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}fS.INSTANCE=new fS;class QI extends lQ{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=dw.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Lue(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...In.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}n.fire(new Lue(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(QI._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(QI._keyPrefix.length),n=this._configurationService.getValue(t);let r;switch(typeof n){case"number":case"boolean":case"string":r=n;break;default:Array.isArray(n)?r=JSON.stringify(n):r=n}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}QI._keyPrefix="config.";class DCt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,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 xue{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Lue{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 ICt{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 kCt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class oxe extends me{constructor(e){super(),this._onDidChangeContext=this._register(new Ob({merge:t=>new ICt(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 DCt(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 TCt(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 n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new xue(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new xue(e))}getContext(e){return this._isDisposed?fS.INSTANCE:this.getContextValuesContainer(NCt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let nj=class extends oxe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new QI(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?fS.INSTANCE:this._contexts.get(e)||fS.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 lQ(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};nj=LCt([ECt(0,mn)],nj);class TCt extends oxe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Vo),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(nD)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(nD,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;kCt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(nD),super.dispose())}getContextValuesContainer(e){return this._isDisposed?fS.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 NCt(i){for(;i;){if(i.hasAttribute(nD)){const e=i.getAttribute(nD);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function RCt(i,e,t){i.get(Gt).createKey(String(e),MCt(t))}function MCt(i){return RCe(i,e=>{if(typeof e=="object"&&e.$mid===1)return Ft.revive(e).toString();if(e instanceof Ft)return e.toString()})}kn.registerCommand("_setContext",RCt);kn.registerCommand({id:"getContextKeyInfo",handler(){return[...ct.all()].sort((i,e)=>i.key.localeCompare(e.key))},metadata:{description:w("getContextKeyInfo","A command that returns information about context keys"),args:[]}});kn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of ct.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});let PCt=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Eue{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 n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new PCt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` @@ -1154,41 +1154,41 @@ ${e.toString()}`}}class YO{constructor(e=new IT,t=!1,n,r=ACt){var o;this._servic `).slice(3,4).join(` `)):Ya._None}static traceCreation(e,t){return e?new Ya(1,t.name):Ya._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const n=new Ya(3,e.toString());return this._dep.push([e,t,n]),n}stop(){const e=Date.now()-this._start;Ya._totals+=e;let t=!1;function n(o,s){const a=[],l=new Array(o+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=n(o+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ya._totals.toFixed(2)}ms)`];(e>2||t)&&Ya.all.add(r.join(` -`))}}Ya.all=new Set;Ya._None=new class extends Ya{constructor(){super(0,null)}stop(){}branch(){return this}};Ya._totals=0;const OCt=new Set([cn.inMemory,cn.vscodeSourceControl,cn.walkThrough,cn.walkThroughSnippet]);class FCt{constructor(){this._byResource=new Mr,this._byOwner=new Map}set(e,t,n){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,n);let o=this._byOwner.get(t);o||(o=new Mr,this._byOwner.set(t,o)),o.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,r=!1;const o=this._byResource.get(e);o&&(n=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),n!==r)throw new Error("illegal state");return n&&r}values(e){var t,n,r,o;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:In.empty():Ft.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:In.empty():In.map(In.concat(...this._byOwner.values()),s=>s[1])}}class BCt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Mr,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);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(OCt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===vr.Error?t.errors+=1:n===vr.Warning?t.warnings+=1:n===vr.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 Pm{constructor(){this._onMarkerChanged=new KCe({delay:0,merge:Pm._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new FCt,this._stats=new BCt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(DCe(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of n){const s=Pm._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],r=this._data.values(e);if(r)for(const o of r){const s=In.first(o);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(Ms(t)){const o=new Mr;for(const{resource:s,marker:a}of t){const l=Pm._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),n.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(Pm._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(Pm._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(n??t),a=[];for(const l of s)for(const c of l)if(Pm._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Mr;for(const n of e)for(const r of n)t.set(r,!0);return Array.from(t.keys())}}class WCt extends me{constructor(){super(...arguments),this._configurationModel=new us}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new us;const e=ur.as(Rh.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const r of e){const o=n[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const F_=Sn("accessibilitySignalService");class tn{static register(e){return new tn(e.fileName)}constructor(e){this.fileName=e}}tn.error=tn.register({fileName:"error.mp3"});tn.warning=tn.register({fileName:"warning.mp3"});tn.foldedArea=tn.register({fileName:"foldedAreas.mp3"});tn.break=tn.register({fileName:"break.mp3"});tn.quickFixes=tn.register({fileName:"quickFixes.mp3"});tn.taskCompleted=tn.register({fileName:"taskCompleted.mp3"});tn.taskFailed=tn.register({fileName:"taskFailed.mp3"});tn.terminalBell=tn.register({fileName:"terminalBell.mp3"});tn.diffLineInserted=tn.register({fileName:"diffLineInserted.mp3"});tn.diffLineDeleted=tn.register({fileName:"diffLineDeleted.mp3"});tn.diffLineModified=tn.register({fileName:"diffLineModified.mp3"});tn.chatRequestSent=tn.register({fileName:"chatRequestSent.mp3"});tn.chatResponsePending=tn.register({fileName:"chatResponsePending.mp3"});tn.chatResponseReceived1=tn.register({fileName:"chatResponseReceived1.mp3"});tn.chatResponseReceived2=tn.register({fileName:"chatResponseReceived2.mp3"});tn.chatResponseReceived3=tn.register({fileName:"chatResponseReceived3.mp3"});tn.chatResponseReceived4=tn.register({fileName:"chatResponseReceived4.mp3"});tn.clear=tn.register({fileName:"clear.mp3"});tn.save=tn.register({fileName:"save.mp3"});tn.format=tn.register({fileName:"format.mp3"});class $Ct{constructor(e){this.randomOneOf=e}}class dn{static register(e){const t=new $Ct("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new dn(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return dn._signals.add(n),n}constructor(e,t,n,r,o,s){this.sound=e,this.name=t,this.legacySoundSettingsKey=n,this.settingsKey=r,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s}}dn._signals=new Set;dn.error=dn.register({name:w("accessibilitySignals.lineHasError.name","Error on Line"),sound:tn.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:w("accessibility.signals.lineHasError","Error"),settingsKey:"accessibility.signals.lineHasError"});dn.warning=dn.register({name:w("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:tn.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:w("accessibility.signals.lineHasWarning","Warning"),settingsKey:"accessibility.signals.lineHasWarning"});dn.foldedArea=dn.register({name:w("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:tn.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:w("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});dn.break=dn.register({name:w("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:tn.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:w("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});dn.inlineSuggestion=dn.register({name:w("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:tn.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});dn.terminalQuickFix=dn.register({name:w("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:tn.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:w("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});dn.onDebugBreak=dn.register({name:w("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:tn.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:w("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});dn.noInlayHints=dn.register({name:w("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:tn.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:w("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});dn.taskCompleted=dn.register({name:w("accessibilitySignals.taskCompleted","Task Completed"),sound:tn.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:w("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});dn.taskFailed=dn.register({name:w("accessibilitySignals.taskFailed","Task Failed"),sound:tn.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:w("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});dn.terminalCommandFailed=dn.register({name:w("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:tn.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:w("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});dn.terminalBell=dn.register({name:w("accessibilitySignals.terminalBell","Terminal Bell"),sound:tn.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:w("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});dn.notebookCellCompleted=dn.register({name:w("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:tn.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:w("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});dn.notebookCellFailed=dn.register({name:w("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:tn.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:w("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});dn.diffLineInserted=dn.register({name:w("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:tn.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});dn.diffLineDeleted=dn.register({name:w("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:tn.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});dn.diffLineModified=dn.register({name:w("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:tn.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});dn.chatRequestSent=dn.register({name:w("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:tn.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:w("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});dn.chatResponseReceived=dn.register({name:w("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[tn.chatResponseReceived1,tn.chatResponseReceived2,tn.chatResponseReceived3,tn.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});dn.chatResponsePending=dn.register({name:w("accessibilitySignals.chatResponsePending","Chat Response Pending"),sound:tn.chatResponsePending,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponsePending",announcementMessage:w("accessibility.signals.chatResponsePending","Chat Response Pending"),settingsKey:"accessibility.signals.chatResponsePending"});dn.clear=dn.register({name:w("accessibilitySignals.clear","Clear"),sound:tn.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:w("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});dn.save=dn.register({name:w("accessibilitySignals.save","Save"),sound:tn.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:w("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});dn.format=dn.register({name:w("accessibilitySignals.format","Format"),sound:tn.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:w("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});class HCt extends me{constructor(e,t=[]){super(),this.logger=new gst([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}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 sxe=[];function BT(i){sxe.push(i)}function VCt(){return sxe.slice(0)}var B_=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},es=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class zCt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new ae}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ij=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Sit(new zCt(t))):Promise.reject(new Error("Model not found"))}};ij=B_([es(0,rr)],ij);class p5{show(){return p5.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}p5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class UCt{withProgress(e,t,n){return t({report:()=>{}})}}class jCt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class KCt{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let n=e;return t&&(n=n+` +`))}}Ya.all=new Set;Ya._None=new class extends Ya{constructor(){super(0,null)}stop(){}branch(){return this}};Ya._totals=0;const OCt=new Set([cn.inMemory,cn.vscodeSourceControl,cn.walkThrough,cn.walkThroughSnippet]);class FCt{constructor(){this._byResource=new Mr,this._byOwner=new Map}set(e,t,n){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,n);let o=this._byOwner.get(t);o||(o=new Mr,this._byOwner.set(t,o)),o.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,r=!1;const o=this._byResource.get(e);o&&(n=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),n!==r)throw new Error("illegal state");return n&&r}values(e){var t,n,r,o;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:In.empty():Ft.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:In.empty():In.map(In.concat(...this._byOwner.values()),s=>s[1])}}class BCt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Mr,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);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(OCt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===vr.Error?t.errors+=1:n===vr.Warning?t.warnings+=1:n===vr.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 Pm{constructor(){this._onMarkerChanged=new KCe({delay:0,merge:Pm._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new FCt,this._stats=new BCt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(DCe(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of n){const s=Pm._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],r=this._data.values(e);if(r)for(const o of r){const s=In.first(o);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(Ms(t)){const o=new Mr;for(const{resource:s,marker:a}of t){const l=Pm._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),n.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(Pm._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(Pm._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(n??t),a=[];for(const l of s)for(const c of l)if(Pm._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Mr;for(const n of e)for(const r of n)t.set(r,!0);return Array.from(t.keys())}}class WCt extends me{constructor(){super(...arguments),this._configurationModel=new us}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new us;const e=ur.as(Rh.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const r of e){const o=n[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const B_=Sn("accessibilitySignalService");class tn{static register(e){return new tn(e.fileName)}constructor(e){this.fileName=e}}tn.error=tn.register({fileName:"error.mp3"});tn.warning=tn.register({fileName:"warning.mp3"});tn.foldedArea=tn.register({fileName:"foldedAreas.mp3"});tn.break=tn.register({fileName:"break.mp3"});tn.quickFixes=tn.register({fileName:"quickFixes.mp3"});tn.taskCompleted=tn.register({fileName:"taskCompleted.mp3"});tn.taskFailed=tn.register({fileName:"taskFailed.mp3"});tn.terminalBell=tn.register({fileName:"terminalBell.mp3"});tn.diffLineInserted=tn.register({fileName:"diffLineInserted.mp3"});tn.diffLineDeleted=tn.register({fileName:"diffLineDeleted.mp3"});tn.diffLineModified=tn.register({fileName:"diffLineModified.mp3"});tn.chatRequestSent=tn.register({fileName:"chatRequestSent.mp3"});tn.chatResponsePending=tn.register({fileName:"chatResponsePending.mp3"});tn.chatResponseReceived1=tn.register({fileName:"chatResponseReceived1.mp3"});tn.chatResponseReceived2=tn.register({fileName:"chatResponseReceived2.mp3"});tn.chatResponseReceived3=tn.register({fileName:"chatResponseReceived3.mp3"});tn.chatResponseReceived4=tn.register({fileName:"chatResponseReceived4.mp3"});tn.clear=tn.register({fileName:"clear.mp3"});tn.save=tn.register({fileName:"save.mp3"});tn.format=tn.register({fileName:"format.mp3"});class $Ct{constructor(e){this.randomOneOf=e}}class dn{static register(e){const t=new $Ct("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new dn(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return dn._signals.add(n),n}constructor(e,t,n,r,o,s){this.sound=e,this.name=t,this.legacySoundSettingsKey=n,this.settingsKey=r,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s}}dn._signals=new Set;dn.error=dn.register({name:w("accessibilitySignals.lineHasError.name","Error on Line"),sound:tn.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:w("accessibility.signals.lineHasError","Error"),settingsKey:"accessibility.signals.lineHasError"});dn.warning=dn.register({name:w("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:tn.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:w("accessibility.signals.lineHasWarning","Warning"),settingsKey:"accessibility.signals.lineHasWarning"});dn.foldedArea=dn.register({name:w("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:tn.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:w("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});dn.break=dn.register({name:w("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:tn.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:w("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});dn.inlineSuggestion=dn.register({name:w("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:tn.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});dn.terminalQuickFix=dn.register({name:w("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:tn.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:w("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});dn.onDebugBreak=dn.register({name:w("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:tn.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:w("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});dn.noInlayHints=dn.register({name:w("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:tn.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:w("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});dn.taskCompleted=dn.register({name:w("accessibilitySignals.taskCompleted","Task Completed"),sound:tn.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:w("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});dn.taskFailed=dn.register({name:w("accessibilitySignals.taskFailed","Task Failed"),sound:tn.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:w("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});dn.terminalCommandFailed=dn.register({name:w("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:tn.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:w("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});dn.terminalBell=dn.register({name:w("accessibilitySignals.terminalBell","Terminal Bell"),sound:tn.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:w("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});dn.notebookCellCompleted=dn.register({name:w("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:tn.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:w("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});dn.notebookCellFailed=dn.register({name:w("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:tn.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:w("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});dn.diffLineInserted=dn.register({name:w("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:tn.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});dn.diffLineDeleted=dn.register({name:w("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:tn.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});dn.diffLineModified=dn.register({name:w("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:tn.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});dn.chatRequestSent=dn.register({name:w("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:tn.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:w("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});dn.chatResponseReceived=dn.register({name:w("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[tn.chatResponseReceived1,tn.chatResponseReceived2,tn.chatResponseReceived3,tn.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});dn.chatResponsePending=dn.register({name:w("accessibilitySignals.chatResponsePending","Chat Response Pending"),sound:tn.chatResponsePending,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponsePending",announcementMessage:w("accessibility.signals.chatResponsePending","Chat Response Pending"),settingsKey:"accessibility.signals.chatResponsePending"});dn.clear=dn.register({name:w("accessibilitySignals.clear","Clear"),sound:tn.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:w("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});dn.save=dn.register({name:w("accessibilitySignals.save","Save"),sound:tn.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:w("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});dn.format=dn.register({name:w("accessibilitySignals.format","Format"),sound:tn.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:w("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});class HCt extends me{constructor(e,t=[]){super(),this.logger=new gst([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}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 sxe=[];function BT(i){sxe.push(i)}function VCt(){return sxe.slice(0)}var W_=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},es=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class zCt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new ae}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ij=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Sit(new zCt(t))):Promise.reject(new Error("Model not found"))}};ij=W_([es(0,or)],ij);class p5{show(){return p5.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}p5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class UCt{withProgress(e,t,n){return t({report:()=>{}})}}class jCt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class KCt{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let n=e;return t&&(n=n+` -`+t),hi.confirm(n)}async prompt(e){var t,n;let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=await((n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1}))}return{result:r}}async error(e,t){await this.prompt({type:Rr.Error,message:e,detail:t})}}class JI{info(e){return this.notify({severity:Rr.Info,message:e})}warn(e){return this.notify({severity:Rr.Warning,message:e})}error(e){return this.notify({severity:Rr.Error,message:e})}notify(e){switch(e.severity){case Rr.Error:console.error(e.message);break;case Rr.Warning:console.warn(e.message);break;default:console.log(e.message);break}return JI.NO_OP}prompt(e,t,n,r){return JI.NO_OP}status(e,t){return me.None}}JI.NO_OP=new Fpt;let rj=class{constructor(e){this._onWillExecuteCommand=new ae,this._onDidExecuteCommand=new ae,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=kn.getCommand(e);if(!n)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,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};rj=B_([es(0,Wt)],rj);let gS=class extends Vvt{constructor(e,t,n,r,o,s){super(e,t,n,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Fe;g.add(xe(f,Je.KEY_DOWN,p=>{const m=new Oi(p);this._dispatch(m,m.target)&&(m.preventDefault(),m.stopPropagation())})),g.add(xe(f,Je.KEY_UP,p=>{const m=new Oi(p);this._singleModifierDispatch(m,m.target)&&m.preventDefault()})),this._domNodeListeners.push(new GCt(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,r){return td(kn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(n=>{var r;return{keybinding:QV(n.keybinding,Ll),command:(r=n.command)!==null&&r!==void 0?r:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ot(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return hi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)n[r++]=new Uce(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=WI.resolveKeybinding(a,Ll);for(const c of l)n[r++]=new Uce(c,o.command,o.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new Bp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new WI([t],Ll)}};gS=B_([es(0,Gt),es(1,cr),es(2,ia),es(3,zr),es(4,Ra),es(5,jn)],gS);class GCt extends me{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Iue(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Ft)}class axe{constructor(){this._onDidChangeConfiguration=new ae,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new WCt;this._configuration=new Z3(e.reload(),new us,new us,new us),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,r=Iue(e)?e:Iue(t)?t:{};return this._configuration.getValue(n,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),n.push(o))}if(n.length>0){const r=new Bvt({keys:n,overrides:[]},t,this._configuration);r.source=8,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,n,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let oj=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new ae,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,n){const r=le.isIPosition(t)?t:null,o=r?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};oj=B_([es(0,mn),es(1,rr),es(2,qi)],oj);let sj=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:ka||Dn?` +`+t),hi.confirm(n)}async prompt(e){var t,n;let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=await((n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1}))}return{result:r}}async error(e,t){await this.prompt({type:Rr.Error,message:e,detail:t})}}class JI{info(e){return this.notify({severity:Rr.Info,message:e})}warn(e){return this.notify({severity:Rr.Warning,message:e})}error(e){return this.notify({severity:Rr.Error,message:e})}notify(e){switch(e.severity){case Rr.Error:console.error(e.message);break;case Rr.Warning:console.warn(e.message);break;default:console.log(e.message);break}return JI.NO_OP}prompt(e,t,n,r){return JI.NO_OP}status(e,t){return me.None}}JI.NO_OP=new Fpt;let rj=class{constructor(e){this._onWillExecuteCommand=new ae,this._onDidExecuteCommand=new ae,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=kn.getCommand(e);if(!n)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,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};rj=W_([es(0,Wt)],rj);let gS=class extends Vvt{constructor(e,t,n,r,o,s){super(e,t,n,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Fe;g.add(xe(f,Je.KEY_DOWN,p=>{const m=new Oi(p);this._dispatch(m,m.target)&&(m.preventDefault(),m.stopPropagation())})),g.add(xe(f,Je.KEY_UP,p=>{const m=new Oi(p);this._singleModifierDispatch(m,m.target)&&m.preventDefault()})),this._domNodeListeners.push(new GCt(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,r){return td(kn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(n=>{var r;return{keybinding:QV(n.keybinding,Ll),command:(r=n.command)!==null&&r!==void 0?r:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ot(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return hi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)n[r++]=new Uce(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=WI.resolveKeybinding(a,Ll);for(const c of l)n[r++]=new Uce(c,o.command,o.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new Bp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new WI([t],Ll)}};gS=W_([es(0,Gt),es(1,cr),es(2,ia),es(3,zr),es(4,Ra),es(5,jn)],gS);class GCt extends me{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Iue(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Ft)}class axe{constructor(){this._onDidChangeConfiguration=new ae,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new WCt;this._configuration=new Z3(e.reload(),new us,new us,new us),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,r=Iue(e)?e:Iue(t)?t:{};return this._configuration.getValue(n,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),n.push(o))}if(n.length>0){const r=new Bvt({keys:n,overrides:[]},t,this._configuration);r.source=8,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,n,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let oj=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new ae,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,n){const r=le.isIPosition(t)?t:null,o=r?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};oj=W_([es(0,mn),es(1,or),es(2,qi)],oj);let sj=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:ka||Dn?` `:`\r -`}};sj=B_([es(0,mn)],sj);class qCt{publicLog2(){}}class ek{constructor(){const e=Ft.from({scheme:ek.SCHEME,authority:"model",path:"/"});this.workspace={id:cSe,folders:[new i_t({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===ek.SCHEME?this.workspace.folders[0]:null}}ek.SCHEME="inmemory";function ZO(i,e,t){if(!e||!(i instanceof axe))return;const n=[];Object.keys(e).forEach(r=>{Mvt(r)&&n.push([`editor.${r}`,e[r]]),t&&Pvt(r)&&n.push([`diffEditor.${r}`,e[r]])}),n.length>0&&i.updateValues(n)}let aj=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:OZ.convert(e),r=new Map;for(const a of n){if(!(a instanceof Nv))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(Qi.replaceMove(W.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:Ob(wU.bulkEditServiceSummary,o,s),isApplied:o>0}}};aj=B_([es(0,rr)],aj);class XCt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return uu(e)}}let lj=class extends SU{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,n)}};lj=B_([es(0,xC),es(1,jn)],lj);class YCt{constructor(){this._neverEmitter=new ae,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class ZCt extends VI{constructor(){super()}}class QCt extends HCt{constructor(){super(new fst)}}let cj=class extends TU{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s),this.configure({blockMouse:!1})}};cj=B_([es(0,ia),es(1,zr),es(2,og),es(3,ci),es(4,mu),es(5,Gt)],cj);class JCt{async playSignal(e,t){}}Tn(mn,axe,0);Tn(AY,oj,0);Tn(mye,sj,0);Tn(jb,ek,0);Tn(lS,XCt,0);Tn(ia,qCt,0);Tn(kT,KCt,0);Tn(CZ,jCt,0);Tn(zr,JI,0);Tn(sg,Pm,0);Tn(qi,ZCt,0);Tn(Dc,yCt,0);Tn(Ra,QCt,0);Tn(rr,FO,0);Tn(HY,AU,0);Tn(Gt,nj,0);Tn(lSe,UCt,0);Tn(P_,p5,0);Tn(md,t0t,0);Tn(vd,bz,0);Tn(NT,aj,0);Tn(uSe,YCt,0);Tn(ul,ij,0);Tn(pd,ZU,0);Tn(Cu,wbt,0);Tn(cr,rj,0);Tn(ci,gS,0);Tn(Ph,XU,0);Tn(og,lj,0);Tn(hl,PU,0);Tn(Zp,XO,0);Tn($l,cj,0);Tn(mu,QU,0);Tn(F_,JCt,0);var jt;(function(i){const e=new IT;for(const[l,c]of vae())e.set(l,c);const t=new YO(e,!0);e.set(Wt,t);function n(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof lf?t.invokeFunction(u=>u.get(l)):c}i.get=n;let r=!1;const o=new ae;function s(l){if(r)return t;r=!0;for(const[u,d]of vae())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=Sn(u);e.get(d)instanceof lf&&e.set(d,l[u])}const c=VCt();for(const u of c)try{t.createInstance(u)}catch(d){nn(d)}return o.fire(),t}i.initialize=s;function a(l){if(r)return l();const c=new Fe,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(jt||(jt={}));class yh{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return e1t(e,this)}}const kue=new Map,uj=new WeakMap;function e1t(i,e){var t;const n=uj.get(i);if(n)return n;const r=t1t(i,e);if(r){let o=(t=kue.get(r))!==null&&t!==void 0?t:0;o++,kue.set(r,o);const s=o===1?r:`${r}#${o}`;return uj.set(i,s),s}}function t1t(i,e){const t=uj.get(i);if(t)return t;const n=e.owner?i1t(e.owner)+".":"";let r;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(r=o(),r!==void 0)return n+r}else return n+o;const s=e.referenceFn;if(s!==void 0&&(r=m5(s),r!==void 0))return n+r;if(e.owner!==void 0){const a=n1t(e.owner,i);if(a!==void 0)return n+a}}function n1t(i,e){for(const t in i)if(i[t]===e)return t}const Tue=new Map,Nue=new WeakMap;function i1t(i){var e;const t=Nue.get(i);if(t)return t;const n=r1t(i);let r=(e=Tue.get(n))!==null&&e!==void 0?e:0;r++,Tue.set(n,r);const o=r===1?n:`${n}#${r}`;return Nue.set(i,o),o}function r1t(i){const e=i.constructor;return e?e.name:"Object"}function m5(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=n?n[1]:void 0;return r==null?void 0:r.trim()}let o1t;function Wf(){return o1t}let lxe;function s1t(i){lxe=i}let cxe;function a1t(i){cxe=i}class uxe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,r=t===void 0?e:t;return cxe({owner:n,debugName:()=>{const o=m5(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(lxe(this,t)),this}}class WT extends uxe{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 Pi(i,e){const t=new v5(i,e);try{i(t)}finally{t.finish()}}let E2;function aP(i){if(E2)i(E2);else{const e=new v5(i,void 0);E2=e;try{i(e)}finally{e.finish(),E2=void 0}}}async function l1t(i,e){const t=new v5(i,e);try{await i(t)}finally{t.finish()}}function tk(i,e,t){i?e(i):Pi(e,t)}class v5{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Wf())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():m5(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let n=0;n{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=Wf())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function nk(i,e){return typeof i=="string"?new Rue(void 0,i,e):new Rue(i,void 0,e)}class Rue extends dj{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const pS=(i,e)=>i===e;function en(i,e){return e!==void 0?new mS(new yh(i,void 0,e),e,void 0,void 0,void 0,pS):new mS(new yh(void 0,void 0,i),i,void 0,void 0,void 0,pS)}function mw(i,e){var t;return new mS(new yh(i.owner,i.debugName,i.debugReferenceFn),e,void 0,void 0,i.onLastObserverRemoved,(t=i.equalityComparer)!==null&&t!==void 0?t:pS)}a1t(mw);function c1t(i,e){var t;return new mS(new yh(i.owner,i.debugName,void 0),e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:pS)}function tx(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Fe;return new mS(new yh(n,void 0,t),o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),pS)}function Im(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Fe;return new mS(new yh(n,void 0,t),o=>{r.clear();const s=t(o);return s&&r.add(s),s},void 0,void 0,()=>r.dispose(),pS)}class mS extends WT{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r,o=void 0,s){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=n,this._handleChange=r,this._handleLastObserverRemoved=o,this._equalityComparator=s,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||a===void 0?void 0:a.call(this),(l=Wf())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=Wf())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}Kw(()=>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 n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(n&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function yn(i){return new b5(new yh(void 0,void 0,i),i,void 0,void 0)}function _5(i,e){var t;return new b5(new yh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function $T(i,e){var t;return new b5(new yh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,i.createEmptyChangeSummary,i.handleChange)}function Ah(i){const e=new Fe,t=_5({owner:void 0,debugName:void 0,debugReferenceFn:i},n=>{e.clear(),i(n,e)});return Ot(()=>{t.dispose(),e.dispose()})}class b5{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r){var o,s;this._debugNameData=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=Wf())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;const o=this.disposed;try{if(!o){(e=Wf())===null||e===void 0||e.handleAutorunTriggered(this);const s=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,s)}}finally{o||(n=Wf())===null||n===void 0||n.handleAutorunFinished(this);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--,Kw(()=>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(i){i.Observer=b5})(yn||(yn={}));function fp(i){return new u1t(i)}class u1t extends uxe{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 ji(i,e){return new eb(i,e)}class eb extends WT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var r;const o=this._getValue(n),s=this.value,a=!this.hasValue||s!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,tk(eb.globalTransaction,c=>{var u;(u=Wf())===null||u===void 0||u.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const d of this.observers)c.updateObserver(d,this),d.handleChange(this,void 0)},()=>{const c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(r=Wf())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return m5(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=eb;function e(t,n){let r=!1;eb.globalTransaction===void 0&&(eb.globalTransaction=t,r=!0);try{n()}finally{r&&(eb.globalTransaction=void 0)}}i.batchEventsGlobally=e})(ji||(ji={}));function _a(i,e){return new d1t(i,e)}class d1t extends WT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Pi(n=>{for(const r of this.observers)n.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 cQ(i){return typeof i=="string"?new Mue(i):new Mue(void 0,i)}class Mue extends WT{get debugName(){var e;return(e=new yh(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Pi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function HT(i,e){const t=new h1t(!0,e);return i.addObserver(t),e?e(i.get()):i.reportChanges(),Ot(()=>{i.removeObserver(t)})}s1t(HT);class h1t{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 f1t(i){let e;return en(n=>(e=i(n,e),e))}function g1t(i,e,t,n){let r=new Pue(t,n);return mw({debugReferenceFn:t,owner:i,onLastObserverRemoved:()=>{r.dispose(),r=new Pue(t)}},s=>(r.setItems(e.read(s)),r.getItems()))}class Pue{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=[],n=new Set(this._cache.keys());for(const r of e){const o=this._keySelector?this._keySelector(r):r;let s=this._cache.get(o);if(s)n.delete(o);else{const a=new Fe;s={out:this._map(r,a),store:a},this._cache.set(o,s)}t.push(s.out)}for(const r of n)this._cache.get(r).store.dispose(),this._cache.delete(r);this._items=t}getItems(){return this._items}}function p1t(i,e,t){return new Promise((n,r)=>{let o=!0,s=!1;const a=i.map(c=>({isFinished:e(c),error:t?t(c):!1,state:c})),l=yn(c=>{const{isFinished:u,error:d,state:h}=a.read(c);(u||d)&&(o?s=!0:l.dispose(),d?r(d===!0?h:d):n(h))});o=!1,s&&l.dispose()})}class wh{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new wh(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-o}return new wh(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}function uQ(){return iV&&!!iV.VSCODE_DEV}function dxe(i){if(uQ()){const e=m1t();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function m1t(){D2||(D2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const n of D2){const r=n(t);if(r)return r}}),D2}let D2;uQ()&&dxe(({oldExports:i,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return n=>{var r,o;for(const s in n){const a=n[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=i[s];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||r===void 0?void 0:r.toString())!==((o=d==null?void 0:d.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${s}.${c}'`),Object.defineProperty(l.prototype,c,u)}n[s]=l}}}return!0}});function v1t(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const r=[];let o=0,s=0;for(;ou?(r.push(l),s++):(r.push(n(a,l)),o++,s++)}for(;o`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function I2(i,e){return i.appendChild(e),Ot(()=>{i.removeChild(e)})}class hxe extends me{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new Sye(e,t)),this._width=Vn(this,this.elementSizeObserver.getWidth()),this._height=Vn(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>Pi(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Aue(i,e,t){let n=e.get(),r=n,o=n;const s=Vn("animatedValue",n);let a=-1;const l=300;let c;t.add($T({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,h)=>(d.didChange(e)&&(h.animate=h.animate||d.change),!0)},(d,h)=>{c!==void 0&&(i.cancelAnimationFrame(c),c=void 0),r=o,n=e.read(d),a=Date.now()-(h.animate?0:l),u()}));function u(){const d=Date.now()-a;o=Math.floor(_1t(d,r,n-r,l)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class C5{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${C5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}C5._counter=0;function Pv(i,e){return yn(t=>{for(let[n,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),n=n.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),i.style[n]=r})}function uf(i,e){return b1t([i],e),i}function b1t(i,e){uQ()&&_a("reload",n=>dxe(({oldExports:r})=>{if([...Object.values(r)].some(o=>i.includes(o)))return o=>(n(void 0),!0)})).read(e)}function eF(i,e,t,n){const r=new Fe,o=[];return r.add(Ah((s,a)=>{const l=e.read(s),c=new Map,u=new Map;t&&t(!0),i.changeViewZones(d=>{for(const h of o)d.removeZone(h),n==null||n.delete(h);o.length=0;for(const h of l){const f=d.addZone(h);h.setZoneId&&h.setZoneId(f),o.push(f),n==null||n.add(f),c.set(h,f)}}),t&&t(!1),a.add($T({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(d,h){const f=u.get(d.changedObservable);return f!==void 0&&h.zoneIds.push(f),!0}},(d,h)=>{for(const f of l)f.onChange&&(u.set(f.onChange,c.get(f)),f.onChange.read(d));t&&t(!0),i.changeViewZones(f=>{for(const g of h.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),r.add({dispose(){t&&t(!0),i.changeViewZones(s=>{for(const a of o)s.removeZone(a)}),n==null||n.clear(),t&&t(!1)}}),r}class C1t extends xr{dispose(){super.dispose(!0)}}function Oue(i,e){const t=fI(e,r=>r.original.startLineNumber<=i.lineNumber);if(!t)return W.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const r=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return W.fromPositions(new le(r,i.column))}if(!t.innerChanges)return W.fromPositions(new le(t.modified.startLineNumber,1));const n=fI(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const r=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return W.fromPositions(new le(r,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const r=y1t(n.originalRange.getEndPosition(),i);return W.fromPositions(w1t(n.modifiedRange.getEndPosition(),r))}}function y1t(i,e){return i.lineNumber===e.lineNumber?new NI(0,e.column-i.column):new NI(e.lineNumber-i.lineNumber,e.column-1)}function w1t(i,e){return e.lineCount===0?new le(i.lineNumber,i.column+e.columnCount):new le(i.lineNumber+e.lineCount,e.columnCount+1)}function k2(i,e,t){const n=i.bindTo(e);return _5({debugName:()=>`Set Context Key "${i.key}"`},r=>{n.set(t(r))})}function S1t(i,e){let t;return i.filter(n=>{const r=e(n,t);return t=n,r})}var dQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hQ=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const x1t=Or("diff-review-insert",tt.add,w("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),L1t=Or("diff-review-remove",tt.remove,w("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),E1t=Or("diff-review-close",tt.close,w("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let sv=class extends me{constructor(e,t,n,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._models=l,this._instantiationService=c,this._state=tx(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(hj,this._diffs,this._models,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(fj,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Pi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Pi(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Pi(e=>{this._setVisible(!1,e)})}};sv._ttPolicy=Gp("diffReview",{createHTML:i=>i});sv=dQ([hQ(8,Wt)],sv);let hj=class extends me{constructor(e,t,n,r,o){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=r,this._accessibilitySignalService=o,this._groups=Vn(this,[]),this._currentGroupIdx=Vn(this,0),this._currentElementIdx=Vn(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(yn(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=D1t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Pi(c=>{const u=this._models.getModifiedPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===ma.Deleted?this._accessibilitySignalService.playSignal(dn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ma.Added&&this._accessibilitySignalService.playSignal(dn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(yn(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ma.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(W.fromPositions(new le(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||tk(t,r=>{this._currentGroupIdx.set(bn.ofLength(n.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||Pi(n=>{this._currentElementIdx.set(bn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&Pi(r=>{this._currentElementIdx.set(n,r)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ma.Deleted?this._models.originalReveal(W.fromPositions(new le(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ma.Header?W.fromPositions(new le(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};hj=dQ([hQ(4,F_)],hj);const _L=3;function D1t(i,e,t){const n=[];for(const r of KX(i,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*_L)){const o=[];o.push(new k1t);const s=new vn(Math.max(1,r[0].original.startLineNumber-_L),Math.min(r[r.length-1].original.endLineNumberExclusive+_L,e+1)),a=new vn(Math.max(1,r[0].modified.startLineNumber-_L),Math.min(r[r.length-1].modified.endLineNumberExclusive+_L,t+1));ECe(r,(u,d)=>{const h=new vn(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new vn(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new R1t(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new T1t(d,g))}),d.modified.forEach(g=>{o.push(new N1t(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);n.push(new I1t(new el(l,c),o))}return n}var ma;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ma||(ma={}));class I1t{constructor(e,t){this.range=e,this.lines=t}}class k1t{constructor(){this.type=ma.Header}}class T1t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ma.Deleted,this.modifiedLineNumber=void 0}}class N1t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ma.Added,this.originalLineNumber=void 0}}class R1t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ma.Unchanged}}let fj=class extends me{constructor(e,t,n,r,o,s){super(),this._element=e,this._model=t,this._width=n,this._height=r,this._models=o,this._languageService=s,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 du(a)),this._register(yn(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Il("diffreview.close",w("label.close","Close"),"close-diff-review "+Vt.asClassName(E1t),!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 ST(this._content,{})),ms(this.domNode,this._scrollbar.getDomNode(),a),this._register(yn(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Ot(()=>{ms(this.domNode)})),this._register(Pv(this.domNode,{width:this._width,height:this._height})),this._register(Pv(this._content,{width:this._width,height:this._height})),this._register(Ah((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Lr(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(),n=this._models.getModifiedOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",w("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),vs(r,n.get(50)),ms(this._content,r);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=n.get(67),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===ma.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,m=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,_=E=>E===0?w("no_lines_changed","no lines changed"):E===1?w("one_line_changed","1 line changed"):w("more_lines_changed","{0} lines changed",E),y=_(p.original.length),S=_(p.modified.length);g.setAttribute("aria-label",w({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}",m+1,v,p.original.startLineNumber,y,p.modified.startLineNumber,S));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${m+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,n,s,l);r.appendChild(h);const f=en(g=>this._model.currentElement.read(g)===d);e.add(yn(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(xe(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,r,o,s,a,l,c){const u=r.get(144),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(144),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let v=null;switch(e.type){case ma.Added:g="diff-review-row line-insert",p=" char-insert",v=x1t;break;case ma.Deleted:g="diff-review-row line-delete",p=" char-delete",v=L1t;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);const S=document.createElement("span");S.style.width=d+"px",S.style.minWidth=d+"px",S.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.originalLineNumber))):S.innerText=" ",y.appendChild(S);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText=" ",y.appendChild(L);const E=document.createElement("span");if(E.className=m,v){const T=document.createElement("span");T.className=Vt.asClassName(v),T.innerText="  ",E.appendChild(T)}else E.innerText="  ";y.appendChild(E);let D;if(e.modifiedLineNumber!==void 0){let T=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);sv._ttPolicy&&(T=sv._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=l.getLineContent(e.modifiedLineNumber)}else{let T=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);sv._ttPolicy&&(T=sv._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=o.getLineContent(e.originalLineNumber)}D.length===0&&(D=w("blankLine","blank"));let k="";switch(e.type){case ma.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=w({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",D,e.originalLineNumber):k=w("equalLine","{0} original line {1} modified line {2}",D,e.originalLineNumber,e.modifiedLineNumber);break;case ma.Added:k=w("insertLine","+ {0} modified line {1}",D,e.modifiedLineNumber);break;case ma.Deleted:k=w("deleteLine","- {0} original line {1}",D,e.originalLineNumber);break}return _.setAttribute("aria-label",k),_}_getLineHtml(e,t,n,r,o){const s=e.getLineContent(r),a=t.get(50),l=Io.createEmpty(s,o),c=yc.isBasicASCII(s,e.mightContainNonBasicASCII()),u=yc.containsRTL(s,c,e.mightContainRTL());return T3(new R_(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==ac.OFF,null)).html}};fj=dQ([hQ(5,qi)],fj);class M1t{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(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class Av extends me{constructor(e,t,n,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=ji(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ji(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=_a("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Vn(this,0),this._modifiedViewZonesChangedSignal=_a("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=_a("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=tx(this,(u,d)=>{var h;this._element.replaceChildren();const f=this._diffModel.read(u),g=(h=f==null?void 0:f.diff.read(u))===null||h===void 0?void 0:h.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(u);const p=this._originalEditorLayoutInfo.read(u),m=this._modifiedEditorLayoutInfo.read(u);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(u),this._originalViewZonesChangedSignal.read(u);const v=g.map(k=>{function T(U,j){const ie=j.getTopForLineNumber(U.startLineNumber,!0),Y=j.getTopForLineNumber(U.endLineNumberExclusive,!0);return(ie+Y)/2}const M=T(k.lineRangeMapping.original,this._editors.original),P=this._originalScrollTop.read(u),N=T(k.lineRangeMapping.modified,this._editors.modified),R=this._modifiedScrollTop.read(u),O=M-P,B=N-R,$=Math.min(M,N),G=Math.max(M,N);return{range:new bn($,G),from:O,to:B,fromWithoutScroll:M,toWithoutScroll:N,move:k}});v.sort(lnt(nu(k=>k.fromWithoutScroll>k.toWithoutScroll,cnt),nu(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,mp)));const _=fQ.compute(v.map(k=>k.range)),y=10,S=p.verticalScrollbarWidth,L=(_.getTrackCount()-1)*10+y*2,E=S+L+(m.contentLeft-Av.movedCodeBlockPadding);let D=0;for(const k of v){const T=_.getTrack(D),M=S+y+T*10,P=15,N=15,R=E,O=m.glyphMarginWidth+m.lineNumbersWidth,B=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${R-O}`),$.setAttribute("y",`${k.to-B/2}`),$.setAttribute("width",`${O}`),$.setAttribute("height",`${B}`),this._element.appendChild($);const G=document.createElementNS("http://www.w3.org/2000/svg","g"),U=document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d",`M 0 ${k.from} L ${M} ${k.from} L ${M} ${k.to} L ${R-N} ${k.to}`),U.setAttribute("fill","none"),G.appendChild(U);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),d.add(yn(ie=>{U.classList.toggle("currentMove",k.move===f.activeMovedText.read(ie)),j.classList.toggle("currentMove",k.move===f.activeMovedText.read(ie))})),j.setAttribute("points",`${R-N},${k.to-P/2} ${R},${k.to} ${R-N},${k.to+P/2}`),G.appendChild(j),this._element.appendChild(G),D++}this.width.set(L,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(Ot(()=>this._element.remove())),this._register(yn(u=>{const d=this._originalEditorLayoutInfo.read(u),h=this._modifiedEditorLayoutInfo.read(u);!d||!h||(this._element.style.left=`${d.width-d.verticalScrollbarWidth}px`,this._element.style.height=`${d.height}px`,this._element.style.width=`${d.verticalScrollbarWidth+d.contentLeft-Av.movedCodeBlockPadding+this.width.read(u)}px`)})),this._register(HT(this._state));const s=en(u=>{const d=this._diffModel.read(u),h=d==null?void 0:d.diff.read(u);return h?h.movedTexts.map(f=>({move:f,original:new JO(fp(f.lineRangeMapping.original.startLineNumber-1),18),modified:new JO(fp(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(eF(this._editors.original,s.map(u=>u.map(d=>d.original)))),this._register(eF(this._editors.modified,s.map(u=>u.map(d=>d.modified)))),this._register(Ah((u,d)=>{const h=s.read(u);for(const f of h)d.add(new Fue(this._editors.original,f.original,f.move,"original",this._diffModel.get())),d.add(new Fue(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=_a("original.onDidFocusEditorWidget",u=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0))),l=_a("modified.onDidFocusEditorWidget",u=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0)));let c="modified";this._register($T({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 h=d.diff.read(u);let f;if(h&&c==="original"){const g=this._editors.originalCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(h&&c==="modified"){const g=this._editors.modifiedCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==d.movedTextToCompare.get()&&d.movedTextToCompare.set(void 0,void 0),d.setActiveMovedText(f)}))}}Av.movedCodeBlockPadding=4;class fQ{static compute(e){const t=[],n=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=Aat(t,nu(a=>a.intersectWithRangeLength(r),mp)):(o=t.length,t.push(new NY))),t[o].addRange(r),n.push(o)}return new fQ(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Fue extends fxe{constructor(e,t,n,r,o){const s=pi("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=r,this._diffModel=o,this._nodes=pi("div.diff-moved-code-block",{style:{marginRight:"4px"}},[pi("div.text-content@textContent"),pi("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=ji(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Pv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?w("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?w("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new du(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Il("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Il("","Compare",Vt.asClassName(tt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(yn(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}X("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},w("diffEditor.move.border","The border color for text that got moved in the diff editor."));X("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},w("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));X("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},w("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const P1t=Or("diff-insert",tt.add,w("diffInsertIcon","Line decoration for inserts in the diff editor.")),gxe=Or("diff-remove",tt.remove,w("diffRemoveIcon","Line decoration for removals in the diff editor.")),Bue=an.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Vt.asClassName(P1t),marginClassName:"gutter-insert"}),Wue=an.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Vt.asClassName(gxe),marginClassName:"gutter-delete"}),$ue=an.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Hue=an.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Vue=an.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),A1t=an.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),O1t=an.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),gj=an.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),F1t=an.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),B1t=an.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class W1t extends me{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=en(this,o=>{var s;const a=(s=this._diffModel.read(o))===null||s===void 0?void 0:s.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),u=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Wue:Hue}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?Bue:$ue}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:F1t}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:A1t});else for(const p of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&u?B1t:gj}),g.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&u?O1t:Vue});if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&d.push({range:p,options:c?Wue:Hue});const m=g.modified.toInclusiveRange();m&&h.push({range:m,options:c?Bue:$ue});for(const v of g.innerChanges||[])d.push({range:v.originalRange,options:gj}),h.push({range:v.modifiedRange,options:Vue})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[Av.movedCodeBlockPadding,0,Av.movedCodeBlockPadding,Av.movedCodeBlockPadding]}}),h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(QO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(QO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class $1t extends me{constructor(e,t,n,r){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashes=r,this._sashRatio=Vn(this,void 0),this.sashLeft=en(this,o=>{var s;const a=(s=this._sashRatio.read(o))!==null&&s!==void 0?s:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(a,o)}),this._sash=this._register(new Is(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>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(o=>{const s=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/s,void 0);this._sashRatio.set(a/s,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(yn(o=>{const s=this._sashes.read(o);s&&(this._sash.orthogonalEndSash=s.bottom)})),this._register(yn(o=>{const s=this._options.enableSplitViewResizing.read(o);this._sash.state=s?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):r,s=100;return n<=s*2?r:on-s?n-s:o}}var H1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},V1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pj;let ik=pj=class extends me{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._instantiationService=r,this._modifiedOutlineSource=Im(this,l=>{const c=this._editors.modifiedModel.read(l),u=pj._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===3){const c=this._diffModel.get();Pi(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===3){const c=this._diffModel.get();Pi(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 o=this._diffModel.map((l,c)=>{var u,d;const h=(u=l==null?void 0:l.unchangedRegions.read(c))!==null&&u!==void 0?u:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((d=this._editors.modifiedModel.read(c))===null||d===void 0?void 0:d.getLineCount())?[]:h});this.viewZones=tx(this,(l,c)=>{const u=this._modifiedOutlineSource.read(l);if(!u)return{origViewZones:[],modViewZones:[]};const d=[],h=[],f=this._options.renderSideBySide.read(l),g=o.read(l);for(const p of g)if(!p.shouldHideControls(l)){{const m=en(this,_=>p.getHiddenOriginalRange(_).startLineNumber-1),v=new JO(m,24);d.push(v),c.add(new zue(this._editors.original,v,p,p.originalUnchangedRange,!f,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}{const m=en(this,_=>p.getHiddenModifiedRange(_).startLineNumber-1),v=new JO(m,24);h.push(v),c.add(new zue(this._editors.modified,v,p,p.modifiedUnchangedRange,!1,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}}return{origViewZones:d,modViewZones:h}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Ns(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(w("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Vt.asClassName(tt.fold),zIndex:10001};this._register(QO(this._editors.original,en(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.originalUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:W.fromPositions(new le(d.originalLineNumber,1)),options:a});return u}))),this._register(QO(this._editors.modified,en(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:vn.ofLength(d.modifiedLineNumber,1).toInclusiveRange(),options:a});return u}))),this._register(yn(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(u=>u.getHiddenOriginalRange(l).toInclusiveRange()).filter(Pf)),this._editors.modified.setHiddenAreas(c.map(u=>u.getHiddenModifiedRange(l).toInclusiveRange()).filter(Pf))}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===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(u));if(!h)return;h.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===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};ik._breadcrumbsSourceFactory=Vn("breadcrumbsSourceFactory",void 0);ik=pj=H1t([V1t(3,Wt)],ik);class zue extends fxe{constructor(e,t,n,r,o,s,a,l){const c=pi("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=r,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=pi("div.diff-hidden-lines",[pi("div.top@top",{title:w("diff.hiddenLines.top","Click or drag to show more above")}),pi("div.center@content",{style:{display:"flex"}},[pi("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Xe("a",{title:w("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Tv("$(unfold)"))]),pi("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),pi("div.bottom@bottom",{title:w("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=ji(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?ms(this._nodes.first):this._register(Pv(this._nodes.first,{width:u.map(h=>h.contentLeft)})),this._register(yn(h=>{const f=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!f)):g==="bottom"?(p.classList.toggle("canMoveTop",!f),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(xe(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=Bt(this._nodes.top),v=xe(m,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),_=xe(m,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),_.dispose()})})),this._register(xe(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=Bt(this._nodes.bottom),v=xe(m,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p-E,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const T=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(T-k))}),_=xe(m,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const S=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-S))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),_.dispose()})})),this._register(yn(h=>{const f=[];if(!this._hide){const g=n.getHiddenModifiedRange(h).length,p=w("hiddenLines","{0} hidden lines",g),m=Xe("span",{title:w("diff.hiddenLines.expandAll","Double click to unfold")},p);m.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(_.length>0){f.push(Xe("span",void 0,"  |  "));for(let y=0;y<_.length;y++){const S=_[y],L=MA.toIcon(S.kind),E=pi("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[FI(L)," ",S.name,...y===_.length-1?[]:[FI(tt.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(S.startLineNumber)}}}}ms(this._nodes.others,...f)}))}}var pxe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mj=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w0;const mxe=Sn("diffProviderFactoryService");let vj=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(tF,e)}};vj=pxe([mj(0,Wt)],vj);Tn(mxe,vj,1);let tF=w0=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new ae,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,n,r){var o,s;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new mh(new vn(1,2),new vn(1,t.getLineCount()+1),[new e_(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=w0.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Fs.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return w0.diffCache.size>10&&w0.diffCache.delete(w0.diffCache.keys().next().value),w0.diffCache.set(a,{result:d,context:l}),d}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};tF.diffCache=new Map;tF=w0=pxe([mj(1,vd),mj(2,ia)],tF);var z1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _j=class extends me{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Vn(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Vn(this,void 0),this.diff=this._diff,this._unchangedRegions=Vn(this,void 0),this.unchangedRegions=en(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(Pi(u=>{var d;for(const h of((d=this._unchangedRegions.get())===null||d===void 0?void 0:d.regions)||[])h.collapseAll(u)}),[])}),this.movedTextToCompare=Vn(this,void 0),this._activeMovedText=Vn(this,void 0),this._hoveredMovedText=Vn(this,void 0),this.activeMovedText=en(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new xr,this._diffProvider=en(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=_a("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Ot(()=>this._cancellationTokenSource.cancel()));const r=cQ("contentChangedSignal"),o=this._register(new mi(()=>r.trigger(void 0),200));this._register(yn(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?vn.fromRangeInclusive(g):void 0),u=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?vn.fromRangeInclusive(g):void 0),d=l.regions.map((g,p)=>!c[p]||!u[p]?void 0:new av(c[p].startLineNumber,u[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Pf),h=[];let f=!1;for(const g of KX(d,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((v,_)=>v+_.lineCount,0),m=new av(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());h.push(m)}else h.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,h.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Pi(m=>{this._unchangedRegions.set({regions:h,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const s=(a,l,c)=>{const u=av.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let d;const h=this._unchangedRegions.get();if(h){const m=h.originalDecorationIds.map(S=>e.original.getDecorationRange(S)).map(S=>S?vn.fromRangeInclusive(S):void 0),v=h.modifiedDecorationIds.map(S=>e.modified.getDecorationRange(S)).map(S=>S?vn.fromRangeInclusive(S):void 0);let y=S1t(h.regions.map((S,L)=>{if(!m[L]||!v[L])return;const E=m[L].length;return new av(m[L].startLineNumber,v[L].startLineNumber,E,Math.min(S.visibleLineCountTop.get(),E),Math.min(S.visibleLineCountBottom.get(),E-S.visibleLineCountTop.get()))}).filter(Pf),(S,L)=>!L||S.modifiedLineNumber>=L.modifiedLineNumber+L.lineCount&&S.originalLineNumber>=L.originalLineNumber+L.lineCount).map(S=>new el(S.getHiddenOriginalRange(c),S.getHiddenModifiedRange(c)));y=el.clip(y,vn.ofLength(1,e.original.getLineCount()),vn.ofLength(1,e.modified.getLineCount())),d=el.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(d)for(const m of u){const v=d.filter(_=>_.original.intersectsStrict(m.originalUnchangedRange)&&_.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(v,l))}else f.push(...u);const g=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=dp.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=dp.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Ah(async(a,l)=>{var c,u;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),r.read(a);const d=this._diffProvider.read(a);d.onChangeSignal.read(a),uf(gye,a),uf(_z,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(p=>{const m=dp.fromModelContentChanges(p.changes);h=dO(h,m)}));let f=[];l.add(e.modified.onDidChangeContent(p=>{const m=dp.fromModelContentChanges(p.changes);f=dO(f,m)}));let g=await d.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||(g=j1t(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:g,Pi(p=>{s(g,p),this._lastDiff=g;const m=gQ.fromDiffResult(g);this._diff.set(m,p),this._isDiffUpToDate.set(!0,p);const v=this.movedTextToCompare.get();this.movedTextToCompare.set(v?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(v.lineRangeMapping.modified)):void 0,p)}))}))}ensureModifiedLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,n);return}}async waitForDiff(){await p1t(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 t;const n=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>vn.deserialize(o.range)),r=this._unchangedRegions.get();!r||!n||Pi(o=>{for(const s of r.regions)for(const a of n)if(s.modifiedUnchangedRange.intersect(a)){s.setHiddenModifiedRange(a,o);break}})}};_j=z1t([U1t(2,mxe)],_j);function j1t(i,e,t){return{changes:i.changes.map(n=>new mh(n.original,n.modified,n.innerChanges?n.innerChanges.map(r=>K1t(r,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function K1t(i,e,t){let n=i.originalRange,r=i.modifiedRange;return(n.endColumn!==1||r.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&n.endLineNumbernew vxe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,r){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=r}}class vxe{constructor(e){this.lineRangeMapping=e}}class av{static fromDiffs(e,t,n,r,o){const s=mh.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new av(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new av(c,u,d,0,0)))}return a}get originalUnchangedRange(){return vn.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return vn.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Vn(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Vn(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=en(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Vn(this,void 0);const s=Math.max(Math.min(r,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-r),0);lae(r===s),lae(o===a),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],r=new Uu(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,s=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(r.ranges.length===0)this.showAll(t),n.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)-s,h=new av(o,s,d,0,0);h.setHiddenModifiedRange(c,t),n.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,s=h.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return vn.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return vn.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&r{var m;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(m=n.getDomNode())!==null&&m!==void 0?m:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],_=r.modified.isEmpty;return v.push(new Il("diff.clipboard.copyDeletedContent",_?r.original.length>1?w("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):w("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?w("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):w("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());await this._clipboardService.writeText(S)})),r.original.length>1&&v.push(new Il("diff.clipboard.copyDeletedLineContent",_?w("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):w("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(r.original.startLineNumber+d);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` +`}};sj=W_([es(0,mn)],sj);class qCt{publicLog2(){}}class ek{constructor(){const e=Ft.from({scheme:ek.SCHEME,authority:"model",path:"/"});this.workspace={id:cSe,folders:[new i_t({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===ek.SCHEME?this.workspace.folders[0]:null}}ek.SCHEME="inmemory";function ZO(i,e,t){if(!e||!(i instanceof axe))return;const n=[];Object.keys(e).forEach(r=>{Mvt(r)&&n.push([`editor.${r}`,e[r]]),t&&Pvt(r)&&n.push([`diffEditor.${r}`,e[r]])}),n.length>0&&i.updateValues(n)}let aj=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:OZ.convert(e),r=new Map;for(const a of n){if(!(a instanceof Nv))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(Ji.replaceMove(W.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:Fb(wU.bulkEditServiceSummary,o,s),isApplied:o>0}}};aj=W_([es(0,or)],aj);class XCt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return uu(e)}}let lj=class extends SU{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,n)}};lj=W_([es(0,xC),es(1,jn)],lj);class YCt{constructor(){this._neverEmitter=new ae,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class ZCt extends VI{constructor(){super()}}class QCt extends HCt{constructor(){super(new fst)}}let cj=class extends TU{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s),this.configure({blockMouse:!1})}};cj=W_([es(0,ia),es(1,zr),es(2,og),es(3,ci),es(4,mu),es(5,Gt)],cj);class JCt{async playSignal(e,t){}}Tn(mn,axe,0);Tn(AY,oj,0);Tn(mye,sj,0);Tn(Kb,ek,0);Tn(lS,XCt,0);Tn(ia,qCt,0);Tn(kT,KCt,0);Tn(CZ,jCt,0);Tn(zr,JI,0);Tn(sg,Pm,0);Tn(qi,ZCt,0);Tn(Dc,yCt,0);Tn(Ra,QCt,0);Tn(or,FO,0);Tn(HY,AU,0);Tn(Gt,nj,0);Tn(lSe,UCt,0);Tn(A_,p5,0);Tn(md,t0t,0);Tn(vd,bz,0);Tn(NT,aj,0);Tn(uSe,YCt,0);Tn(ul,ij,0);Tn(pd,ZU,0);Tn(Cu,wbt,0);Tn(cr,rj,0);Tn(ci,gS,0);Tn(Ph,XU,0);Tn(og,lj,0);Tn(hl,PU,0);Tn(Zp,XO,0);Tn($l,cj,0);Tn(mu,QU,0);Tn(B_,JCt,0);var jt;(function(i){const e=new IT;for(const[l,c]of vae())e.set(l,c);const t=new YO(e,!0);e.set(Wt,t);function n(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof lf?t.invokeFunction(u=>u.get(l)):c}i.get=n;let r=!1;const o=new ae;function s(l){if(r)return t;r=!0;for(const[u,d]of vae())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=Sn(u);e.get(d)instanceof lf&&e.set(d,l[u])}const c=VCt();for(const u of c)try{t.createInstance(u)}catch(d){nn(d)}return o.fire(),t}i.initialize=s;function a(l){if(r)return l();const c=new Fe,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(jt||(jt={}));class yh{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return e1t(e,this)}}const kue=new Map,uj=new WeakMap;function e1t(i,e){var t;const n=uj.get(i);if(n)return n;const r=t1t(i,e);if(r){let o=(t=kue.get(r))!==null&&t!==void 0?t:0;o++,kue.set(r,o);const s=o===1?r:`${r}#${o}`;return uj.set(i,s),s}}function t1t(i,e){const t=uj.get(i);if(t)return t;const n=e.owner?i1t(e.owner)+".":"";let r;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(r=o(),r!==void 0)return n+r}else return n+o;const s=e.referenceFn;if(s!==void 0&&(r=m5(s),r!==void 0))return n+r;if(e.owner!==void 0){const a=n1t(e.owner,i);if(a!==void 0)return n+a}}function n1t(i,e){for(const t in i)if(i[t]===e)return t}const Tue=new Map,Nue=new WeakMap;function i1t(i){var e;const t=Nue.get(i);if(t)return t;const n=r1t(i);let r=(e=Tue.get(n))!==null&&e!==void 0?e:0;r++,Tue.set(n,r);const o=r===1?n:`${n}#${r}`;return Nue.set(i,o),o}function r1t(i){const e=i.constructor;return e?e.name:"Object"}function m5(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=n?n[1]:void 0;return r==null?void 0:r.trim()}let o1t;function Wf(){return o1t}let lxe;function s1t(i){lxe=i}let cxe;function a1t(i){cxe=i}class uxe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,r=t===void 0?e:t;return cxe({owner:n,debugName:()=>{const o=m5(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(lxe(this,t)),this}}class WT extends uxe{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 Pi(i,e){const t=new v5(i,e);try{i(t)}finally{t.finish()}}let E2;function aP(i){if(E2)i(E2);else{const e=new v5(i,void 0);E2=e;try{i(e)}finally{e.finish(),E2=void 0}}}async function l1t(i,e){const t=new v5(i,e);try{await i(t)}finally{t.finish()}}function tk(i,e,t){i?e(i):Pi(e,t)}class v5{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Wf())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():m5(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let n=0;n{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=Wf())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function nk(i,e){return typeof i=="string"?new Rue(void 0,i,e):new Rue(i,void 0,e)}class Rue extends dj{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const pS=(i,e)=>i===e;function en(i,e){return e!==void 0?new mS(new yh(i,void 0,e),e,void 0,void 0,void 0,pS):new mS(new yh(void 0,void 0,i),i,void 0,void 0,void 0,pS)}function mw(i,e){var t;return new mS(new yh(i.owner,i.debugName,i.debugReferenceFn),e,void 0,void 0,i.onLastObserverRemoved,(t=i.equalityComparer)!==null&&t!==void 0?t:pS)}a1t(mw);function c1t(i,e){var t;return new mS(new yh(i.owner,i.debugName,void 0),e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:pS)}function tx(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Fe;return new mS(new yh(n,void 0,t),o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),pS)}function Im(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Fe;return new mS(new yh(n,void 0,t),o=>{r.clear();const s=t(o);return s&&r.add(s),s},void 0,void 0,()=>r.dispose(),pS)}class mS extends WT{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r,o=void 0,s){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=n,this._handleChange=r,this._handleLastObserverRemoved=o,this._equalityComparator=s,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||a===void 0?void 0:a.call(this),(l=Wf())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=Wf())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}Kw(()=>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 n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(n&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function yn(i){return new b5(new yh(void 0,void 0,i),i,void 0,void 0)}function _5(i,e){var t;return new b5(new yh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function $T(i,e){var t;return new b5(new yh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,i.createEmptyChangeSummary,i.handleChange)}function Ah(i){const e=new Fe,t=_5({owner:void 0,debugName:void 0,debugReferenceFn:i},n=>{e.clear(),i(n,e)});return Ot(()=>{t.dispose(),e.dispose()})}class b5{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r){var o,s;this._debugNameData=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=Wf())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;const o=this.disposed;try{if(!o){(e=Wf())===null||e===void 0||e.handleAutorunTriggered(this);const s=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,s)}}finally{o||(n=Wf())===null||n===void 0||n.handleAutorunFinished(this);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--,Kw(()=>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(i){i.Observer=b5})(yn||(yn={}));function fp(i){return new u1t(i)}class u1t extends uxe{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 ji(i,e){return new tb(i,e)}class tb extends WT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var r;const o=this._getValue(n),s=this.value,a=!this.hasValue||s!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,tk(tb.globalTransaction,c=>{var u;(u=Wf())===null||u===void 0||u.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const d of this.observers)c.updateObserver(d,this),d.handleChange(this,void 0)},()=>{const c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(r=Wf())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return m5(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=tb;function e(t,n){let r=!1;tb.globalTransaction===void 0&&(tb.globalTransaction=t,r=!0);try{n()}finally{r&&(tb.globalTransaction=void 0)}}i.batchEventsGlobally=e})(ji||(ji={}));function _a(i,e){return new d1t(i,e)}class d1t extends WT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Pi(n=>{for(const r of this.observers)n.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 cQ(i){return typeof i=="string"?new Mue(i):new Mue(void 0,i)}class Mue extends WT{get debugName(){var e;return(e=new yh(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Pi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function HT(i,e){const t=new h1t(!0,e);return i.addObserver(t),e?e(i.get()):i.reportChanges(),Ot(()=>{i.removeObserver(t)})}s1t(HT);class h1t{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 f1t(i){let e;return en(n=>(e=i(n,e),e))}function g1t(i,e,t,n){let r=new Pue(t,n);return mw({debugReferenceFn:t,owner:i,onLastObserverRemoved:()=>{r.dispose(),r=new Pue(t)}},s=>(r.setItems(e.read(s)),r.getItems()))}class Pue{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=[],n=new Set(this._cache.keys());for(const r of e){const o=this._keySelector?this._keySelector(r):r;let s=this._cache.get(o);if(s)n.delete(o);else{const a=new Fe;s={out:this._map(r,a),store:a},this._cache.set(o,s)}t.push(s.out)}for(const r of n)this._cache.get(r).store.dispose(),this._cache.delete(r);this._items=t}getItems(){return this._items}}function p1t(i,e,t){return new Promise((n,r)=>{let o=!0,s=!1;const a=i.map(c=>({isFinished:e(c),error:t?t(c):!1,state:c})),l=yn(c=>{const{isFinished:u,error:d,state:h}=a.read(c);(u||d)&&(o?s=!0:l.dispose(),d?r(d===!0?h:d):n(h))});o=!1,s&&l.dispose()})}class wh{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new wh(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-o}return new wh(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}function uQ(){return iV&&!!iV.VSCODE_DEV}function dxe(i){if(uQ()){const e=m1t();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function m1t(){D2||(D2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const n of D2){const r=n(t);if(r)return r}}),D2}let D2;uQ()&&dxe(({oldExports:i,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return n=>{var r,o;for(const s in n){const a=n[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=i[s];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||r===void 0?void 0:r.toString())!==((o=d==null?void 0:d.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${s}.${c}'`),Object.defineProperty(l.prototype,c,u)}n[s]=l}}}return!0}});function v1t(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const r=[];let o=0,s=0;for(;ou?(r.push(l),s++):(r.push(n(a,l)),o++,s++)}for(;o`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function I2(i,e){return i.appendChild(e),Ot(()=>{i.removeChild(e)})}class hxe extends me{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new Sye(e,t)),this._width=Vn(this,this.elementSizeObserver.getWidth()),this._height=Vn(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>Pi(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Aue(i,e,t){let n=e.get(),r=n,o=n;const s=Vn("animatedValue",n);let a=-1;const l=300;let c;t.add($T({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,h)=>(d.didChange(e)&&(h.animate=h.animate||d.change),!0)},(d,h)=>{c!==void 0&&(i.cancelAnimationFrame(c),c=void 0),r=o,n=e.read(d),a=Date.now()-(h.animate?0:l),u()}));function u(){const d=Date.now()-a;o=Math.floor(_1t(d,r,n-r,l)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class C5{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${C5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}C5._counter=0;function Pv(i,e){return yn(t=>{for(let[n,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),n=n.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),i.style[n]=r})}function uf(i,e){return b1t([i],e),i}function b1t(i,e){uQ()&&_a("reload",n=>dxe(({oldExports:r})=>{if([...Object.values(r)].some(o=>i.includes(o)))return o=>(n(void 0),!0)})).read(e)}function eF(i,e,t,n){const r=new Fe,o=[];return r.add(Ah((s,a)=>{const l=e.read(s),c=new Map,u=new Map;t&&t(!0),i.changeViewZones(d=>{for(const h of o)d.removeZone(h),n==null||n.delete(h);o.length=0;for(const h of l){const f=d.addZone(h);h.setZoneId&&h.setZoneId(f),o.push(f),n==null||n.add(f),c.set(h,f)}}),t&&t(!1),a.add($T({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(d,h){const f=u.get(d.changedObservable);return f!==void 0&&h.zoneIds.push(f),!0}},(d,h)=>{for(const f of l)f.onChange&&(u.set(f.onChange,c.get(f)),f.onChange.read(d));t&&t(!0),i.changeViewZones(f=>{for(const g of h.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),r.add({dispose(){t&&t(!0),i.changeViewZones(s=>{for(const a of o)s.removeZone(a)}),n==null||n.clear(),t&&t(!1)}}),r}class C1t extends xr{dispose(){super.dispose(!0)}}function Oue(i,e){const t=fI(e,r=>r.original.startLineNumber<=i.lineNumber);if(!t)return W.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const r=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return W.fromPositions(new le(r,i.column))}if(!t.innerChanges)return W.fromPositions(new le(t.modified.startLineNumber,1));const n=fI(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const r=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return W.fromPositions(new le(r,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const r=y1t(n.originalRange.getEndPosition(),i);return W.fromPositions(w1t(n.modifiedRange.getEndPosition(),r))}}function y1t(i,e){return i.lineNumber===e.lineNumber?new NI(0,e.column-i.column):new NI(e.lineNumber-i.lineNumber,e.column-1)}function w1t(i,e){return e.lineCount===0?new le(i.lineNumber,i.column+e.columnCount):new le(i.lineNumber+e.lineCount,e.columnCount+1)}function k2(i,e,t){const n=i.bindTo(e);return _5({debugName:()=>`Set Context Key "${i.key}"`},r=>{n.set(t(r))})}function S1t(i,e){let t;return i.filter(n=>{const r=e(n,t);return t=n,r})}var dQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hQ=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const x1t=Or("diff-review-insert",tt.add,w("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),L1t=Or("diff-review-remove",tt.remove,w("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),E1t=Or("diff-review-close",tt.close,w("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let sv=class extends me{constructor(e,t,n,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._models=l,this._instantiationService=c,this._state=tx(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(hj,this._diffs,this._models,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(fj,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Pi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Pi(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Pi(e=>{this._setVisible(!1,e)})}};sv._ttPolicy=Gp("diffReview",{createHTML:i=>i});sv=dQ([hQ(8,Wt)],sv);let hj=class extends me{constructor(e,t,n,r,o){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=r,this._accessibilitySignalService=o,this._groups=Vn(this,[]),this._currentGroupIdx=Vn(this,0),this._currentElementIdx=Vn(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(yn(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=D1t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Pi(c=>{const u=this._models.getModifiedPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===ma.Deleted?this._accessibilitySignalService.playSignal(dn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ma.Added&&this._accessibilitySignalService.playSignal(dn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(yn(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ma.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(W.fromPositions(new le(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||tk(t,r=>{this._currentGroupIdx.set(bn.ofLength(n.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||Pi(n=>{this._currentElementIdx.set(bn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&Pi(r=>{this._currentElementIdx.set(n,r)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ma.Deleted?this._models.originalReveal(W.fromPositions(new le(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ma.Header?W.fromPositions(new le(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};hj=dQ([hQ(4,B_)],hj);const _L=3;function D1t(i,e,t){const n=[];for(const r of KX(i,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*_L)){const o=[];o.push(new k1t);const s=new vn(Math.max(1,r[0].original.startLineNumber-_L),Math.min(r[r.length-1].original.endLineNumberExclusive+_L,e+1)),a=new vn(Math.max(1,r[0].modified.startLineNumber-_L),Math.min(r[r.length-1].modified.endLineNumberExclusive+_L,t+1));ECe(r,(u,d)=>{const h=new vn(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new vn(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new R1t(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new T1t(d,g))}),d.modified.forEach(g=>{o.push(new N1t(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);n.push(new I1t(new el(l,c),o))}return n}var ma;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ma||(ma={}));class I1t{constructor(e,t){this.range=e,this.lines=t}}class k1t{constructor(){this.type=ma.Header}}class T1t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ma.Deleted,this.modifiedLineNumber=void 0}}class N1t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ma.Added,this.originalLineNumber=void 0}}class R1t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ma.Unchanged}}let fj=class extends me{constructor(e,t,n,r,o,s){super(),this._element=e,this._model=t,this._width=n,this._height=r,this._models=o,this._languageService=s,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 du(a)),this._register(yn(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Il("diffreview.close",w("label.close","Close"),"close-diff-review "+Vt.asClassName(E1t),!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 ST(this._content,{})),ms(this.domNode,this._scrollbar.getDomNode(),a),this._register(yn(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Ot(()=>{ms(this.domNode)})),this._register(Pv(this.domNode,{width:this._width,height:this._height})),this._register(Pv(this._content,{width:this._width,height:this._height})),this._register(Ah((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Lr(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(),n=this._models.getModifiedOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",w("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),vs(r,n.get(50)),ms(this._content,r);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=n.get(67),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===ma.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,m=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,_=E=>E===0?w("no_lines_changed","no lines changed"):E===1?w("one_line_changed","1 line changed"):w("more_lines_changed","{0} lines changed",E),y=_(p.original.length),S=_(p.modified.length);g.setAttribute("aria-label",w({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}",m+1,v,p.original.startLineNumber,y,p.modified.startLineNumber,S));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${m+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,n,s,l);r.appendChild(h);const f=en(g=>this._model.currentElement.read(g)===d);e.add(yn(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(xe(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,r,o,s,a,l,c){const u=r.get(144),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(144),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let v=null;switch(e.type){case ma.Added:g="diff-review-row line-insert",p=" char-insert",v=x1t;break;case ma.Deleted:g="diff-review-row line-delete",p=" char-delete",v=L1t;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);const S=document.createElement("span");S.style.width=d+"px",S.style.minWidth=d+"px",S.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.originalLineNumber))):S.innerText=" ",y.appendChild(S);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText=" ",y.appendChild(L);const E=document.createElement("span");if(E.className=m,v){const T=document.createElement("span");T.className=Vt.asClassName(v),T.innerText="  ",E.appendChild(T)}else E.innerText="  ";y.appendChild(E);let D;if(e.modifiedLineNumber!==void 0){let T=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);sv._ttPolicy&&(T=sv._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=l.getLineContent(e.modifiedLineNumber)}else{let T=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);sv._ttPolicy&&(T=sv._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=o.getLineContent(e.originalLineNumber)}D.length===0&&(D=w("blankLine","blank"));let k="";switch(e.type){case ma.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=w({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",D,e.originalLineNumber):k=w("equalLine","{0} original line {1} modified line {2}",D,e.originalLineNumber,e.modifiedLineNumber);break;case ma.Added:k=w("insertLine","+ {0} modified line {1}",D,e.modifiedLineNumber);break;case ma.Deleted:k=w("deleteLine","- {0} original line {1}",D,e.originalLineNumber);break}return _.setAttribute("aria-label",k),_}_getLineHtml(e,t,n,r,o){const s=e.getLineContent(r),a=t.get(50),l=Io.createEmpty(s,o),c=yc.isBasicASCII(s,e.mightContainNonBasicASCII()),u=yc.containsRTL(s,c,e.mightContainRTL());return T3(new M_(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==ac.OFF,null)).html}};fj=dQ([hQ(5,qi)],fj);class M1t{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(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class Av extends me{constructor(e,t,n,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=ji(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ji(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=_a("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Vn(this,0),this._modifiedViewZonesChangedSignal=_a("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=_a("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=tx(this,(u,d)=>{var h;this._element.replaceChildren();const f=this._diffModel.read(u),g=(h=f==null?void 0:f.diff.read(u))===null||h===void 0?void 0:h.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(u);const p=this._originalEditorLayoutInfo.read(u),m=this._modifiedEditorLayoutInfo.read(u);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(u),this._originalViewZonesChangedSignal.read(u);const v=g.map(k=>{function T(U,j){const ie=j.getTopForLineNumber(U.startLineNumber,!0),Y=j.getTopForLineNumber(U.endLineNumberExclusive,!0);return(ie+Y)/2}const M=T(k.lineRangeMapping.original,this._editors.original),P=this._originalScrollTop.read(u),N=T(k.lineRangeMapping.modified,this._editors.modified),R=this._modifiedScrollTop.read(u),O=M-P,B=N-R,$=Math.min(M,N),G=Math.max(M,N);return{range:new bn($,G),from:O,to:B,fromWithoutScroll:M,toWithoutScroll:N,move:k}});v.sort(lnt(nu(k=>k.fromWithoutScroll>k.toWithoutScroll,cnt),nu(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,mp)));const _=fQ.compute(v.map(k=>k.range)),y=10,S=p.verticalScrollbarWidth,L=(_.getTrackCount()-1)*10+y*2,E=S+L+(m.contentLeft-Av.movedCodeBlockPadding);let D=0;for(const k of v){const T=_.getTrack(D),M=S+y+T*10,P=15,N=15,R=E,O=m.glyphMarginWidth+m.lineNumbersWidth,B=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${R-O}`),$.setAttribute("y",`${k.to-B/2}`),$.setAttribute("width",`${O}`),$.setAttribute("height",`${B}`),this._element.appendChild($);const G=document.createElementNS("http://www.w3.org/2000/svg","g"),U=document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d",`M 0 ${k.from} L ${M} ${k.from} L ${M} ${k.to} L ${R-N} ${k.to}`),U.setAttribute("fill","none"),G.appendChild(U);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),d.add(yn(ie=>{U.classList.toggle("currentMove",k.move===f.activeMovedText.read(ie)),j.classList.toggle("currentMove",k.move===f.activeMovedText.read(ie))})),j.setAttribute("points",`${R-N},${k.to-P/2} ${R},${k.to} ${R-N},${k.to+P/2}`),G.appendChild(j),this._element.appendChild(G),D++}this.width.set(L,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(Ot(()=>this._element.remove())),this._register(yn(u=>{const d=this._originalEditorLayoutInfo.read(u),h=this._modifiedEditorLayoutInfo.read(u);!d||!h||(this._element.style.left=`${d.width-d.verticalScrollbarWidth}px`,this._element.style.height=`${d.height}px`,this._element.style.width=`${d.verticalScrollbarWidth+d.contentLeft-Av.movedCodeBlockPadding+this.width.read(u)}px`)})),this._register(HT(this._state));const s=en(u=>{const d=this._diffModel.read(u),h=d==null?void 0:d.diff.read(u);return h?h.movedTexts.map(f=>({move:f,original:new JO(fp(f.lineRangeMapping.original.startLineNumber-1),18),modified:new JO(fp(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(eF(this._editors.original,s.map(u=>u.map(d=>d.original)))),this._register(eF(this._editors.modified,s.map(u=>u.map(d=>d.modified)))),this._register(Ah((u,d)=>{const h=s.read(u);for(const f of h)d.add(new Fue(this._editors.original,f.original,f.move,"original",this._diffModel.get())),d.add(new Fue(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=_a("original.onDidFocusEditorWidget",u=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0))),l=_a("modified.onDidFocusEditorWidget",u=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0)));let c="modified";this._register($T({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 h=d.diff.read(u);let f;if(h&&c==="original"){const g=this._editors.originalCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(h&&c==="modified"){const g=this._editors.modifiedCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==d.movedTextToCompare.get()&&d.movedTextToCompare.set(void 0,void 0),d.setActiveMovedText(f)}))}}Av.movedCodeBlockPadding=4;class fQ{static compute(e){const t=[],n=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=Aat(t,nu(a=>a.intersectWithRangeLength(r),mp)):(o=t.length,t.push(new NY))),t[o].addRange(r),n.push(o)}return new fQ(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Fue extends fxe{constructor(e,t,n,r,o){const s=pi("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=r,this._diffModel=o,this._nodes=pi("div.diff-moved-code-block",{style:{marginRight:"4px"}},[pi("div.text-content@textContent"),pi("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=ji(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Pv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?w("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?w("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new du(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Il("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Il("","Compare",Vt.asClassName(tt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(yn(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}X("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},w("diffEditor.move.border","The border color for text that got moved in the diff editor."));X("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},w("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));X("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},w("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const P1t=Or("diff-insert",tt.add,w("diffInsertIcon","Line decoration for inserts in the diff editor.")),gxe=Or("diff-remove",tt.remove,w("diffRemoveIcon","Line decoration for removals in the diff editor.")),Bue=an.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Vt.asClassName(P1t),marginClassName:"gutter-insert"}),Wue=an.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Vt.asClassName(gxe),marginClassName:"gutter-delete"}),$ue=an.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Hue=an.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Vue=an.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),A1t=an.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),O1t=an.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),gj=an.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),F1t=an.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),B1t=an.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class W1t extends me{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=en(this,o=>{var s;const a=(s=this._diffModel.read(o))===null||s===void 0?void 0:s.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),u=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Wue:Hue}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?Bue:$ue}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:F1t}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:A1t});else for(const p of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&u?B1t:gj}),g.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&u?O1t:Vue});if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&d.push({range:p,options:c?Wue:Hue});const m=g.modified.toInclusiveRange();m&&h.push({range:m,options:c?Bue:$ue});for(const v of g.innerChanges||[])d.push({range:v.originalRange,options:gj}),h.push({range:v.modifiedRange,options:Vue})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[Av.movedCodeBlockPadding,0,Av.movedCodeBlockPadding,Av.movedCodeBlockPadding]}}),h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(QO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(QO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class $1t extends me{constructor(e,t,n,r){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashes=r,this._sashRatio=Vn(this,void 0),this.sashLeft=en(this,o=>{var s;const a=(s=this._sashRatio.read(o))!==null&&s!==void 0?s:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(a,o)}),this._sash=this._register(new Is(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>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(o=>{const s=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/s,void 0);this._sashRatio.set(a/s,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(yn(o=>{const s=this._sashes.read(o);s&&(this._sash.orthogonalEndSash=s.bottom)})),this._register(yn(o=>{const s=this._options.enableSplitViewResizing.read(o);this._sash.state=s?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):r,s=100;return n<=s*2?r:on-s?n-s:o}}var H1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},V1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pj;let ik=pj=class extends me{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._instantiationService=r,this._modifiedOutlineSource=Im(this,l=>{const c=this._editors.modifiedModel.read(l),u=pj._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===3){const c=this._diffModel.get();Pi(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===3){const c=this._diffModel.get();Pi(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 o=this._diffModel.map((l,c)=>{var u,d;const h=(u=l==null?void 0:l.unchangedRegions.read(c))!==null&&u!==void 0?u:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((d=this._editors.modifiedModel.read(c))===null||d===void 0?void 0:d.getLineCount())?[]:h});this.viewZones=tx(this,(l,c)=>{const u=this._modifiedOutlineSource.read(l);if(!u)return{origViewZones:[],modViewZones:[]};const d=[],h=[],f=this._options.renderSideBySide.read(l),g=o.read(l);for(const p of g)if(!p.shouldHideControls(l)){{const m=en(this,_=>p.getHiddenOriginalRange(_).startLineNumber-1),v=new JO(m,24);d.push(v),c.add(new zue(this._editors.original,v,p,p.originalUnchangedRange,!f,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}{const m=en(this,_=>p.getHiddenModifiedRange(_).startLineNumber-1),v=new JO(m,24);h.push(v),c.add(new zue(this._editors.modified,v,p,p.modifiedUnchangedRange,!1,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}}return{origViewZones:d,modViewZones:h}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Ns(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(w("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Vt.asClassName(tt.fold),zIndex:10001};this._register(QO(this._editors.original,en(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.originalUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:W.fromPositions(new le(d.originalLineNumber,1)),options:a});return u}))),this._register(QO(this._editors.modified,en(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:vn.ofLength(d.modifiedLineNumber,1).toInclusiveRange(),options:a});return u}))),this._register(yn(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(u=>u.getHiddenOriginalRange(l).toInclusiveRange()).filter(Pf)),this._editors.modified.setHiddenAreas(c.map(u=>u.getHiddenModifiedRange(l).toInclusiveRange()).filter(Pf))}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===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(u));if(!h)return;h.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===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};ik._breadcrumbsSourceFactory=Vn("breadcrumbsSourceFactory",void 0);ik=pj=H1t([V1t(3,Wt)],ik);class zue extends fxe{constructor(e,t,n,r,o,s,a,l){const c=pi("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=r,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=pi("div.diff-hidden-lines",[pi("div.top@top",{title:w("diff.hiddenLines.top","Click or drag to show more above")}),pi("div.center@content",{style:{display:"flex"}},[pi("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Xe("a",{title:w("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Tv("$(unfold)"))]),pi("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),pi("div.bottom@bottom",{title:w("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=ji(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?ms(this._nodes.first):this._register(Pv(this._nodes.first,{width:u.map(h=>h.contentLeft)})),this._register(yn(h=>{const f=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!f)):g==="bottom"?(p.classList.toggle("canMoveTop",!f),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(xe(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=Bt(this._nodes.top),v=xe(m,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),_=xe(m,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),_.dispose()})})),this._register(xe(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=Bt(this._nodes.bottom),v=xe(m,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p-E,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const T=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(T-k))}),_=xe(m,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const S=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-S))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),_.dispose()})})),this._register(yn(h=>{const f=[];if(!this._hide){const g=n.getHiddenModifiedRange(h).length,p=w("hiddenLines","{0} hidden lines",g),m=Xe("span",{title:w("diff.hiddenLines.expandAll","Double click to unfold")},p);m.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(_.length>0){f.push(Xe("span",void 0,"  |  "));for(let y=0;y<_.length;y++){const S=_[y],L=MA.toIcon(S.kind),E=pi("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[FI(L)," ",S.name,...y===_.length-1?[]:[FI(tt.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(S.startLineNumber)}}}}ms(this._nodes.others,...f)}))}}var pxe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mj=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},S0;const mxe=Sn("diffProviderFactoryService");let vj=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(tF,e)}};vj=pxe([mj(0,Wt)],vj);Tn(mxe,vj,1);let tF=S0=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new ae,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,n,r){var o,s;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new mh(new vn(1,2),new vn(1,t.getLineCount()+1),[new t_(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=S0.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Fs.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return S0.diffCache.size>10&&S0.diffCache.delete(S0.diffCache.keys().next().value),S0.diffCache.set(a,{result:d,context:l}),d}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};tF.diffCache=new Map;tF=S0=pxe([mj(1,vd),mj(2,ia)],tF);var z1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _j=class extends me{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Vn(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Vn(this,void 0),this.diff=this._diff,this._unchangedRegions=Vn(this,void 0),this.unchangedRegions=en(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(Pi(u=>{var d;for(const h of((d=this._unchangedRegions.get())===null||d===void 0?void 0:d.regions)||[])h.collapseAll(u)}),[])}),this.movedTextToCompare=Vn(this,void 0),this._activeMovedText=Vn(this,void 0),this._hoveredMovedText=Vn(this,void 0),this.activeMovedText=en(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new xr,this._diffProvider=en(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=_a("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Ot(()=>this._cancellationTokenSource.cancel()));const r=cQ("contentChangedSignal"),o=this._register(new mi(()=>r.trigger(void 0),200));this._register(yn(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?vn.fromRangeInclusive(g):void 0),u=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?vn.fromRangeInclusive(g):void 0),d=l.regions.map((g,p)=>!c[p]||!u[p]?void 0:new av(c[p].startLineNumber,u[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Pf),h=[];let f=!1;for(const g of KX(d,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((v,_)=>v+_.lineCount,0),m=new av(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());h.push(m)}else h.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,h.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Pi(m=>{this._unchangedRegions.set({regions:h,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const s=(a,l,c)=>{const u=av.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let d;const h=this._unchangedRegions.get();if(h){const m=h.originalDecorationIds.map(S=>e.original.getDecorationRange(S)).map(S=>S?vn.fromRangeInclusive(S):void 0),v=h.modifiedDecorationIds.map(S=>e.modified.getDecorationRange(S)).map(S=>S?vn.fromRangeInclusive(S):void 0);let y=S1t(h.regions.map((S,L)=>{if(!m[L]||!v[L])return;const E=m[L].length;return new av(m[L].startLineNumber,v[L].startLineNumber,E,Math.min(S.visibleLineCountTop.get(),E),Math.min(S.visibleLineCountBottom.get(),E-S.visibleLineCountTop.get()))}).filter(Pf),(S,L)=>!L||S.modifiedLineNumber>=L.modifiedLineNumber+L.lineCount&&S.originalLineNumber>=L.originalLineNumber+L.lineCount).map(S=>new el(S.getHiddenOriginalRange(c),S.getHiddenModifiedRange(c)));y=el.clip(y,vn.ofLength(1,e.original.getLineCount()),vn.ofLength(1,e.modified.getLineCount())),d=el.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(d)for(const m of u){const v=d.filter(_=>_.original.intersectsStrict(m.originalUnchangedRange)&&_.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(v,l))}else f.push(...u);const g=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=dp.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=dp.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Ah(async(a,l)=>{var c,u;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),r.read(a);const d=this._diffProvider.read(a);d.onChangeSignal.read(a),uf(gye,a),uf(_z,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(p=>{const m=dp.fromModelContentChanges(p.changes);h=dO(h,m)}));let f=[];l.add(e.modified.onDidChangeContent(p=>{const m=dp.fromModelContentChanges(p.changes);f=dO(f,m)}));let g=await d.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||(g=j1t(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:g,Pi(p=>{s(g,p),this._lastDiff=g;const m=gQ.fromDiffResult(g);this._diff.set(m,p),this._isDiffUpToDate.set(!0,p);const v=this.movedTextToCompare.get();this.movedTextToCompare.set(v?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(v.lineRangeMapping.modified)):void 0,p)}))}))}ensureModifiedLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,n);return}}async waitForDiff(){await p1t(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 t;const n=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>vn.deserialize(o.range)),r=this._unchangedRegions.get();!r||!n||Pi(o=>{for(const s of r.regions)for(const a of n)if(s.modifiedUnchangedRange.intersect(a)){s.setHiddenModifiedRange(a,o);break}})}};_j=z1t([U1t(2,mxe)],_j);function j1t(i,e,t){return{changes:i.changes.map(n=>new mh(n.original,n.modified,n.innerChanges?n.innerChanges.map(r=>K1t(r,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function K1t(i,e,t){let n=i.originalRange,r=i.modifiedRange;return(n.endColumn!==1||r.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&n.endLineNumbernew vxe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,r){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=r}}class vxe{constructor(e){this.lineRangeMapping=e}}class av{static fromDiffs(e,t,n,r,o){const s=mh.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new av(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new av(c,u,d,0,0)))}return a}get originalUnchangedRange(){return vn.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return vn.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Vn(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Vn(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=en(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Vn(this,void 0);const s=Math.max(Math.min(r,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-r),0);lae(r===s),lae(o===a),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],r=new Uu(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,s=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(r.ranges.length===0)this.showAll(t),n.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)-s,h=new av(o,s,d,0,0);h.setHiddenModifiedRange(c,t),n.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,s=h.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return vn.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return vn.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&r{var m;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(m=n.getDomNode())!==null&&m!==void 0?m:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],_=r.modified.isEmpty;return v.push(new Il("diff.clipboard.copyDeletedContent",_?r.original.length>1?w("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):w("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?w("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):w("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());await this._clipboardService.writeText(S)})),r.original.length>1&&v.push(new Il("diff.clipboard.copyDeletedLineContent",_?w("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):w("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(r.original.startLineNumber+d);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),await this._clipboardService.writeText(S)})),n.getOption(91)||v.push(new Il("diff.inline.revertChange",w("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Lr(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:p,height:m}=Hr(this._diffActions),v=Math.floor(u/3);g.preventDefault(),f(g.posx,p+m+v)})),this._register(n.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(n.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),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:r}=Hr(e),o=t-r,s=Math.floor(o/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function q1t(i,e,t,n){vs(n,e.fontInfo);const r=t.length>0,o=new KS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=yc.isBasicASCII(l,r),u=yc.containsRTL(l,c,o),d=bT(new R_(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==ac.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var Y1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let bj=class extends me{constructor(e,t,n,r,o,s,a,l,c,u){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=r,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=u,this._originalTopPadding=Vn(this,0),this._originalScrollOffset=Vn(this,0),this._originalScrollOffsetAnimated=Aue(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Vn(this,0),this._modifiedScrollOffset=Vn(this,0),this._modifiedScrollOffsetAnimated=Aue(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Vn("invalidateAlignmentsState",0),h=this._register(new mi(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()}));const f=this._diffModel.map(y=>y?ji(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),g=en(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;d.read(y);const D=this._options.renderSideBySide.read(y);return Gue(this._editors.original,this._editors.modified,L.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,D)}),p=en(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;d.read(y);const E=L.changes.map(D=>new vxe(D));return Gue(this._editors.original,this._editors.modified,E,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const y=document.createElement("div");return y.className="diagonal-fill",y}const v=this._register(new Fe);this.viewZones=tx(this,(y,S)=>{var L,E,D,k,T,M,P,N;v.clear();const R=g.read(y)||[],O=[],B=[],$=this._modifiedTopPadding.read(y);$>0&&B.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0});const G=this._originalTopPadding.read(y);G>0&&O.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:G,showInHiddenAreas:!0,suppressMouseDown:!0});const U=this._options.renderSideBySide.read(y),j=U||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(j){const be=this._editors.original.getModel();for(const Ge of R)if(Ge.diff)for(let nt=Ge.originalRange.startLineNumber;ntbe.getLineCount())return{orig:O,mod:B};j==null||j.addRequest(be.getLineContent(nt),null,null)}}const ie=(E=j==null?void 0:j.finalize())!==null&&E!==void 0?E:[];let Y=0;const J=this._editors.modified.getOption(67),Q=(D=this._diffModel.read(y))===null||D===void 0?void 0:D.movedTextToCompare.read(y),he=(T=(k=this._editors.original.getModel())===null||k===void 0?void 0:k.mightContainNonBasicASCII())!==null&&T!==void 0?T:!1,ge=(P=(M=this._editors.original.getModel())===null||M===void 0?void 0:M.mightContainRTL())!==null&&P!==void 0?P:!1,ye=pQ.fromEditor(this._editors.modified);for(const be of R)if(be.diff&&!U){if(!be.originalRange.isEmpty){f.read(y);const nt=document.createElement("div");nt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const je=this._editors.original.getModel();if(be.originalRange.endLineNumberExclusive-1>je.getLineCount())return{orig:O,mod:B};const _e=new X1t(be.originalRange.mapToLineArray(Qe=>je.tokenization.getLineTokens(Qe)),be.originalRange.mapToLineArray(Qe=>ie[Y++]),he,ge),Ve=[];for(const Qe of be.diff.innerChanges||[])Ve.push(new BE(Qe.originalRange.delta(-(be.diff.original.startLineNumber-1)),gj.className,0));const Le=q1t(_e,ye,Ve,nt),Pe=document.createElement("div");if(Pe.className="inline-deleted-margin-view-zone",vs(Pe,ye.fontInfo),this._options.renderIndicators.read(y))for(let Qe=0;QeYm(Be),Pe,this._editors.modified,be.diff,this._diffEditorWidget,Le.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Qe=0;Qe1&&O.push({afterLineNumber:be.originalRange.startLineNumber+Qe,domNode:m(),heightInPx:(Ye-1)*J,showInHiddenAreas:!0,suppressMouseDown:!0})}B.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:nt,heightInPx:Le.heightInLines*J,minWidthInPx:Le.minWidthInPx,marginDomNode:Pe,setZoneId(Qe){Be=Qe},showInHiddenAreas:!0,suppressMouseDown:!0})}const Ge=document.createElement("div");Ge.className="gutter-delete",O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:be.modifiedHeightInPx,marginDomNode:Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ge=be.modifiedHeightInPx-be.originalHeightInPx;if(Ge>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let nt=function(){const _e=document.createElement("div");return _e.className="arrow-revert-change "+Vt.asClassName(tt.arrowRight),S.add(xe(_e,"mousedown",Ve=>Ve.stopPropagation())),S.add(xe(_e,"click",Ve=>{Ve.stopPropagation(),o.revert(be.diff)})),Xe("div",{},_e)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let je;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(je=nt()),B.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ge,marginDomNode:je,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(N=p.read(y))!==null&&N!==void 0?N:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(be.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Ge=be.modifiedHeightInPx-be.originalHeightInPx;Ge>0?O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ge,showInHiddenAreas:!0,suppressMouseDown:!0}):B.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:O,mod:B}});let _=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(y.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(y.scrollLeft),_=!1)})),this._originalScrollTop=ji(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ji(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(yn(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(yn(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(yn(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let E=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};bj=Y1t([Kue(8,Zp),Kue(9,$l)],bj);function Gue(i,e,t,n,r,o){const s=new Op(que(i,n)),a=new Op(que(e,r)),l=i.getOption(67),c=e.getOption(67),u=[];let d=0,h=0;function f(g,p){for(;;){let m=s.peek(),v=a.peek();if(m&&m.lineNumber>=g&&(m=void 0),v&&v.lineNumber>=p&&(v=void 0),!m&&!v)break;const _=m?m.lineNumber-d:Number.MAX_VALUE,y=v?v.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),m={lineNumber:v.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:vn.ofLength(m.lineNumber,1),modifiedRange:vn.ofLength(v.lineNumber,1),originalHeightInPx:l+m.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let y=function(S,L){var E,D,k,T;if(S<_||LO.lineNumberO+B.heightInPx,0))!==null&&D!==void 0?D:0,R=(T=(k=a.takeWhile(O=>O.lineNumberO+B.heightInPx,0))!==null&&T!==void 0?T:0;u.push({originalRange:M,modifiedRange:P,originalHeightInPx:M.length*l+N,modifiedHeightInPx:P.length*c+R,diff:g.lineRangeMapping}),_=S,v=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let m=!0,v=p.modified.startLineNumber,_=p.original.startLineNumber;if(o)for(const S of p.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&y(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=i.getModel(),E=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new le(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return v1t(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Z1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Q1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Fu;let Xb=Fu=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=a,this.width=Fu.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=ji(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=en(h=>{const f=l.read(h),g=f.getColor($ct)||(f.getColor(Bct)||Ez).transparent(2),p=f.getColor(Hct)||(f.getColor(Wct)||Dz).transparent(2);return{insertColor:g,removeColor:p}}),u=Jn(document.createElement("div"));u.setClassName("diffViewport"),u.setPosition("absolute");const d=pi("div.diffOverview",{style:{position:"absolute",top:"0px",width:Fu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(I2(d,u.domNode)),this._register(Lr(d,Je.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(xe(d,Je.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(I2(this._rootElement,d)),this._register(Ah((h,f)=>{const g=this._diffModel.read(h),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(I2(d,p.getDomNode())));const m=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(m&&(f.add(m),f.add(I2(d,m.getDomNode()))),!p||!m)return;const v=_a("viewZoneChanged",this._editors.original.onDidChangeViewZones),_=_a("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=_a("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),S=_a("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(yn(L=>{var E;v.read(L),_.read(L),y.read(L),S.read(L);const D=c.read(L),k=(E=g==null?void 0:g.diff.read(L))===null||E===void 0?void 0:E.mappings;function T(N,R,O){const B=O._getViewModel();return B?N.filter($=>$.length>0).map($=>{const G=B.coordinatesConverter.convertModelPositionToViewPosition(new le($.startLineNumber,1)),U=B.coordinatesConverter.convertModelPositionToViewPosition(new le($.endLineNumberExclusive,1)),j=U.lineNumber-G.lineNumber;return new uwe(G.lineNumber,U.lineNumber,j,R.toString())}):[]}const M=T((k||[]).map(N=>N.lineRangeMapping.original),D.removeColor,this._editors.original),P=T((k||[]).map(N=>N.lineRangeMapping.modified),D.insertColor,this._editors.modified);p==null||p.setZones(M),m==null||m.setZones(P)})),f.add(yn(L=>{const E=this._rootHeight.read(L),D=this._rootWidth.read(L),k=this._modifiedEditorLayoutInfo.read(L);if(k){const T=Fu.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Fu.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:E,right:T+Fu.ONE_OVERVIEW_WIDTH,width:Fu.ONE_OVERVIEW_WIDTH}),m.setLayout({top:0,height:E,right:0,width:Fu.ONE_OVERVIEW_WIDTH});const M=this._editors.modifiedScrollTop.read(L),P=this._editors.modifiedScrollHeight.read(L),N=this._editors.modified.getOption(103),R=new rS(N.verticalHasArrows?N.arrowSize:0,N.verticalScrollbarSize,0,k.height,P,M);u.setTop(R.getSliderPosition()),u.setHeight(R.getSliderSize())}else u.setTop(0),u.setHeight(0);d.style.height=E+"px",d.style.left=D-Fu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",u.setWidth(Fu.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Xb.ONE_OVERVIEW_WIDTH=15;Xb.ENTIRE_DIFF_OVERVIEW_WIDTH=Fu.ONE_OVERVIEW_WIDTH*2;Xb=Fu=Z1t([Q1t(6,Mo)],Xb);class y5 extends me{constructor(){super(...arguments),this._id=++y5.idCounter,this._onDidDispose=this._register(new ae),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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,r=!0){this._targetEditor.revealRange(e,t,n,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,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}y5.idCounter=0;var J1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Cj=class extends me{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,n,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new ae),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=ji(this.modified.onDidChangeModel,()=>this.modified.getModel()),this.modifiedScrollTop=ji(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=ji(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedSelections=ji(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=mw({owner:this,equalityComparer:le.equals},l=>{var c,u;return(u=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&u!==void 0?u:new le(1,1)}),this.originalCursor=ji(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new le(1,1)}),this._register($T({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.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 n=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,n,r){const o=this._createInnerEditor(e,t,n,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Xb.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=kh.revealHorizontalRightPadding.defaultValue+Xb.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_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 t;e||(e="");const n=w("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};Cj=J1t([Xue(5,Wt),Xue(6,ci)],Cj);class eyt{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=Vn(this,0),this.couldShowInlineViewBecauseOfSize=en(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=en(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=en(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n))),this.readOnly=en(this,n=>this._options.read(n).readOnly),this.shouldRenderRevertArrows=en(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n))),this.renderIndicators=en(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=en(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=en(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=en(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=en(this,n=>this._options.read(n).maxComputationTime),this.showMoves=en(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=en(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=en(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=en(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=en(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=en(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=en(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=en(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=en(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=en(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const t={...e,...Yue(e,js)};this._options=Vn(this,t)}updateOptions(e){const t=Yue(e,this._options.get()),n={...this._options.get(),...e,...t};this._options.set(n,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function Yue(i,e){var t,n,r,o,s,a,l,c;return{enableSplitViewResizing:Tt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Tnt(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Tt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Tt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:v0(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:v0(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Tt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Tt(i.renderIndicators,e.renderIndicators),originalEditable:Tt(i.originalEditable,e.originalEditable),diffCodeLens:Tt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Tt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:yr(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:yr(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Tt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Tt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Tt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Tt((o=(r=i.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:v0((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:v0((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:v0((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Tt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Tt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:v0(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Tt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}const P7=[];class tyt extends me{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._widget=r,this._selectedDiffs=en(this,o=>{const s=this._diffModel.read(o),a=s==null?void 0:s.diff.read(o);if(!a)return P7;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return P7;const c=new Uu(l.map(h=>vn.fromRangeInclusive(h))),d=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(f=>l.some(g=>W.areIntersecting(f.modifiedRange,g)))}));return d.length===0||d.every(h=>h.rangeMappings.length===0)?P7:d}),this._register(Ah((o,s)=>{if(!this._options.shouldRenderRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],u=this._selectedDiffs.read(o),d=new Set(u.map(h=>h.mapping));if(u.length>0){const h=this._editors.modifiedSelections.read(o),f=s.add(new rk(h[h.length-1].positionLineNumber,this._widget,u.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const h of l.mappings)if(!d.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const f=s.add(new rk(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping.innerChanges,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}s.add(Ot(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class rk extends me{getId(){return this._id}constructor(e,t,n,r){super(),this._lineNumber=e,this._widget=t,this._diffs=n,this._revertSelection=r,this._id=`revertButton${rk.counter++}`,this._domNode=pi("div.revertButton",{title:this._revertSelection?w("revertSelectedChanges","Revert Selected Changes"):w("revertChange","Revert Change")},[FI(tt.arrowRight)]).root,this._register(xe(this._domNode,Je.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(xe(this._domNode,Je.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(xe(this._domNode,Je.CLICK,o=>{this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Uf.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}rk.counter=0;var nyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let a_=class extends y5{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,n,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=pi("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[pi("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[Xe("span",{},"No Changes")]),pi("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),pi("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),pi("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=Vn(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=ot.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new IT([Gt,this._contextKeyService])),this._boundarySashes=Vn(this,void 0),this._accessibleDiffViewerShouldBeVisible=Vn(this,!1),this._accessibleDiffViewerVisible=en(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=Vn(this,void 0),this._layoutInfo=en(this,S=>{var L,E,D,k,T;const M=this._rootSizeObserver.width.read(S),P=this._rootSizeObserver.height.read(S),N=(L=this._sash.read(S))===null||L===void 0?void 0:L.sashLeft.read(S),R=N??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),O=M-R-((D=(E=this._overviewRulerPart.read(S))===null||E===void 0?void 0:E.width)!==null&&D!==void 0?D:0),B=(T=(k=this._movedBlocksLinesPart.read(S))===null||k===void 0?void 0:k.width.read(S))!==null&&T!==void 0?T:0,$=R-B;return this.elements.original.style.width=$+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=O+"px",this.elements.modified.style.left=R+"px",this._editors.original.layout({width:$,height:P},!0),this._editors.modified.layout({width:O,height:P},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,L)=>S==null?void 0:S.diff.read(L)),this.onDidUpdateDiff=ot.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ot(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new hxe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new eyt(t),this._register(yn(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(K.isEmbeddedDiffEditor.key,!1),this._register(k2(K.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(k2(K.comparingMovedCode,this._contextKeyService,S=>{var L;return!!(!((L=this._diffModel.read(S))===null||L===void 0)&&L.movedTextToCompare.read(S))})),this._register(k2(K.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(k2(K.hasChanges,this._contextKeyService,S=>{var L,E,D;return((D=(E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)!==null&&D!==void 0?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Cj,this.elements.original,this.elements.modified,this._options,n,(S,L,E,D)=>this._createInnerEditor(S,L,E,D))),this._overviewRulerPart=Im(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(uf(Xb,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=Im(this,S=>{const L=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",L),L?new $1t(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((E,D)=>{var k,T;return E-((T=(k=this._overviewRulerPart.read(D))===null||k===void 0?void 0:k.width)!==null&&T!==void 0?T:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const u=Im(this,S=>this._instantiationService.createInstance(uf(ik,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Im(this,S=>this._instantiationService.createInstance(uf(W1t,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,h=new Set;let f=!1;const g=Im(this,S=>this._instantiationService.createInstance(uf(bj,S),Bt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||u.get().isUpdatingHiddenAreas,d,h)).recomputeInitiallyAndOnChange(this._store),p=en(this,S=>{const L=g.read(S).viewZones.read(S).orig,E=u.read(S).viewZones.read(S).origViewZones;return L.concat(E)}),m=en(this,S=>{const L=g.read(S).viewZones.read(S).mod,E=u.read(S).viewZones.read(S).modViewZones;return L.concat(E)});this._register(eF(this._editors.original,p,S=>{f=S},d));let v;this._register(eF(this._editors.modified,m,S=>{f=S,f?v=wh.capture(this._editors.modified):(v==null||v.restore(this._editors.modified),v=void 0)},h)),this._accessibleDiffViewer=Im(this,S=>this._instantiationService.createInstance(uf(sv,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,E)=>this._accessibleDiffViewerShouldBeVisible.set(L,E),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,E)=>{var D;return(D=L==null?void 0:L.diff.read(E))===null||D===void 0?void 0:D.mappings.map(k=>k.lineRangeMapping)}),new M1t(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register(Pv(this.elements.modified,{visibility:_})),this._register(Pv(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(HT(this._layoutInfo)),Im(this,S=>new(uf(Av,S))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(Pv(this.elements.overlay,{width:this._layoutInfo.map((S,L)=>S.originalEditor.width+(this._options.renderSideBySide.read(L)?0:S.modifiedEditor.width)),visibility:en(S=>{var L,E;return this._options.hideUnchangedRegions.read(S)&&((E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)===0?"visible":"hidden"})})),this._register(ot.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>{var L,E;if((S==null?void 0:S.reason)===3){const D=(E=(L=this._diffModel.get())===null||L===void 0?void 0:L.diff.get())===null||E===void 0?void 0:E.mappings.find(k=>k.lineRangeMapping.modified.contains(S.position.lineNumber));D!=null&&D.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(dn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):D!=null&&D.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(dn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):D&&this._accessibilitySignalService.playSignal(dn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const y=this._diffModel.map(this,(S,L)=>{if(S)return S.diff.read(L)===void 0&&!S.isDiffUpToDate.read(L)});this._register(Ah((S,L)=>{if(y.read(S)===!0){const E=this._editorProgressService.show(!0,1e3);L.add(Ot(()=>E.done()))}})),this._register(Ot(()=>{var S;this._shouldDisposeDiffModel&&((S=this._diffModel.get())===null||S===void 0||S.dispose())})),this._register(new tyt(this._editors,this._diffModel,this._options,this))}_createInnerEditor(e,t,n,r){return e.createInstance(sS,t,n,r)}_createDiffEditorContributions(){const e=Zy.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){nn(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return _T.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(_j,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const n=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(n==null?void 0:n.model)&&tk(t,r=>{var o;ji.batchEventsGlobally(r,()=>{this._editors.original.setModel(n?n.model.model.original:null),this._editors.modified.setModel(n?n.model.model.modified:null)});const s=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=n==null?void 0:n.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(n==null?void 0:n.model,r),a&&(s==null||s.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?iyt(t):null}revert(e){if(e.innerChanges){this.revertRangeMappings(e.innerChanges);return}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 n=e.map(r=>({range:r.modifiedRange,text:t.model.original.getValueInRange(r.originalRange)}));this._editors.modified.executeEdits("diffEditor",n)}_goTo(e){this._editors.modified.setPosition(new le(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,n,r,o;const s=(n=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||n===void 0?void 0:n.mappings;if(!s||s.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(r=s.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&r!==void 0?r:s[0]:l=(o=fI(s,c=>c.lineRangeMapping.modified.startLineNumber{var t;const n=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!n||n.length===0||this._goTo(n[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),r=n?this._editors.modified:this._editors.original,o=n?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Oue(a.getStartPosition(),l),u=Oue(a.getEndPosition(),l);s=W.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pi(n=>{for(const r of t)r.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pi(n=>{for(const r of t)r.showAll(n)})}};a_=nyt([bL(3,Gt),bL(4,Wt),bL(5,jn),bL(6,F_),bL(7,P_)],a_);function iyt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,r,o,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,r=0,a=void 0):(n=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var mQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Yi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ryt=0,Zue=!1;function oyt(i){if(!i){if(Zue)return;Zue=!0}Ult(i||hi.document.body)}let nF=class extends sS{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};f.ariaLabel=f.ariaLabel||DO.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+DO.accessibilityHelpMessage,super(e,f,{},n,r,o,s,l,c,u,d,h),a instanceof gS?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,oyt(f.ariaContainerElement),b_t((g,p)=>n.createInstance(yO,g,p,{}))}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++ryt,o=Re.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),me.None;const t=e.id,n=e.label,r=Re.and(Re.equals("editorId",this.getId()),Re.deserialize(e.precondition)),o=e.keybindings,s=Re.and(r,Re.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Fe,d=this.getId()+":"+t;if(u.add(kn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:r,group:a,order:l};u.add(ns.appendMenuItem(H.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new hwe(d,n,n,void 0,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(Ot(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof vO)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};nF=mQ([Yi(2,Wt),Yi(3,jn),Yi(4,cr),Yi(5,Gt),Yi(6,ci),Yi(7,Mo),Yi(8,zr),Yi(9,pd),Yi(10,Ti),Yi(11,yt)],nF);let yj=class extends nF{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p){const m={...t};ZO(u,m,!1);const v=l.registerEditorContainer(e);typeof m.theme=="string"&&l.setTheme(m.theme),typeof m.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!m.autoDetectHighContrast);const _=m.model;delete m.model,super(e,m,n,r,o,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(v);let y;if(typeof _>"u"){const S=f.getLanguageIdByMimeType(m.language)||m.language||mc;y=_xe(h,f,m.value||"",S,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){ZO(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)}};yj=mQ([Yi(2,Wt),Yi(3,jn),Yi(4,cr),Yi(5,Gt),Yi(6,ci),Yi(7,Dc),Yi(8,zr),Yi(9,mn),Yi(10,pd),Yi(11,rr),Yi(12,qi),Yi(13,Ti),Yi(14,yt)],yj);let wj=class extends a_{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};ZO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,n,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){ZO(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,n){return e.createInstance(nF,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};wj=mQ([Yi(2,Wt),Yi(3,Gt),Yi(4,jn),Yi(5,Dc),Yi(6,zr),Yi(7,mn),Yi(8,$l),Yi(9,P_),Yi(10,Zp),Yi(11,F_)],wj);function _xe(i,e,t,n,r){if(t=t||"",!n){const o=t.indexOf(` -`);let s=t;return o!==-1&&(s=t.substring(0,o)),Que(i,t,e.createByFilepathOrFirstLine(r||null,s),r)}return Que(i,t,e.createById(n),r)}function Que(i,e,t,n){return i.createModel(e,t,n)}class syt extends me{constructor(e,t,n={orientation:0}){var r;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Tit),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Fe),n.hoverDelegate=(r=n.hoverDelegate)!==null&&r!==void 0?r:this._register(qp("element",!0)),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new ok(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new du(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(o,s)=>{var a;if(o.id===ok.ID)return this.toggleMenuActionViewItem=new TO(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Vt.asClassNameArray((a=n.moreIcon)!==null&&a!==void 0?a:tt.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(n.actionViewItemProvider){const l=n.actionViewItemProvider(o,s);if(l)return l}if(o instanceof jw){const l=new TO(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}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 n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,n,r;const o=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class ok extends Il{constructor(e,t){t=t||w("moreActions","More Actions..."),super(ok.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}}ok.ID="toolbar.toggle.more";var bxe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sk=class extends syt{constructor(e,t,n,r,o,s,a){super(e,o,{getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=n,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new Fe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;fm==null?void 0:m.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let m=0;m=g&&(a[m]=void 0,d[m]=v))}}kse(a),kse(d),super.setActions(a,ho.join(d,l)),c.length>0&&this._sessionDisposables.add(xe(this.getElement(),"contextmenu",f=>{var g,p,m,v,_;const y=new Gu(Bt(this.getElement()),f),S=this.getItemAction(y.target);if(!S)return;y.preventDefault(),y.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let k=0;kthis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>D,menuId:(m=this._options)===null||m===void 0?void 0:m.contextMenu,menuActionOptions:{renderShortTitle:!0,...(v=this._options)===null||v===void 0?void 0:v.menuOptions},skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};sk=bxe([Cf(2,mu),Cf(3,Gt),Cf(4,$l),Cf(5,ci),Cf(6,ia)],sk);let Sj=class extends sk{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this._onDidChangeMenuItems=this._store.add(new ae);const c=this._store.add(r.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var d,h,f;const g=[],p=[];n5(c,n==null?void 0:n.menuOptions,{primary:g,secondary:p},(d=n==null?void 0:n.toolbarOptions)===null||d===void 0?void 0:d.primaryGroup,(h=n==null?void 0:n.toolbarOptions)===null||h===void 0?void 0:h.shouldInlineSubmenu,(f=n==null?void 0:n.toolbarOptions)===null||f===void 0?void 0:f.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(c.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new Zi("This toolbar is populated from a menu.")}};Sj=bxe([Cf(3,mu),Cf(4,Gt),Cf(5,$l),Cf(6,ci),Cf(7,ia)],Sj);class ayt extends Hb{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}var lyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class uyt{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let iF=class extends me{constructor(e,t,n,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=n,this._instantiationService=r,this._viewModel=Vn(this,void 0),this._collapsed=en(this,s=>{var a;return(a=this._viewModel.read(s))===null||a===void 0?void 0:a.collapsed.read(s)}),this._editorContentHeight=Vn(this,500),this.contentHeight=en(this,s=>(this._collapsed.read(s)?0:this._editorContentHeight.read(s))+this._outerEditorHeight),this._modifiedContentWidth=Vn(this,0),this._modifiedWidth=Vn(this,0),this._originalContentWidth=Vn(this,0),this._originalWidth=Vn(this,0),this.maxScroll=en(this,s=>{const a=this._modifiedContentWidth.read(s)-this._modifiedWidth.read(s),l=this._originalContentWidth.read(s)-this._originalWidth.read(s);return a>l?{maxScroll:a,width:this._modifiedWidth.read(s)}:{maxScroll:l,width:this._originalWidth.read(s)}}),this._elements=pi("div.multiDiffEntry",[pi("div.header@header",[pi("div.header-content",[pi("div.collapse-button@collapseButton"),pi("div.file-path",[pi("div.title.modified.show-file-icons@primaryPath",[]),pi("div.status.deleted@status",["R"]),pi("div.title.original.show-file-icons@secondaryPath",[])]),pi("div.actions@actions")])]),pi("div.editorParent",[pi("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(a_,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Jue(this.editor.getModifiedEditor()),this.isOriginalFocused=Jue(this.editor.getOriginalEditor()),this.isFocused=en(this,s=>this.isModifedFocused.read(s)||this.isOriginalFocused.read(s)),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=new Fe,this._headerHeight=48,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new GO(this._elements.collapseButton,{});this._register(yn(s=>{o.element.className="",o.icon=this._collapsed.read(s)?tt.chevronRight:tt.chevronDown})),this._register(o.onDidClick(()=>{var s;(s=this._viewModel.get())===null||s===void 0||s.collapsed.set(!this._collapsed.get(),void 0)})),this._register(yn(s=>{this._elements.editor.style.display=this._collapsed.read(s)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(s=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(s=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(s=>{aP(a=>{this._editorContentHeight.set(s.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(s=>{if(this._isSettingScrollTop||!s.scrollTopChanged||!this._data)return;const a=s.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(yn(s=>{const a=this.isFocused.read(s);this._elements.root.classList.toggle("focused",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Sj,this._elements.actions,H.MultiDiffEditorFileToolbar,{actionRunner:this._register(new ayt(()=>{var s;return(s=this._viewModel.get())===null||s===void 0?void 0:s.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:s=>s.startsWith("navigation")},actionViewItemProvider:(s,a)=>ySe(r,s,a)}))}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}}const n=e.viewModel.entry.value;n.onOptionsDidChange&&this._dataStore.add(n.onOptionsDidChange(()=>{var r;this.editor.updateOptions(t((r=n.options)!==null&&r!==void 0?r:{}))})),aP(r=>{var o,s,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((s=e.viewModel.modifiedUri)!==null&&s!==void 0?s:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,u=!1,d=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",d=!0):(h="D",u=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",u),this._elements.status.classList.toggle("added",d),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,r),this.editor.setModel(e.viewModel.diffEditorViewModel,r),this.editor.updateOptions(t((l=n.options)!==null&&l!==void 0?l:{}))})}render(e,t,n,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 o=e.length-this._headerHeight,s=Math.max(0,Math.min(r.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,aP(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=n,this.editor.getOriginalEditor().setScrollTop(n)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||n>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};iF=lyt([cyt(3,Wt)],iF);function Jue(i){return ji(e=>{const t=new Fe;return t.add(i.onDidFocusEditorWidget(()=>e(!0))),t.add(i.onDidBlurEditorWidget(()=>e(!1))),t},()=>i.hasWidgetFocus())}class dyt{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let n;if(this._unused.size===0)n=this._create(e),this._itemData.set(n,e);else{const r=[...this._unused.values()];n=(t=r.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:r[0],this._unused.delete(n),this._itemData.set(n,e),n.setData(e)}return this._used.add(n),{object:n,dispose:()=>{this._used.delete(n),this._unused.size>5?n.dispose():this._unused.add(n)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var hyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ede=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xj=class extends me{constructor(e,t,n,r,o,s){super(),this._element=e,this._dimension=t,this._viewModel=n,this._workbenchUIElementFactory=r,this._parentContextKeyService=o,this._parentInstantiationService=s,this._elements=pi("div.monaco-component.multiDiffEditor",[pi("div@content",{style:{overflow:"hidden"}}),pi("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new hxe(this._element,void 0)),this._objectPool=this._register(new dyt(l=>{const c=this._instantiationService.createInstance(iF,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this._scrollable=this._register(new XS({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>Ml(Bt(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new A3(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=ji(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=ji(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItems=tx(this,(l,c)=>{const u=this._viewModel.read(l);return u?u.items.read(l).map(h=>{var f;const g=c.add(new fyt(h,this._objectPool,this.scrollLeft,m=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+m})})),p=(f=this._lastDocStates)===null||f===void 0?void 0:f[g.getKey()];return p&&Pi(m=>{g.setViewState(p,m)}),g}):[]}),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((u,d)=>u+d.contentHeight.read(c)+this._spaceBetweenPx,0)),this.activeDiffItem=en(this,l=>this._viewItems.read(l).find(c=>{var u;return(u=c.template.read(l))===null||u===void 0?void 0:u.isFocused.read(l)})),this.lastActiveDiffItem=f1t((l,c)=>{var u;return(u=this.activeDiffItem.read(l))!==null&&u!==void 0?u:c}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new IT([Gt,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(K.inMultiDiffEditor.key,!0),this._register(Ah((l,c)=>{const u=this._viewModel.read(l);if(u&&u.contextKeys)for(const[d,h]of Object.entries(u.contextKeys)){const f=this._contextKeyService.createKey(d,void 0);f.set(h),c.add(Ot(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(K.multiDiffEditorAllCollapsed.key,!1);this._register(yn(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(yn(l=>{const c=this.lastActiveDiffItem.read(l);Pi(u=>{var d;(d=this._viewModel.read(l))===null||d===void 0||d.activeDiffItem.set(c==null?void 0:c.viewModel,u)})})),this._register(yn(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._elements.content.style.position="relative",this._register(yn(l=>{const c=this._sizeObserver.height.read(l);this._elements.root.style.height=`${c}px`;const u=this._totalHeight.read(l);this._elements.content.style.height=`${u}px`;const d=this._sizeObserver.width.read(l);let h=d;const f=this._viewItems.read(l),g=RY(f,p=>p.maxScroll.read(l).maxScroll);if(g){const p=g.maxScroll.read(l);h=d+p.maxScroll}this._scrollableElement.setScrollDimensions({width:d,height:c,scrollHeight:u,scrollWidth:h})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(Ot(()=>{e.replaceChildren()})),this._register(this._register(yn(l=>{aP(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let n=0,r=0,o=0;const s=this._sizeObserver.height.read(e),a=bn.ofStartAndLength(t,s),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const u=c.contentHeight.read(e),d=Math.min(u,s),h=bn.ofStartAndLength(r,d),f=bn.ofStartAndLength(o,u);if(f.isBefore(a))n-=u-d,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,u-d));n-=g;const p=bn.ofStartAndLength(t+n,s);c.render(h,g,l,p)}r+=d+this._spaceBetweenPx,o+=u+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+n)}px)`}};xj=hyt([ede(4,Gt),ede(5,Wt)],xj);class fyt extends me{constructor(e,t,n,r){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=n,this._deltaScrollVertical=r,this._templateRef=this._register(nk(this,void 0)),this.contentHeight=en(this,o=>{var s,a,l;return(l=(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=en(this,o=>{var s,a;return(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=en(this,o=>{var s;return(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object}),this._isHidden=Vn(this,!1),this._register(yn(o=>{var s;const a=this._scrollLeft.read(o);(s=this._templateRef.read(o))===null||s===void 0||s.object.setScrollLeft(a)})),this._register(yn(o=>{const s=this._templateRef.read(o);!s||!this._isHidden.read(o)||s.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var n;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const r=this.viewModel.lastTemplateData.get(),o=(n=e.selections)===null||n===void 0?void 0:n.map(Et.liftSelection);this.viewModel.lastTemplateData.set({...r,selections:o},t);const s=this._templateRef.get();s&&o&&s.object.editor.setSelections(o)}_updateTemplateData(e){var t;const n=this._templateRef.get();n&&this.viewModel.lastTemplateData.set({contentHeight:n.object.contentHeight.get(),selections:(t=n.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Pi(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,n,r){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new uyt(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const s=this.viewModel.lastTemplateData.get().selections;s&&o.object.editor.setSelections(s)}o.object.render(e,n,t,r)}}X("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},w("multiDiffEditor.headerBackground","The background color of the diff editor's header"));X("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},w("multiDiffEditor.background","The background color of the multi file diff editor"));X("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},w("multiDiffEditor.border","The border color of the multi file diff editor"));var gyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Lj=class extends me{constructor(e,t,n){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=n,this._dimension=Vn(this,void 0),this._viewModel=Vn(this,void 0),this._widgetImpl=tx(this,(r,o)=>(uf(iF,r),o.add(this._instantiationService.createInstance(uf(xj,r),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(HT(this._widgetImpl))}};Lj=gyt([pyt(2,Wt)],Lj);function myt(i,e,t){return jt.initialize(t||{}).createInstance(yj,i,e)}function vyt(i){return jt.get(jn).onCodeEditorAdd(t=>{i(t)})}function _yt(i){return jt.get(jn).onDiffEditorAdd(t=>{i(t)})}function byt(){return jt.get(jn).listCodeEditors()}function Cyt(){return jt.get(jn).listDiffEditors()}function yyt(i,e,t){return jt.initialize(t||{}).createInstance(wj,i,e)}function wyt(i,e){const t=jt.initialize(e||{});return new Lj(i,{},t)}function Syt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return kn.registerCommand(i.id,i.run)}function xyt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Re.deserialize(i.precondition),t=(r,...o)=>zo.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Fe;if(n.add(kn.registerCommand(i.id,t)),i.contextMenuGroupId){const r={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(ns.appendMenuItem(H.EditorContext,r))}if(Array.isArray(i.keybindings)){const r=jt.get(ci);if(!(r instanceof gS))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Re.and(e,Re.deserialize(i.keybindingContext));n.add(r.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:o}))))}}return n}function Lyt(i){return Cxe([i])}function Cxe(i){const e=jt.get(ci);return e instanceof gS?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Re.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),me.None)}function Eyt(i,e,t){const n=jt.get(qi),r=n.getLanguageIdByMimeType(e)||e;return _xe(jt.get(rr),n,i,r,t)}function Dyt(i,e){const t=jt.get(qi),n=t.getLanguageIdByMimeType(e)||e||mc;i.setLanguage(t.createById(n))}function Iyt(i,e,t){i&&jt.get(sg).changeOne(e,i.uri,t)}function kyt(i){jt.get(sg).changeAll(i,[])}function Tyt(i){return jt.get(sg).read(i)}function Nyt(i){return jt.get(sg).onMarkerChanged(i)}function Ryt(i){return jt.get(rr).getModel(i)}function Myt(){return jt.get(rr).getModels()}function Pyt(i){return jt.get(rr).onModelAdded(i)}function Ayt(i){return jt.get(rr).onModelRemoved(i)}function Oyt(i){return jt.get(rr).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function Fyt(i){return _lt(jt.get(rr),jt.get(Ti),i)}function Byt(i,e){const t=jt.get(qi),n=jt.get(Dc);return $Y.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function Wyt(i,e,t){const n=jt.get(qi);return jt.get(Dc).registerEditorContainer(hi.document.body),$Y.colorize(n,i,e,t)}function $yt(i,e,t=4){return jt.get(Dc).registerEditorContainer(hi.document.body),$Y.colorizeModelLine(i,e,t)}function Hyt(i){const e=gr.get(i);return e||{getInitialState:()=>Zw,tokenize:(t,n,r)=>FY(i,r)}}function Vyt(i,e){gr.getOrCreate(e);const t=Hyt(e),n=ng(i),r=[];let o=t.getInitialState();for(let s=0,a=n.length;s{var o;if(!n)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),await i.openCodeEditor(n,t.resource,a)?n:null})}function Xyt(){return{create:myt,getEditors:byt,getDiffEditors:Cyt,onDidCreateEditor:vyt,onDidCreateDiffEditor:_yt,createDiffEditor:yyt,addCommand:Syt,addEditorAction:xyt,addKeybindingRule:Lyt,addKeybindingRules:Cxe,createModel:Eyt,setModelLanguage:Dyt,setModelMarkers:Iyt,getModelMarkers:Tyt,removeAllMarkers:kyt,onDidChangeMarkers:Nyt,getModels:Myt,getModel:Ryt,onDidCreateModel:Pyt,onWillDisposeModel:Ayt,onDidChangeModelLanguage:Oyt,createWebWorker:Fyt,colorizeElement:Byt,colorize:Wyt,colorizeModelLine:$yt,tokenize:Vyt,defineTheme:zyt,setTheme:Uyt,remeasureFonts:jyt,registerCommand:Kyt,registerLinkOpener:Gyt,registerEditorOpener:qyt,AccessibilitySupport:lV,ContentWidgetPositionPreference:gV,CursorChangeReason:pV,DefaultEndOfLine:mV,EditorAutoIndentStrategy:_V,EditorOption:bV,EndOfLinePreference:CV,EndOfLineSequence:yV,MinimapPosition:NV,MouseTargetType:RV,OverlayWidgetPositionPreference:PV,OverviewRulerLane:AV,GlyphMarginLane:wV,RenderLineNumbersType:FV,RenderMinimap:BV,ScrollbarVisibility:$V,ScrollType:WV,TextEditorCursorBlinkingStyle:KV,TextEditorCursorStyle:GV,TrackedRangeStickiness:qV,WrappingIndent:XV,InjectedTextCursorStops:xV,PositionAffinity:OV,ShowLightbulbIconMode:VV,ConfigurationChangedEvent:VCe,BareFontInfo:hb,FontInfo:oz,TextModelResolvedOptions:HM,FindMatch:hI,ApplyUpdateResult:PE,EditorZoom:Kc,createMultiFileDiffEditor:wyt,EditorType:_T,EditorOptions:kh}}function Yyt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function T2(i,e){return typeof i=="boolean"?i:e}function tde(i,e){return typeof i=="string"?i:e}function Zyt(i){const e={};for(const t of i)e[t]=!0;return e}function nde(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=Zyt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function Ej(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Ui(i,"language definition does not contain attribute '"+s+"', used at: "+e):Ui(i,"attribute reference '"+s+"' must be a string, used at: "+e);return B1(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const r=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,r)}function Qyt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const r=t.split(".");if(r.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Ui(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Ui(i,"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&&!Flt(i,Wm(i,r,"",[],""))))throw Ui(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=r}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let r=0,o=t.length;r0&&n[0]==="^",this.name=this.name+": "+n,this.regex=Ej(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=Dj(e,this.name,t)}}function yxe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=T2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=T2(e.ignoreCase,!1),t.unicode=T2(e.unicode,!1),t.tokenPostfix=tde(e.tokenPostfix,"."+t.languageId),t.defaultToken=tde(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Ui(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Ui(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new ewt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Ui(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Ui(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=T2(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Ui(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Ui(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Ui(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Iv(t,a.open),close:Iv(t,a.close)});else throw Ui(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function twt(i){qw.registerLanguage(i)}function nwt(){let i=[];return i=i.concat(qw.getLanguages()),i}function iwt(i){return jt.get(qi).languageIdCodec.encodeLanguageId(i)}function rwt(i,e){return jt.withServices(()=>{const n=jt.get(qi).onDidRequestRichLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function owt(i,e){return jt.withServices(()=>{const n=jt.get(qi).onDidRequestBasicLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function swt(i,e){if(!jt.get(qi).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return jt.get(Ti).register(i,e,100)}class awt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return ak.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const r=this._actual.tokenizeEncoded(e,n);return new o3(r.tokens,r.endState)}}class ak{constructor(e,t,n,r){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let r=0;for(let o=0,s=e.length;o0&&o[s-1]===h)continue;let f=d.startIndex;c===0?f=0:f{const n=await Promise.resolve(e.create());return n?lwt(n)?Sxe(i,n):new bI(jt.get(qi),jt.get(Dc),i,yxe(i,n),jt.get(mn)):null});return gr.registerFactory(i,t)}function dwt(i,e){if(!jt.get(qi).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return wxe(e)?vQ(i,{create:()=>e}):gr.register(i,Sxe(i,e))}function hwt(i,e){const t=n=>new bI(jt.get(qi),jt.get(Dc),i,yxe(i,n),jt.get(mn));return wxe(e)?vQ(i,{create:()=>e}):gr.register(i,t(e))}function fwt(i,e){return jt.get(yt).referenceProvider.register(i,e)}function gwt(i,e){return jt.get(yt).renameProvider.register(i,e)}function pwt(i,e){return jt.get(yt).newSymbolNamesProvider.register(i,e)}function mwt(i,e){return jt.get(yt).signatureHelpProvider.register(i,e)}function vwt(i,e){return jt.get(yt).hoverProvider.register(i,{provideHover:(n,r,o)=>{const s=n.getWordAtPosition(r);return Promise.resolve(e.provideHover(n,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new W(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new W(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function _wt(i,e){return jt.get(yt).documentSymbolProvider.register(i,e)}function bwt(i,e){return jt.get(yt).documentHighlightProvider.register(i,e)}function Cwt(i,e){return jt.get(yt).linkedEditingRangeProvider.register(i,e)}function ywt(i,e){return jt.get(yt).definitionProvider.register(i,e)}function wwt(i,e){return jt.get(yt).implementationProvider.register(i,e)}function Swt(i,e){return jt.get(yt).typeDefinitionProvider.register(i,e)}function xwt(i,e){return jt.get(yt).codeLensProvider.register(i,e)}function Lwt(i,e,t){return jt.get(yt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=jt.get(sg).read({resource:r.uri}).filter(u=>W.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Ewt(i,e){return jt.get(yt).documentFormattingEditProvider.register(i,e)}function Dwt(i,e){return jt.get(yt).documentRangeFormattingEditProvider.register(i,e)}function Iwt(i,e){return jt.get(yt).onTypeFormattingEditProvider.register(i,e)}function kwt(i,e){return jt.get(yt).linkProvider.register(i,e)}function Twt(i,e){return jt.get(yt).completionProvider.register(i,e)}function Nwt(i,e){return jt.get(yt).colorProvider.register(i,e)}function Rwt(i,e){return jt.get(yt).foldingRangeProvider.register(i,e)}function Mwt(i,e){return jt.get(yt).declarationProvider.register(i,e)}function Pwt(i,e){return jt.get(yt).selectionRangeProvider.register(i,e)}function Awt(i,e){return jt.get(yt).documentSemanticTokensProvider.register(i,e)}function Owt(i,e){return jt.get(yt).documentRangeSemanticTokensProvider.register(i,e)}function Fwt(i,e){return jt.get(yt).inlineCompletionsProvider.register(i,e)}function Bwt(i,e){return jt.get(yt).inlineEditProvider.register(i,e)}function Wwt(i,e){return jt.get(yt).inlayHintsProvider.register(i,e)}function $wt(){return{register:twt,getLanguages:nwt,onLanguage:rwt,onLanguageEncountered:owt,getEncodedLanguageId:iwt,setLanguageConfiguration:swt,setColorMap:uwt,registerTokensProviderFactory:vQ,setTokensProvider:dwt,setMonarchTokensProvider:hwt,registerReferenceProvider:fwt,registerRenameProvider:gwt,registerNewSymbolNameProvider:pwt,registerCompletionItemProvider:Twt,registerSignatureHelpProvider:mwt,registerHoverProvider:vwt,registerDocumentSymbolProvider:_wt,registerDocumentHighlightProvider:bwt,registerLinkedEditingRangeProvider:Cwt,registerDefinitionProvider:ywt,registerImplementationProvider:wwt,registerTypeDefinitionProvider:Swt,registerCodeLensProvider:xwt,registerCodeActionProvider:Lwt,registerDocumentFormattingEditProvider:Ewt,registerDocumentRangeFormattingEditProvider:Dwt,registerOnTypeFormattingEditProvider:Iwt,registerLinkProvider:kwt,registerColorProvider:Nwt,registerFoldingRangeProvider:Rwt,registerDeclarationProvider:Mwt,registerSelectionRangeProvider:Pwt,registerDocumentSemanticTokensProvider:Awt,registerDocumentRangeSemanticTokensProvider:Owt,registerInlineCompletionsProvider:Fwt,registerInlineEditProvider:Bwt,registerInlayHintsProvider:Wwt,DocumentHighlightKind:vV,CompletionItemKind:dV,CompletionItemTag:hV,CompletionItemInsertTextRule:uV,SymbolKind:UV,SymbolTag:jV,IndentAction:SV,CompletionTriggerKind:fV,SignatureHelpTriggerKind:zV,InlayHintKind:LV,InlineCompletionTriggerKind:EV,InlineEditTriggerKind:DV,CodeActionTriggerType:cV,NewSymbolNameTag:MV,FoldingRangeKind:ya,SelectedSuggestionInfo:i1e}}const _Q=Sn("IEditorCancelService"),xxe=new ct("cancellableOperation",!1,w("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Tn(_Q,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(r=>{const o=xxe.bindTo(r.get(Gt)),s=new Ca;return{key:o,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Hwt extends xr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(_Q).add(e,this))}dispose(){this._unregister(),super.dispose()}}st(new class extends zo{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:xxe})}runEditorCommand(i,e){i.get(_Q).cancel(e)}});let Lxe=class Ij{constructor(e,t){if(this.flags=t,this.flags&1){const n=e.getModel();this.modelVersionId=n?Ob("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Ij))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 Ij(e,this.flags))}};class l_ extends Hwt{constructor(e,t,n,r){super(e,r),this._listener=new Fe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!n||!W.containsPosition(n,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!n||!W.containsRange(n,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class bQ extends xr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Qf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===_T.ICodeEditor:!1}function CQ(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===_T.IDiffEditor:!1}function Vwt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function Exe(i){return Qf(i)?i:CQ(i)?i.getModifiedEditor():Vwt(i)&&Qf(i.activeCodeEditor)?i.activeCodeEditor:null}class vS{static _handleEolEdits(e,t){let n;const r=[];for(const o of t)typeof o.eol=="number"&&(n=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),r=n.validateRange(t.range);return n.getFullModelRange().equalsRange(r)}static execute(e,t,n){n&&e.pushUndoStop();const r=wh.capture(e),o=vS._handleEolEdits(e,t);o.length===1&&vS._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Qi.replace(W.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Qi.replaceMove(W.lift(s.range),s.text))),n&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class ide{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class zwt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(ide.toKey(e))}has(e){return this._set.has(ide.toKey(e))}}function Dxe(i,e,t){const n=[],r=new zwt,o=i.ordered(t);for(const a of o)n.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}n.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return n}class Yb{static setFormatterSelector(e){return{dispose:Yb._selectors.unshift(e)}}static async select(e,t,n,r){if(e.length===0)return;const o=In.first(Yb._selectors);if(o)return await o(e,t,n,r)}}Yb._selectors=new Ca;async function Ixe(i,e,t,n,r,o,s){const a=i.get(Wt),{documentRangeFormattingEditProvider:l}=i.get(yt),c=Qf(e)?e.getModel():e,u=l.ordered(c),d=await Yb.select(u,c,n,2);d&&(r.report(d),await a.invokeFunction(Uwt,d,e,t,o,s))}async function Uwt(i,e,t,n,r,o){var s,a;const l=i.get(vd),c=i.get(Ra),u=i.get(F_);let d,h;Qf(t)?(d=t.getModel(),h=new l_(t,5,void 0,r)):(d=t,h=new bQ(t,r));const f=[];let g=0;for(const y of qX(n).sort(W.compareRangesUsingStarts))g>0&&W.areIntersectingOrTouching(f[g-1],y)?f[g-1]=W.fromPositions(f[g-1].getStartPosition(),y.getEndPosition()):g=f.push(y);const p=async y=>{var S,L;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)===null||S===void 0?void 0:S.value,y);const E=await e.provideDocumentRangeFormattingEdits(d,y,d.getFormattingOptions(),h.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)===null||L===void 0?void 0:L.value,E),E},m=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((E,D)=>W.plusRange(E,D.range),y[0].range);if(!S.some(E=>W.intersectRanges(L,E.range)))return!1;for(const E of y)for(const D of S)if(W.intersectRanges(E.range,D.range))return!0;return!1},v=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(s=e.extensionId)===null||s===void 0?void 0:s.value,f);const y=await e.provideDocumentRangesFormattingEdits(d,f,d.getFormattingOptions(),h.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,y),_.push(y)}else{for(const y of f){if(h.token.isCancellationRequested)return!0;_.push(await p(y))}for(let y=0;y({text:L.text,range:W.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:E}of L)if(W.areIntersectingOrTouching(E,S))return[new Et(E.startLineNumber,E.startColumn,E.endLineNumber,E.endColumn)];return null})}return u.playSignal(dn.format,{userGesture:o}),!0}async function jwt(i,e,t,n,r,o){const s=i.get(Wt),a=i.get(yt),l=Qf(e)?e.getModel():e,c=Dxe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=await Yb.select(c,l,t,1);u&&(n.report(u),await s.invokeFunction(Kwt,u,e,t,r,o))}async function Kwt(i,e,t,n,r,o){const s=i.get(vd),a=i.get(F_);let l,c;Qf(t)?(l=t.getModel(),c=new l_(t,5,void 0,r)):(l=t,c=new bQ(t,r));let u;try{const d=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(u=await s.computeMoreMinimalEdits(l.uri,d),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!u||u.length===0)return!1;if(Qf(t))vS.execute(t,u,n!==2),n!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:d}]=u,h=new Et(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);l.pushEditOperations([h],u.map(f=>({text:f.text,range:W.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(W.areIntersectingOrTouching(g,h))return[new Et(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(dn.format,{userGesture:o}),!0}async function Gwt(i,e,t,n,r,o){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,r,o)).catch(eo);if(Ms(l))return await i.computeMoreMinimalEdits(t.uri,l)}}async function qwt(i,e,t,n,r){const o=Dxe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=await Promise.resolve(s.provideDocumentFormattingEdits(t,n,r)).catch(eo);if(Ms(a))return await i.computeMoreMinimalEdits(t.uri,a)}}function kxe(i,e,t,n,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,r,o,s)).catch(eo).then(l=>i.computeMoreMinimalEdits(t.uri,l))}kn.registerCommand("_executeFormatRangeProvider",async function(i,...e){const[t,n,r]=e;Yn(Ft.isUri(t)),Yn(W.isIRange(n));const o=i.get(ul),s=i.get(vd),a=i.get(yt),l=await o.createModelReference(t);try{return Gwt(s,a,l.object.textEditorModel,W.lift(n),r,wn.None)}finally{l.dispose()}});kn.registerCommand("_executeFormatDocumentProvider",async function(i,...e){const[t,n]=e;Yn(Ft.isUri(t));const r=i.get(ul),o=i.get(vd),s=i.get(yt),a=await r.createModelReference(t);try{return qwt(o,s,a.object.textEditorModel,n,wn.None)}finally{a.dispose()}});kn.registerCommand("_executeFormatOnTypeProvider",async function(i,...e){const[t,n,r,o]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string");const s=i.get(ul),a=i.get(vd),l=i.get(yt),c=await s.createModelReference(t);try{return kxe(a,l,c.object.textEditorModel,le.lift(n),r,o,wn.None)}finally{c.dispose()}});kh.wrappingIndent.defaultValue=0;kh.glyphMargin.defaultValue=!1;kh.autoIndent.defaultValue=3;kh.overviewRulerLanes.defaultValue=2;Yb.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const Pa=r1e();Pa.editor=Xyt();Pa.languages=$wt();const Txe=Pa.CancellationTokenSource,yQ=Pa.Emitter,Nxe=Pa.KeyCode,Rxe=Pa.KeyMod,Mxe=Pa.Position,Pxe=Pa.Range,Axe=Pa.Selection,Oxe=Pa.SelectionDirection,Fxe=Pa.MarkerSeverity,Bxe=Pa.MarkerTag,Wxe=Pa.Uri,$xe=Pa.Token,Hxe=Pa.editor,VT=Pa.languages,A7=globalThis.MonacoEnvironment;(A7!=null&&A7.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Pa);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 w5=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Txe,Emitter:yQ,KeyCode:Nxe,KeyMod:Rxe,MarkerSeverity:Fxe,MarkerTag:Bxe,Position:Mxe,Range:Pxe,Selection:Axe,SelectionDirection:Oxe,Token:$xe,Uri:Wxe,editor:Hxe,languages:VT},Symbol.toStringTag,{value:"Module"})),Xwt="modulepreload",Ywt=function(i){return"/ir-virtual-machine/"+i},rde={},Rt=function(e,t,n){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Ywt(o),o in rde)return;rde[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!n)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Xwt,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- +`),await this._clipboardService.writeText(S)})),n.getOption(91)||v.push(new Il("diff.inline.revertChange",w("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Lr(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:p,height:m}=Hr(this._diffActions),v=Math.floor(u/3);g.preventDefault(),f(g.posx,p+m+v)})),this._register(n.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(n.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),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:r}=Hr(e),o=t-r,s=Math.floor(o/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function q1t(i,e,t,n){vs(n,e.fontInfo);const r=t.length>0,o=new KS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=yc.isBasicASCII(l,r),u=yc.containsRTL(l,c,o),d=bT(new M_(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==ac.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var Y1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let bj=class extends me{constructor(e,t,n,r,o,s,a,l,c,u){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=r,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=u,this._originalTopPadding=Vn(this,0),this._originalScrollOffset=Vn(this,0),this._originalScrollOffsetAnimated=Aue(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Vn(this,0),this._modifiedScrollOffset=Vn(this,0),this._modifiedScrollOffsetAnimated=Aue(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Vn("invalidateAlignmentsState",0),h=this._register(new mi(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()}));const f=this._diffModel.map(y=>y?ji(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),g=en(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;d.read(y);const D=this._options.renderSideBySide.read(y);return Gue(this._editors.original,this._editors.modified,L.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,D)}),p=en(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;d.read(y);const E=L.changes.map(D=>new vxe(D));return Gue(this._editors.original,this._editors.modified,E,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const y=document.createElement("div");return y.className="diagonal-fill",y}const v=this._register(new Fe);this.viewZones=tx(this,(y,S)=>{var L,E,D,k,T,M,P,N;v.clear();const R=g.read(y)||[],O=[],B=[],$=this._modifiedTopPadding.read(y);$>0&&B.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0});const G=this._originalTopPadding.read(y);G>0&&O.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:G,showInHiddenAreas:!0,suppressMouseDown:!0});const U=this._options.renderSideBySide.read(y),j=U||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(j){const be=this._editors.original.getModel();for(const Ge of R)if(Ge.diff)for(let nt=Ge.originalRange.startLineNumber;ntbe.getLineCount())return{orig:O,mod:B};j==null||j.addRequest(be.getLineContent(nt),null,null)}}const ie=(E=j==null?void 0:j.finalize())!==null&&E!==void 0?E:[];let Y=0;const J=this._editors.modified.getOption(67),Q=(D=this._diffModel.read(y))===null||D===void 0?void 0:D.movedTextToCompare.read(y),he=(T=(k=this._editors.original.getModel())===null||k===void 0?void 0:k.mightContainNonBasicASCII())!==null&&T!==void 0?T:!1,ge=(P=(M=this._editors.original.getModel())===null||M===void 0?void 0:M.mightContainRTL())!==null&&P!==void 0?P:!1,ye=pQ.fromEditor(this._editors.modified);for(const be of R)if(be.diff&&!U){if(!be.originalRange.isEmpty){f.read(y);const nt=document.createElement("div");nt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const je=this._editors.original.getModel();if(be.originalRange.endLineNumberExclusive-1>je.getLineCount())return{orig:O,mod:B};const _e=new X1t(be.originalRange.mapToLineArray(Qe=>je.tokenization.getLineTokens(Qe)),be.originalRange.mapToLineArray(Qe=>ie[Y++]),he,ge),Ve=[];for(const Qe of be.diff.innerChanges||[])Ve.push(new BE(Qe.originalRange.delta(-(be.diff.original.startLineNumber-1)),gj.className,0));const Le=q1t(_e,ye,Ve,nt),Pe=document.createElement("div");if(Pe.className="inline-deleted-margin-view-zone",vs(Pe,ye.fontInfo),this._options.renderIndicators.read(y))for(let Qe=0;QeYm(Be),Pe,this._editors.modified,be.diff,this._diffEditorWidget,Le.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Qe=0;Qe1&&O.push({afterLineNumber:be.originalRange.startLineNumber+Qe,domNode:m(),heightInPx:(Ye-1)*J,showInHiddenAreas:!0,suppressMouseDown:!0})}B.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:nt,heightInPx:Le.heightInLines*J,minWidthInPx:Le.minWidthInPx,marginDomNode:Pe,setZoneId(Qe){Be=Qe},showInHiddenAreas:!0,suppressMouseDown:!0})}const Ge=document.createElement("div");Ge.className="gutter-delete",O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:be.modifiedHeightInPx,marginDomNode:Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ge=be.modifiedHeightInPx-be.originalHeightInPx;if(Ge>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let nt=function(){const _e=document.createElement("div");return _e.className="arrow-revert-change "+Vt.asClassName(tt.arrowRight),S.add(xe(_e,"mousedown",Ve=>Ve.stopPropagation())),S.add(xe(_e,"click",Ve=>{Ve.stopPropagation(),o.revert(be.diff)})),Xe("div",{},_e)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let je;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(je=nt()),B.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ge,marginDomNode:je,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(N=p.read(y))!==null&&N!==void 0?N:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(be.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Ge=be.modifiedHeightInPx-be.originalHeightInPx;Ge>0?O.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ge,showInHiddenAreas:!0,suppressMouseDown:!0}):B.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:O,mod:B}});let _=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(y.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(y.scrollLeft),_=!1)})),this._originalScrollTop=ji(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ji(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(yn(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(yn(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(yn(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let E=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};bj=Y1t([Kue(8,Zp),Kue(9,$l)],bj);function Gue(i,e,t,n,r,o){const s=new Op(que(i,n)),a=new Op(que(e,r)),l=i.getOption(67),c=e.getOption(67),u=[];let d=0,h=0;function f(g,p){for(;;){let m=s.peek(),v=a.peek();if(m&&m.lineNumber>=g&&(m=void 0),v&&v.lineNumber>=p&&(v=void 0),!m&&!v)break;const _=m?m.lineNumber-d:Number.MAX_VALUE,y=v?v.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),m={lineNumber:v.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:vn.ofLength(m.lineNumber,1),modifiedRange:vn.ofLength(v.lineNumber,1),originalHeightInPx:l+m.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let y=function(S,L){var E,D,k,T;if(S<_||LO.lineNumberO+B.heightInPx,0))!==null&&D!==void 0?D:0,R=(T=(k=a.takeWhile(O=>O.lineNumberO+B.heightInPx,0))!==null&&T!==void 0?T:0;u.push({originalRange:M,modifiedRange:P,originalHeightInPx:M.length*l+N,modifiedHeightInPx:P.length*c+R,diff:g.lineRangeMapping}),_=S,v=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let m=!0,v=p.modified.startLineNumber,_=p.original.startLineNumber;if(o)for(const S of p.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&y(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=i.getModel(),E=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new le(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return v1t(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Z1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Q1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Fu;let Yb=Fu=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=a,this.width=Fu.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=ji(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=en(h=>{const f=l.read(h),g=f.getColor($ct)||(f.getColor(Bct)||Ez).transparent(2),p=f.getColor(Hct)||(f.getColor(Wct)||Dz).transparent(2);return{insertColor:g,removeColor:p}}),u=Jn(document.createElement("div"));u.setClassName("diffViewport"),u.setPosition("absolute");const d=pi("div.diffOverview",{style:{position:"absolute",top:"0px",width:Fu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(I2(d,u.domNode)),this._register(Lr(d,Je.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(xe(d,Je.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(I2(this._rootElement,d)),this._register(Ah((h,f)=>{const g=this._diffModel.read(h),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(I2(d,p.getDomNode())));const m=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(m&&(f.add(m),f.add(I2(d,m.getDomNode()))),!p||!m)return;const v=_a("viewZoneChanged",this._editors.original.onDidChangeViewZones),_=_a("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=_a("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),S=_a("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(yn(L=>{var E;v.read(L),_.read(L),y.read(L),S.read(L);const D=c.read(L),k=(E=g==null?void 0:g.diff.read(L))===null||E===void 0?void 0:E.mappings;function T(N,R,O){const B=O._getViewModel();return B?N.filter($=>$.length>0).map($=>{const G=B.coordinatesConverter.convertModelPositionToViewPosition(new le($.startLineNumber,1)),U=B.coordinatesConverter.convertModelPositionToViewPosition(new le($.endLineNumberExclusive,1)),j=U.lineNumber-G.lineNumber;return new uwe(G.lineNumber,U.lineNumber,j,R.toString())}):[]}const M=T((k||[]).map(N=>N.lineRangeMapping.original),D.removeColor,this._editors.original),P=T((k||[]).map(N=>N.lineRangeMapping.modified),D.insertColor,this._editors.modified);p==null||p.setZones(M),m==null||m.setZones(P)})),f.add(yn(L=>{const E=this._rootHeight.read(L),D=this._rootWidth.read(L),k=this._modifiedEditorLayoutInfo.read(L);if(k){const T=Fu.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Fu.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:E,right:T+Fu.ONE_OVERVIEW_WIDTH,width:Fu.ONE_OVERVIEW_WIDTH}),m.setLayout({top:0,height:E,right:0,width:Fu.ONE_OVERVIEW_WIDTH});const M=this._editors.modifiedScrollTop.read(L),P=this._editors.modifiedScrollHeight.read(L),N=this._editors.modified.getOption(103),R=new rS(N.verticalHasArrows?N.arrowSize:0,N.verticalScrollbarSize,0,k.height,P,M);u.setTop(R.getSliderPosition()),u.setHeight(R.getSliderSize())}else u.setTop(0),u.setHeight(0);d.style.height=E+"px",d.style.left=D-Fu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",u.setWidth(Fu.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Yb.ONE_OVERVIEW_WIDTH=15;Yb.ENTIRE_DIFF_OVERVIEW_WIDTH=Fu.ONE_OVERVIEW_WIDTH*2;Yb=Fu=Z1t([Q1t(6,Mo)],Yb);class y5 extends me{constructor(){super(...arguments),this._id=++y5.idCounter,this._onDidDispose=this._register(new ae),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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,r=!0){this._targetEditor.revealRange(e,t,n,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,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}y5.idCounter=0;var J1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Cj=class extends me{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,n,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new ae),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=ji(this.modified.onDidChangeModel,()=>this.modified.getModel()),this.modifiedScrollTop=ji(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=ji(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedSelections=ji(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=mw({owner:this,equalityComparer:le.equals},l=>{var c,u;return(u=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&u!==void 0?u:new le(1,1)}),this.originalCursor=ji(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new le(1,1)}),this._register($T({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.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 n=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,n,r){const o=this._createInnerEditor(e,t,n,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Yb.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=kh.revealHorizontalRightPadding.defaultValue+Yb.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_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 t;e||(e="");const n=w("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};Cj=J1t([Xue(5,Wt),Xue(6,ci)],Cj);class eyt{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=Vn(this,0),this.couldShowInlineViewBecauseOfSize=en(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=en(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=en(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n))),this.readOnly=en(this,n=>this._options.read(n).readOnly),this.shouldRenderRevertArrows=en(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n))),this.renderIndicators=en(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=en(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=en(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=en(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=en(this,n=>this._options.read(n).maxComputationTime),this.showMoves=en(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=en(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=en(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=en(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=en(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=en(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=en(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=en(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=en(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=en(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=en(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const t={...e,...Yue(e,js)};this._options=Vn(this,t)}updateOptions(e){const t=Yue(e,this._options.get()),n={...this._options.get(),...e,...t};this._options.set(n,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function Yue(i,e){var t,n,r,o,s,a,l,c;return{enableSplitViewResizing:Tt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Tnt(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Tt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Tt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:_0(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:_0(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Tt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Tt(i.renderIndicators,e.renderIndicators),originalEditable:Tt(i.originalEditable,e.originalEditable),diffCodeLens:Tt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Tt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:yr(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:yr(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Tt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Tt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Tt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Tt((o=(r=i.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:_0((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:_0((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:_0((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Tt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Tt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:_0(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Tt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}const P7=[];class tyt extends me{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._widget=r,this._selectedDiffs=en(this,o=>{const s=this._diffModel.read(o),a=s==null?void 0:s.diff.read(o);if(!a)return P7;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return P7;const c=new Uu(l.map(h=>vn.fromRangeInclusive(h))),d=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(f=>l.some(g=>W.areIntersecting(f.modifiedRange,g)))}));return d.length===0||d.every(h=>h.rangeMappings.length===0)?P7:d}),this._register(Ah((o,s)=>{if(!this._options.shouldRenderRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],u=this._selectedDiffs.read(o),d=new Set(u.map(h=>h.mapping));if(u.length>0){const h=this._editors.modifiedSelections.read(o),f=s.add(new rk(h[h.length-1].positionLineNumber,this._widget,u.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const h of l.mappings)if(!d.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const f=s.add(new rk(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping.innerChanges,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}s.add(Ot(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class rk extends me{getId(){return this._id}constructor(e,t,n,r){super(),this._lineNumber=e,this._widget=t,this._diffs=n,this._revertSelection=r,this._id=`revertButton${rk.counter++}`,this._domNode=pi("div.revertButton",{title:this._revertSelection?w("revertSelectedChanges","Revert Selected Changes"):w("revertChange","Revert Change")},[FI(tt.arrowRight)]).root,this._register(xe(this._domNode,Je.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(xe(this._domNode,Je.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(xe(this._domNode,Je.CLICK,o=>{this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Uf.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}rk.counter=0;var nyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let l_=class extends y5{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,n,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=pi("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[pi("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[Xe("span",{},"No Changes")]),pi("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),pi("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),pi("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=Vn(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=ot.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new IT([Gt,this._contextKeyService])),this._boundarySashes=Vn(this,void 0),this._accessibleDiffViewerShouldBeVisible=Vn(this,!1),this._accessibleDiffViewerVisible=en(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=Vn(this,void 0),this._layoutInfo=en(this,S=>{var L,E,D,k,T;const M=this._rootSizeObserver.width.read(S),P=this._rootSizeObserver.height.read(S),N=(L=this._sash.read(S))===null||L===void 0?void 0:L.sashLeft.read(S),R=N??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),O=M-R-((D=(E=this._overviewRulerPart.read(S))===null||E===void 0?void 0:E.width)!==null&&D!==void 0?D:0),B=(T=(k=this._movedBlocksLinesPart.read(S))===null||k===void 0?void 0:k.width.read(S))!==null&&T!==void 0?T:0,$=R-B;return this.elements.original.style.width=$+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=O+"px",this.elements.modified.style.left=R+"px",this._editors.original.layout({width:$,height:P},!0),this._editors.modified.layout({width:O,height:P},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,L)=>S==null?void 0:S.diff.read(L)),this.onDidUpdateDiff=ot.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ot(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new hxe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new eyt(t),this._register(yn(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(K.isEmbeddedDiffEditor.key,!1),this._register(k2(K.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(k2(K.comparingMovedCode,this._contextKeyService,S=>{var L;return!!(!((L=this._diffModel.read(S))===null||L===void 0)&&L.movedTextToCompare.read(S))})),this._register(k2(K.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(k2(K.hasChanges,this._contextKeyService,S=>{var L,E,D;return((D=(E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)!==null&&D!==void 0?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Cj,this.elements.original,this.elements.modified,this._options,n,(S,L,E,D)=>this._createInnerEditor(S,L,E,D))),this._overviewRulerPart=Im(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(uf(Yb,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=Im(this,S=>{const L=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",L),L?new $1t(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((E,D)=>{var k,T;return E-((T=(k=this._overviewRulerPart.read(D))===null||k===void 0?void 0:k.width)!==null&&T!==void 0?T:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const u=Im(this,S=>this._instantiationService.createInstance(uf(ik,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Im(this,S=>this._instantiationService.createInstance(uf(W1t,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,h=new Set;let f=!1;const g=Im(this,S=>this._instantiationService.createInstance(uf(bj,S),Bt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||u.get().isUpdatingHiddenAreas,d,h)).recomputeInitiallyAndOnChange(this._store),p=en(this,S=>{const L=g.read(S).viewZones.read(S).orig,E=u.read(S).viewZones.read(S).origViewZones;return L.concat(E)}),m=en(this,S=>{const L=g.read(S).viewZones.read(S).mod,E=u.read(S).viewZones.read(S).modViewZones;return L.concat(E)});this._register(eF(this._editors.original,p,S=>{f=S},d));let v;this._register(eF(this._editors.modified,m,S=>{f=S,f?v=wh.capture(this._editors.modified):(v==null||v.restore(this._editors.modified),v=void 0)},h)),this._accessibleDiffViewer=Im(this,S=>this._instantiationService.createInstance(uf(sv,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,E)=>this._accessibleDiffViewerShouldBeVisible.set(L,E),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,E)=>{var D;return(D=L==null?void 0:L.diff.read(E))===null||D===void 0?void 0:D.mappings.map(k=>k.lineRangeMapping)}),new M1t(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register(Pv(this.elements.modified,{visibility:_})),this._register(Pv(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(HT(this._layoutInfo)),Im(this,S=>new(uf(Av,S))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(Pv(this.elements.overlay,{width:this._layoutInfo.map((S,L)=>S.originalEditor.width+(this._options.renderSideBySide.read(L)?0:S.modifiedEditor.width)),visibility:en(S=>{var L,E;return this._options.hideUnchangedRegions.read(S)&&((E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)===0?"visible":"hidden"})})),this._register(ot.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>{var L,E;if((S==null?void 0:S.reason)===3){const D=(E=(L=this._diffModel.get())===null||L===void 0?void 0:L.diff.get())===null||E===void 0?void 0:E.mappings.find(k=>k.lineRangeMapping.modified.contains(S.position.lineNumber));D!=null&&D.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(dn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):D!=null&&D.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(dn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):D&&this._accessibilitySignalService.playSignal(dn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const y=this._diffModel.map(this,(S,L)=>{if(S)return S.diff.read(L)===void 0&&!S.isDiffUpToDate.read(L)});this._register(Ah((S,L)=>{if(y.read(S)===!0){const E=this._editorProgressService.show(!0,1e3);L.add(Ot(()=>E.done()))}})),this._register(Ot(()=>{var S;this._shouldDisposeDiffModel&&((S=this._diffModel.get())===null||S===void 0||S.dispose())})),this._register(new tyt(this._editors,this._diffModel,this._options,this))}_createInnerEditor(e,t,n,r){return e.createInstance(sS,t,n,r)}_createDiffEditorContributions(){const e=Zy.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){nn(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return _T.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(_j,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const n=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(n==null?void 0:n.model)&&tk(t,r=>{var o;ji.batchEventsGlobally(r,()=>{this._editors.original.setModel(n?n.model.model.original:null),this._editors.modified.setModel(n?n.model.model.modified:null)});const s=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=n==null?void 0:n.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(n==null?void 0:n.model,r),a&&(s==null||s.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?iyt(t):null}revert(e){if(e.innerChanges){this.revertRangeMappings(e.innerChanges);return}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 n=e.map(r=>({range:r.modifiedRange,text:t.model.original.getValueInRange(r.originalRange)}));this._editors.modified.executeEdits("diffEditor",n)}_goTo(e){this._editors.modified.setPosition(new le(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,n,r,o;const s=(n=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||n===void 0?void 0:n.mappings;if(!s||s.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(r=s.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&r!==void 0?r:s[0]:l=(o=fI(s,c=>c.lineRangeMapping.modified.startLineNumber{var t;const n=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!n||n.length===0||this._goTo(n[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),r=n?this._editors.modified:this._editors.original,o=n?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Oue(a.getStartPosition(),l),u=Oue(a.getEndPosition(),l);s=W.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pi(n=>{for(const r of t)r.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pi(n=>{for(const r of t)r.showAll(n)})}};l_=nyt([bL(3,Gt),bL(4,Wt),bL(5,jn),bL(6,B_),bL(7,A_)],l_);function iyt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,r,o,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,r=0,a=void 0):(n=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var mQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Yi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ryt=0,Zue=!1;function oyt(i){if(!i){if(Zue)return;Zue=!0}Ult(i||hi.document.body)}let nF=class extends sS{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};f.ariaLabel=f.ariaLabel||DO.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+DO.accessibilityHelpMessage,super(e,f,{},n,r,o,s,l,c,u,d,h),a instanceof gS?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,oyt(f.ariaContainerElement),b_t((g,p)=>n.createInstance(yO,g,p,{}))}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++ryt,o=Re.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),me.None;const t=e.id,n=e.label,r=Re.and(Re.equals("editorId",this.getId()),Re.deserialize(e.precondition)),o=e.keybindings,s=Re.and(r,Re.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Fe,d=this.getId()+":"+t;if(u.add(kn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:r,group:a,order:l};u.add(ns.appendMenuItem(H.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new hwe(d,n,n,void 0,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(Ot(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof vO)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};nF=mQ([Yi(2,Wt),Yi(3,jn),Yi(4,cr),Yi(5,Gt),Yi(6,ci),Yi(7,Mo),Yi(8,zr),Yi(9,pd),Yi(10,Ti),Yi(11,yt)],nF);let yj=class extends nF{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p){const m={...t};ZO(u,m,!1);const v=l.registerEditorContainer(e);typeof m.theme=="string"&&l.setTheme(m.theme),typeof m.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!m.autoDetectHighContrast);const _=m.model;delete m.model,super(e,m,n,r,o,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(v);let y;if(typeof _>"u"){const S=f.getLanguageIdByMimeType(m.language)||m.language||mc;y=_xe(h,f,m.value||"",S,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){ZO(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)}};yj=mQ([Yi(2,Wt),Yi(3,jn),Yi(4,cr),Yi(5,Gt),Yi(6,ci),Yi(7,Dc),Yi(8,zr),Yi(9,mn),Yi(10,pd),Yi(11,or),Yi(12,qi),Yi(13,Ti),Yi(14,yt)],yj);let wj=class extends l_{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};ZO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,n,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){ZO(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,n){return e.createInstance(nF,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};wj=mQ([Yi(2,Wt),Yi(3,Gt),Yi(4,jn),Yi(5,Dc),Yi(6,zr),Yi(7,mn),Yi(8,$l),Yi(9,A_),Yi(10,Zp),Yi(11,B_)],wj);function _xe(i,e,t,n,r){if(t=t||"",!n){const o=t.indexOf(` +`);let s=t;return o!==-1&&(s=t.substring(0,o)),Que(i,t,e.createByFilepathOrFirstLine(r||null,s),r)}return Que(i,t,e.createById(n),r)}function Que(i,e,t,n){return i.createModel(e,t,n)}class syt extends me{constructor(e,t,n={orientation:0}){var r;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Tit),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Fe),n.hoverDelegate=(r=n.hoverDelegate)!==null&&r!==void 0?r:this._register(qp("element",!0)),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new ok(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new du(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(o,s)=>{var a;if(o.id===ok.ID)return this.toggleMenuActionViewItem=new TO(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Vt.asClassNameArray((a=n.moreIcon)!==null&&a!==void 0?a:tt.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(n.actionViewItemProvider){const l=n.actionViewItemProvider(o,s);if(l)return l}if(o instanceof jw){const l=new TO(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}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 n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,n,r;const o=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class ok extends Il{constructor(e,t){t=t||w("moreActions","More Actions..."),super(ok.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}}ok.ID="toolbar.toggle.more";var bxe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sk=class extends syt{constructor(e,t,n,r,o,s,a){super(e,o,{getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=n,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new Fe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;fm==null?void 0:m.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let m=0;m=g&&(a[m]=void 0,d[m]=v))}}kse(a),kse(d),super.setActions(a,ho.join(d,l)),c.length>0&&this._sessionDisposables.add(xe(this.getElement(),"contextmenu",f=>{var g,p,m,v,_;const y=new Gu(Bt(this.getElement()),f),S=this.getItemAction(y.target);if(!S)return;y.preventDefault(),y.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let k=0;kthis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>D,menuId:(m=this._options)===null||m===void 0?void 0:m.contextMenu,menuActionOptions:{renderShortTitle:!0,...(v=this._options)===null||v===void 0?void 0:v.menuOptions},skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};sk=bxe([Cf(2,mu),Cf(3,Gt),Cf(4,$l),Cf(5,ci),Cf(6,ia)],sk);let Sj=class extends sk{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this._onDidChangeMenuItems=this._store.add(new ae);const c=this._store.add(r.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var d,h,f;const g=[],p=[];n5(c,n==null?void 0:n.menuOptions,{primary:g,secondary:p},(d=n==null?void 0:n.toolbarOptions)===null||d===void 0?void 0:d.primaryGroup,(h=n==null?void 0:n.toolbarOptions)===null||h===void 0?void 0:h.shouldInlineSubmenu,(f=n==null?void 0:n.toolbarOptions)===null||f===void 0?void 0:f.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(c.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new Qi("This toolbar is populated from a menu.")}};Sj=bxe([Cf(3,mu),Cf(4,Gt),Cf(5,$l),Cf(6,ci),Cf(7,ia)],Sj);class ayt extends Vb{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}var lyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class uyt{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let iF=class extends me{constructor(e,t,n,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=n,this._instantiationService=r,this._viewModel=Vn(this,void 0),this._collapsed=en(this,s=>{var a;return(a=this._viewModel.read(s))===null||a===void 0?void 0:a.collapsed.read(s)}),this._editorContentHeight=Vn(this,500),this.contentHeight=en(this,s=>(this._collapsed.read(s)?0:this._editorContentHeight.read(s))+this._outerEditorHeight),this._modifiedContentWidth=Vn(this,0),this._modifiedWidth=Vn(this,0),this._originalContentWidth=Vn(this,0),this._originalWidth=Vn(this,0),this.maxScroll=en(this,s=>{const a=this._modifiedContentWidth.read(s)-this._modifiedWidth.read(s),l=this._originalContentWidth.read(s)-this._originalWidth.read(s);return a>l?{maxScroll:a,width:this._modifiedWidth.read(s)}:{maxScroll:l,width:this._originalWidth.read(s)}}),this._elements=pi("div.multiDiffEntry",[pi("div.header@header",[pi("div.header-content",[pi("div.collapse-button@collapseButton"),pi("div.file-path",[pi("div.title.modified.show-file-icons@primaryPath",[]),pi("div.status.deleted@status",["R"]),pi("div.title.original.show-file-icons@secondaryPath",[])]),pi("div.actions@actions")])]),pi("div.editorParent",[pi("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(l_,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Jue(this.editor.getModifiedEditor()),this.isOriginalFocused=Jue(this.editor.getOriginalEditor()),this.isFocused=en(this,s=>this.isModifedFocused.read(s)||this.isOriginalFocused.read(s)),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=new Fe,this._headerHeight=48,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new GO(this._elements.collapseButton,{});this._register(yn(s=>{o.element.className="",o.icon=this._collapsed.read(s)?tt.chevronRight:tt.chevronDown})),this._register(o.onDidClick(()=>{var s;(s=this._viewModel.get())===null||s===void 0||s.collapsed.set(!this._collapsed.get(),void 0)})),this._register(yn(s=>{this._elements.editor.style.display=this._collapsed.read(s)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(s=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(s=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(s=>{aP(a=>{this._editorContentHeight.set(s.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(s=>{if(this._isSettingScrollTop||!s.scrollTopChanged||!this._data)return;const a=s.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(yn(s=>{const a=this.isFocused.read(s);this._elements.root.classList.toggle("focused",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Sj,this._elements.actions,H.MultiDiffEditorFileToolbar,{actionRunner:this._register(new ayt(()=>{var s;return(s=this._viewModel.get())===null||s===void 0?void 0:s.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:s=>s.startsWith("navigation")},actionViewItemProvider:(s,a)=>ySe(r,s,a)}))}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}}const n=e.viewModel.entry.value;n.onOptionsDidChange&&this._dataStore.add(n.onOptionsDidChange(()=>{var r;this.editor.updateOptions(t((r=n.options)!==null&&r!==void 0?r:{}))})),aP(r=>{var o,s,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((s=e.viewModel.modifiedUri)!==null&&s!==void 0?s:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,u=!1,d=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",d=!0):(h="D",u=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",u),this._elements.status.classList.toggle("added",d),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,r),this.editor.setModel(e.viewModel.diffEditorViewModel,r),this.editor.updateOptions(t((l=n.options)!==null&&l!==void 0?l:{}))})}render(e,t,n,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 o=e.length-this._headerHeight,s=Math.max(0,Math.min(r.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,aP(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=n,this.editor.getOriginalEditor().setScrollTop(n)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||n>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};iF=lyt([cyt(3,Wt)],iF);function Jue(i){return ji(e=>{const t=new Fe;return t.add(i.onDidFocusEditorWidget(()=>e(!0))),t.add(i.onDidBlurEditorWidget(()=>e(!1))),t},()=>i.hasWidgetFocus())}class dyt{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let n;if(this._unused.size===0)n=this._create(e),this._itemData.set(n,e);else{const r=[...this._unused.values()];n=(t=r.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:r[0],this._unused.delete(n),this._itemData.set(n,e),n.setData(e)}return this._used.add(n),{object:n,dispose:()=>{this._used.delete(n),this._unused.size>5?n.dispose():this._unused.add(n)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var hyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ede=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xj=class extends me{constructor(e,t,n,r,o,s){super(),this._element=e,this._dimension=t,this._viewModel=n,this._workbenchUIElementFactory=r,this._parentContextKeyService=o,this._parentInstantiationService=s,this._elements=pi("div.monaco-component.multiDiffEditor",[pi("div@content",{style:{overflow:"hidden"}}),pi("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new hxe(this._element,void 0)),this._objectPool=this._register(new dyt(l=>{const c=this._instantiationService.createInstance(iF,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this._scrollable=this._register(new XS({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>Ml(Bt(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new A3(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=ji(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=ji(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItems=tx(this,(l,c)=>{const u=this._viewModel.read(l);return u?u.items.read(l).map(h=>{var f;const g=c.add(new fyt(h,this._objectPool,this.scrollLeft,m=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+m})})),p=(f=this._lastDocStates)===null||f===void 0?void 0:f[g.getKey()];return p&&Pi(m=>{g.setViewState(p,m)}),g}):[]}),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((u,d)=>u+d.contentHeight.read(c)+this._spaceBetweenPx,0)),this.activeDiffItem=en(this,l=>this._viewItems.read(l).find(c=>{var u;return(u=c.template.read(l))===null||u===void 0?void 0:u.isFocused.read(l)})),this.lastActiveDiffItem=f1t((l,c)=>{var u;return(u=this.activeDiffItem.read(l))!==null&&u!==void 0?u:c}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new IT([Gt,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(K.inMultiDiffEditor.key,!0),this._register(Ah((l,c)=>{const u=this._viewModel.read(l);if(u&&u.contextKeys)for(const[d,h]of Object.entries(u.contextKeys)){const f=this._contextKeyService.createKey(d,void 0);f.set(h),c.add(Ot(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(K.multiDiffEditorAllCollapsed.key,!1);this._register(yn(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(yn(l=>{const c=this.lastActiveDiffItem.read(l);Pi(u=>{var d;(d=this._viewModel.read(l))===null||d===void 0||d.activeDiffItem.set(c==null?void 0:c.viewModel,u)})})),this._register(yn(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._elements.content.style.position="relative",this._register(yn(l=>{const c=this._sizeObserver.height.read(l);this._elements.root.style.height=`${c}px`;const u=this._totalHeight.read(l);this._elements.content.style.height=`${u}px`;const d=this._sizeObserver.width.read(l);let h=d;const f=this._viewItems.read(l),g=RY(f,p=>p.maxScroll.read(l).maxScroll);if(g){const p=g.maxScroll.read(l);h=d+p.maxScroll}this._scrollableElement.setScrollDimensions({width:d,height:c,scrollHeight:u,scrollWidth:h})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(Ot(()=>{e.replaceChildren()})),this._register(this._register(yn(l=>{aP(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let n=0,r=0,o=0;const s=this._sizeObserver.height.read(e),a=bn.ofStartAndLength(t,s),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const u=c.contentHeight.read(e),d=Math.min(u,s),h=bn.ofStartAndLength(r,d),f=bn.ofStartAndLength(o,u);if(f.isBefore(a))n-=u-d,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,u-d));n-=g;const p=bn.ofStartAndLength(t+n,s);c.render(h,g,l,p)}r+=d+this._spaceBetweenPx,o+=u+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+n)}px)`}};xj=hyt([ede(4,Gt),ede(5,Wt)],xj);class fyt extends me{constructor(e,t,n,r){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=n,this._deltaScrollVertical=r,this._templateRef=this._register(nk(this,void 0)),this.contentHeight=en(this,o=>{var s,a,l;return(l=(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=en(this,o=>{var s,a;return(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=en(this,o=>{var s;return(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object}),this._isHidden=Vn(this,!1),this._register(yn(o=>{var s;const a=this._scrollLeft.read(o);(s=this._templateRef.read(o))===null||s===void 0||s.object.setScrollLeft(a)})),this._register(yn(o=>{const s=this._templateRef.read(o);!s||!this._isHidden.read(o)||s.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var n;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const r=this.viewModel.lastTemplateData.get(),o=(n=e.selections)===null||n===void 0?void 0:n.map(Et.liftSelection);this.viewModel.lastTemplateData.set({...r,selections:o},t);const s=this._templateRef.get();s&&o&&s.object.editor.setSelections(o)}_updateTemplateData(e){var t;const n=this._templateRef.get();n&&this.viewModel.lastTemplateData.set({contentHeight:n.object.contentHeight.get(),selections:(t=n.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Pi(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,n,r){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new uyt(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const s=this.viewModel.lastTemplateData.get().selections;s&&o.object.editor.setSelections(s)}o.object.render(e,n,t,r)}}X("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},w("multiDiffEditor.headerBackground","The background color of the diff editor's header"));X("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},w("multiDiffEditor.background","The background color of the multi file diff editor"));X("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},w("multiDiffEditor.border","The border color of the multi file diff editor"));var gyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Lj=class extends me{constructor(e,t,n){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=n,this._dimension=Vn(this,void 0),this._viewModel=Vn(this,void 0),this._widgetImpl=tx(this,(r,o)=>(uf(iF,r),o.add(this._instantiationService.createInstance(uf(xj,r),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(HT(this._widgetImpl))}};Lj=gyt([pyt(2,Wt)],Lj);function myt(i,e,t){return jt.initialize(t||{}).createInstance(yj,i,e)}function vyt(i){return jt.get(jn).onCodeEditorAdd(t=>{i(t)})}function _yt(i){return jt.get(jn).onDiffEditorAdd(t=>{i(t)})}function byt(){return jt.get(jn).listCodeEditors()}function Cyt(){return jt.get(jn).listDiffEditors()}function yyt(i,e,t){return jt.initialize(t||{}).createInstance(wj,i,e)}function wyt(i,e){const t=jt.initialize(e||{});return new Lj(i,{},t)}function Syt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return kn.registerCommand(i.id,i.run)}function xyt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Re.deserialize(i.precondition),t=(r,...o)=>zo.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Fe;if(n.add(kn.registerCommand(i.id,t)),i.contextMenuGroupId){const r={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(ns.appendMenuItem(H.EditorContext,r))}if(Array.isArray(i.keybindings)){const r=jt.get(ci);if(!(r instanceof gS))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Re.and(e,Re.deserialize(i.keybindingContext));n.add(r.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:o}))))}}return n}function Lyt(i){return Cxe([i])}function Cxe(i){const e=jt.get(ci);return e instanceof gS?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Re.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),me.None)}function Eyt(i,e,t){const n=jt.get(qi),r=n.getLanguageIdByMimeType(e)||e;return _xe(jt.get(or),n,i,r,t)}function Dyt(i,e){const t=jt.get(qi),n=t.getLanguageIdByMimeType(e)||e||mc;i.setLanguage(t.createById(n))}function Iyt(i,e,t){i&&jt.get(sg).changeOne(e,i.uri,t)}function kyt(i){jt.get(sg).changeAll(i,[])}function Tyt(i){return jt.get(sg).read(i)}function Nyt(i){return jt.get(sg).onMarkerChanged(i)}function Ryt(i){return jt.get(or).getModel(i)}function Myt(){return jt.get(or).getModels()}function Pyt(i){return jt.get(or).onModelAdded(i)}function Ayt(i){return jt.get(or).onModelRemoved(i)}function Oyt(i){return jt.get(or).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function Fyt(i){return _lt(jt.get(or),jt.get(Ti),i)}function Byt(i,e){const t=jt.get(qi),n=jt.get(Dc);return $Y.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function Wyt(i,e,t){const n=jt.get(qi);return jt.get(Dc).registerEditorContainer(hi.document.body),$Y.colorize(n,i,e,t)}function $yt(i,e,t=4){return jt.get(Dc).registerEditorContainer(hi.document.body),$Y.colorizeModelLine(i,e,t)}function Hyt(i){const e=gr.get(i);return e||{getInitialState:()=>Zw,tokenize:(t,n,r)=>FY(i,r)}}function Vyt(i,e){gr.getOrCreate(e);const t=Hyt(e),n=ng(i),r=[];let o=t.getInitialState();for(let s=0,a=n.length;s{var o;if(!n)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),await i.openCodeEditor(n,t.resource,a)?n:null})}function Xyt(){return{create:myt,getEditors:byt,getDiffEditors:Cyt,onDidCreateEditor:vyt,onDidCreateDiffEditor:_yt,createDiffEditor:yyt,addCommand:Syt,addEditorAction:xyt,addKeybindingRule:Lyt,addKeybindingRules:Cxe,createModel:Eyt,setModelLanguage:Dyt,setModelMarkers:Iyt,getModelMarkers:Tyt,removeAllMarkers:kyt,onDidChangeMarkers:Nyt,getModels:Myt,getModel:Ryt,onDidCreateModel:Pyt,onWillDisposeModel:Ayt,onDidChangeModelLanguage:Oyt,createWebWorker:Fyt,colorizeElement:Byt,colorize:Wyt,colorizeModelLine:$yt,tokenize:Vyt,defineTheme:zyt,setTheme:Uyt,remeasureFonts:jyt,registerCommand:Kyt,registerLinkOpener:Gyt,registerEditorOpener:qyt,AccessibilitySupport:lV,ContentWidgetPositionPreference:gV,CursorChangeReason:pV,DefaultEndOfLine:mV,EditorAutoIndentStrategy:_V,EditorOption:bV,EndOfLinePreference:CV,EndOfLineSequence:yV,MinimapPosition:NV,MouseTargetType:RV,OverlayWidgetPositionPreference:PV,OverviewRulerLane:AV,GlyphMarginLane:wV,RenderLineNumbersType:FV,RenderMinimap:BV,ScrollbarVisibility:$V,ScrollType:WV,TextEditorCursorBlinkingStyle:KV,TextEditorCursorStyle:GV,TrackedRangeStickiness:qV,WrappingIndent:XV,InjectedTextCursorStops:xV,PositionAffinity:OV,ShowLightbulbIconMode:VV,ConfigurationChangedEvent:VCe,BareFontInfo:fb,FontInfo:oz,TextModelResolvedOptions:HM,FindMatch:hI,ApplyUpdateResult:PE,EditorZoom:Kc,createMultiFileDiffEditor:wyt,EditorType:_T,EditorOptions:kh}}function Yyt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function T2(i,e){return typeof i=="boolean"?i:e}function tde(i,e){return typeof i=="string"?i:e}function Zyt(i){const e={};for(const t of i)e[t]=!0;return e}function nde(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=Zyt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function Ej(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Ui(i,"language definition does not contain attribute '"+s+"', used at: "+e):Ui(i,"attribute reference '"+s+"' must be a string, used at: "+e);return B1(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const r=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,r)}function Qyt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const r=t.split(".");if(r.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Ui(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Ui(i,"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&&!Flt(i,Wm(i,r,"",[],""))))throw Ui(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=r}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let r=0,o=t.length;r0&&n[0]==="^",this.name=this.name+": "+n,this.regex=Ej(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=Dj(e,this.name,t)}}function yxe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=T2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=T2(e.ignoreCase,!1),t.unicode=T2(e.unicode,!1),t.tokenPostfix=tde(e.tokenPostfix,"."+t.languageId),t.defaultToken=tde(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Ui(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Ui(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new ewt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Ui(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Ui(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=T2(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Ui(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Ui(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Ui(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Iv(t,a.open),close:Iv(t,a.close)});else throw Ui(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function twt(i){qw.registerLanguage(i)}function nwt(){let i=[];return i=i.concat(qw.getLanguages()),i}function iwt(i){return jt.get(qi).languageIdCodec.encodeLanguageId(i)}function rwt(i,e){return jt.withServices(()=>{const n=jt.get(qi).onDidRequestRichLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function owt(i,e){return jt.withServices(()=>{const n=jt.get(qi).onDidRequestBasicLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function swt(i,e){if(!jt.get(qi).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return jt.get(Ti).register(i,e,100)}class awt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return ak.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const r=this._actual.tokenizeEncoded(e,n);return new o3(r.tokens,r.endState)}}class ak{constructor(e,t,n,r){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let r=0;for(let o=0,s=e.length;o0&&o[s-1]===h)continue;let f=d.startIndex;c===0?f=0:f{const n=await Promise.resolve(e.create());return n?lwt(n)?Sxe(i,n):new bI(jt.get(qi),jt.get(Dc),i,yxe(i,n),jt.get(mn)):null});return gr.registerFactory(i,t)}function dwt(i,e){if(!jt.get(qi).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return wxe(e)?vQ(i,{create:()=>e}):gr.register(i,Sxe(i,e))}function hwt(i,e){const t=n=>new bI(jt.get(qi),jt.get(Dc),i,yxe(i,n),jt.get(mn));return wxe(e)?vQ(i,{create:()=>e}):gr.register(i,t(e))}function fwt(i,e){return jt.get(yt).referenceProvider.register(i,e)}function gwt(i,e){return jt.get(yt).renameProvider.register(i,e)}function pwt(i,e){return jt.get(yt).newSymbolNamesProvider.register(i,e)}function mwt(i,e){return jt.get(yt).signatureHelpProvider.register(i,e)}function vwt(i,e){return jt.get(yt).hoverProvider.register(i,{provideHover:(n,r,o)=>{const s=n.getWordAtPosition(r);return Promise.resolve(e.provideHover(n,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new W(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new W(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function _wt(i,e){return jt.get(yt).documentSymbolProvider.register(i,e)}function bwt(i,e){return jt.get(yt).documentHighlightProvider.register(i,e)}function Cwt(i,e){return jt.get(yt).linkedEditingRangeProvider.register(i,e)}function ywt(i,e){return jt.get(yt).definitionProvider.register(i,e)}function wwt(i,e){return jt.get(yt).implementationProvider.register(i,e)}function Swt(i,e){return jt.get(yt).typeDefinitionProvider.register(i,e)}function xwt(i,e){return jt.get(yt).codeLensProvider.register(i,e)}function Lwt(i,e,t){return jt.get(yt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=jt.get(sg).read({resource:r.uri}).filter(u=>W.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Ewt(i,e){return jt.get(yt).documentFormattingEditProvider.register(i,e)}function Dwt(i,e){return jt.get(yt).documentRangeFormattingEditProvider.register(i,e)}function Iwt(i,e){return jt.get(yt).onTypeFormattingEditProvider.register(i,e)}function kwt(i,e){return jt.get(yt).linkProvider.register(i,e)}function Twt(i,e){return jt.get(yt).completionProvider.register(i,e)}function Nwt(i,e){return jt.get(yt).colorProvider.register(i,e)}function Rwt(i,e){return jt.get(yt).foldingRangeProvider.register(i,e)}function Mwt(i,e){return jt.get(yt).declarationProvider.register(i,e)}function Pwt(i,e){return jt.get(yt).selectionRangeProvider.register(i,e)}function Awt(i,e){return jt.get(yt).documentSemanticTokensProvider.register(i,e)}function Owt(i,e){return jt.get(yt).documentRangeSemanticTokensProvider.register(i,e)}function Fwt(i,e){return jt.get(yt).inlineCompletionsProvider.register(i,e)}function Bwt(i,e){return jt.get(yt).inlineEditProvider.register(i,e)}function Wwt(i,e){return jt.get(yt).inlayHintsProvider.register(i,e)}function $wt(){return{register:twt,getLanguages:nwt,onLanguage:rwt,onLanguageEncountered:owt,getEncodedLanguageId:iwt,setLanguageConfiguration:swt,setColorMap:uwt,registerTokensProviderFactory:vQ,setTokensProvider:dwt,setMonarchTokensProvider:hwt,registerReferenceProvider:fwt,registerRenameProvider:gwt,registerNewSymbolNameProvider:pwt,registerCompletionItemProvider:Twt,registerSignatureHelpProvider:mwt,registerHoverProvider:vwt,registerDocumentSymbolProvider:_wt,registerDocumentHighlightProvider:bwt,registerLinkedEditingRangeProvider:Cwt,registerDefinitionProvider:ywt,registerImplementationProvider:wwt,registerTypeDefinitionProvider:Swt,registerCodeLensProvider:xwt,registerCodeActionProvider:Lwt,registerDocumentFormattingEditProvider:Ewt,registerDocumentRangeFormattingEditProvider:Dwt,registerOnTypeFormattingEditProvider:Iwt,registerLinkProvider:kwt,registerColorProvider:Nwt,registerFoldingRangeProvider:Rwt,registerDeclarationProvider:Mwt,registerSelectionRangeProvider:Pwt,registerDocumentSemanticTokensProvider:Awt,registerDocumentRangeSemanticTokensProvider:Owt,registerInlineCompletionsProvider:Fwt,registerInlineEditProvider:Bwt,registerInlayHintsProvider:Wwt,DocumentHighlightKind:vV,CompletionItemKind:dV,CompletionItemTag:hV,CompletionItemInsertTextRule:uV,SymbolKind:UV,SymbolTag:jV,IndentAction:SV,CompletionTriggerKind:fV,SignatureHelpTriggerKind:zV,InlayHintKind:LV,InlineCompletionTriggerKind:EV,InlineEditTriggerKind:DV,CodeActionTriggerType:cV,NewSymbolNameTag:MV,FoldingRangeKind:ya,SelectedSuggestionInfo:i1e}}const _Q=Sn("IEditorCancelService"),xxe=new ct("cancellableOperation",!1,w("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Tn(_Q,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(r=>{const o=xxe.bindTo(r.get(Gt)),s=new Ca;return{key:o,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Hwt extends xr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(_Q).add(e,this))}dispose(){this._unregister(),super.dispose()}}st(new class extends zo{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:xxe})}runEditorCommand(i,e){i.get(_Q).cancel(e)}});let Lxe=class Ij{constructor(e,t){if(this.flags=t,this.flags&1){const n=e.getModel();this.modelVersionId=n?Fb("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Ij))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 Ij(e,this.flags))}};class c_ extends Hwt{constructor(e,t,n,r){super(e,r),this._listener=new Fe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!n||!W.containsPosition(n,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!n||!W.containsRange(n,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class bQ extends xr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Qf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===_T.ICodeEditor:!1}function CQ(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===_T.IDiffEditor:!1}function Vwt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function Exe(i){return Qf(i)?i:CQ(i)?i.getModifiedEditor():Vwt(i)&&Qf(i.activeCodeEditor)?i.activeCodeEditor:null}class vS{static _handleEolEdits(e,t){let n;const r=[];for(const o of t)typeof o.eol=="number"&&(n=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),r=n.validateRange(t.range);return n.getFullModelRange().equalsRange(r)}static execute(e,t,n){n&&e.pushUndoStop();const r=wh.capture(e),o=vS._handleEolEdits(e,t);o.length===1&&vS._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Ji.replace(W.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Ji.replaceMove(W.lift(s.range),s.text))),n&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class ide{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class zwt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(ide.toKey(e))}has(e){return this._set.has(ide.toKey(e))}}function Dxe(i,e,t){const n=[],r=new zwt,o=i.ordered(t);for(const a of o)n.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}n.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return n}class Zb{static setFormatterSelector(e){return{dispose:Zb._selectors.unshift(e)}}static async select(e,t,n,r){if(e.length===0)return;const o=In.first(Zb._selectors);if(o)return await o(e,t,n,r)}}Zb._selectors=new Ca;async function Ixe(i,e,t,n,r,o,s){const a=i.get(Wt),{documentRangeFormattingEditProvider:l}=i.get(yt),c=Qf(e)?e.getModel():e,u=l.ordered(c),d=await Zb.select(u,c,n,2);d&&(r.report(d),await a.invokeFunction(Uwt,d,e,t,o,s))}async function Uwt(i,e,t,n,r,o){var s,a;const l=i.get(vd),c=i.get(Ra),u=i.get(B_);let d,h;Qf(t)?(d=t.getModel(),h=new c_(t,5,void 0,r)):(d=t,h=new bQ(t,r));const f=[];let g=0;for(const y of qX(n).sort(W.compareRangesUsingStarts))g>0&&W.areIntersectingOrTouching(f[g-1],y)?f[g-1]=W.fromPositions(f[g-1].getStartPosition(),y.getEndPosition()):g=f.push(y);const p=async y=>{var S,L;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)===null||S===void 0?void 0:S.value,y);const E=await e.provideDocumentRangeFormattingEdits(d,y,d.getFormattingOptions(),h.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)===null||L===void 0?void 0:L.value,E),E},m=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((E,D)=>W.plusRange(E,D.range),y[0].range);if(!S.some(E=>W.intersectRanges(L,E.range)))return!1;for(const E of y)for(const D of S)if(W.intersectRanges(E.range,D.range))return!0;return!1},v=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(s=e.extensionId)===null||s===void 0?void 0:s.value,f);const y=await e.provideDocumentRangesFormattingEdits(d,f,d.getFormattingOptions(),h.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,y),_.push(y)}else{for(const y of f){if(h.token.isCancellationRequested)return!0;_.push(await p(y))}for(let y=0;y({text:L.text,range:W.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:E}of L)if(W.areIntersectingOrTouching(E,S))return[new Et(E.startLineNumber,E.startColumn,E.endLineNumber,E.endColumn)];return null})}return u.playSignal(dn.format,{userGesture:o}),!0}async function jwt(i,e,t,n,r,o){const s=i.get(Wt),a=i.get(yt),l=Qf(e)?e.getModel():e,c=Dxe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=await Zb.select(c,l,t,1);u&&(n.report(u),await s.invokeFunction(Kwt,u,e,t,r,o))}async function Kwt(i,e,t,n,r,o){const s=i.get(vd),a=i.get(B_);let l,c;Qf(t)?(l=t.getModel(),c=new c_(t,5,void 0,r)):(l=t,c=new bQ(t,r));let u;try{const d=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(u=await s.computeMoreMinimalEdits(l.uri,d),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!u||u.length===0)return!1;if(Qf(t))vS.execute(t,u,n!==2),n!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:d}]=u,h=new Et(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);l.pushEditOperations([h],u.map(f=>({text:f.text,range:W.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(W.areIntersectingOrTouching(g,h))return[new Et(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(dn.format,{userGesture:o}),!0}async function Gwt(i,e,t,n,r,o){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,r,o)).catch(eo);if(Ms(l))return await i.computeMoreMinimalEdits(t.uri,l)}}async function qwt(i,e,t,n,r){const o=Dxe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=await Promise.resolve(s.provideDocumentFormattingEdits(t,n,r)).catch(eo);if(Ms(a))return await i.computeMoreMinimalEdits(t.uri,a)}}function kxe(i,e,t,n,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,r,o,s)).catch(eo).then(l=>i.computeMoreMinimalEdits(t.uri,l))}kn.registerCommand("_executeFormatRangeProvider",async function(i,...e){const[t,n,r]=e;Yn(Ft.isUri(t)),Yn(W.isIRange(n));const o=i.get(ul),s=i.get(vd),a=i.get(yt),l=await o.createModelReference(t);try{return Gwt(s,a,l.object.textEditorModel,W.lift(n),r,wn.None)}finally{l.dispose()}});kn.registerCommand("_executeFormatDocumentProvider",async function(i,...e){const[t,n]=e;Yn(Ft.isUri(t));const r=i.get(ul),o=i.get(vd),s=i.get(yt),a=await r.createModelReference(t);try{return qwt(o,s,a.object.textEditorModel,n,wn.None)}finally{a.dispose()}});kn.registerCommand("_executeFormatOnTypeProvider",async function(i,...e){const[t,n,r,o]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string");const s=i.get(ul),a=i.get(vd),l=i.get(yt),c=await s.createModelReference(t);try{return kxe(a,l,c.object.textEditorModel,le.lift(n),r,o,wn.None)}finally{c.dispose()}});kh.wrappingIndent.defaultValue=0;kh.glyphMargin.defaultValue=!1;kh.autoIndent.defaultValue=3;kh.overviewRulerLanes.defaultValue=2;Zb.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const Pa=r1e();Pa.editor=Xyt();Pa.languages=$wt();const Txe=Pa.CancellationTokenSource,yQ=Pa.Emitter,Nxe=Pa.KeyCode,Rxe=Pa.KeyMod,Mxe=Pa.Position,Pxe=Pa.Range,Axe=Pa.Selection,Oxe=Pa.SelectionDirection,Fxe=Pa.MarkerSeverity,Bxe=Pa.MarkerTag,Wxe=Pa.Uri,$xe=Pa.Token,Hxe=Pa.editor,VT=Pa.languages,A7=globalThis.MonacoEnvironment;(A7!=null&&A7.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Pa);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 w5=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Txe,Emitter:yQ,KeyCode:Nxe,KeyMod:Rxe,MarkerSeverity:Fxe,MarkerTag:Bxe,Position:Mxe,Range:Pxe,Selection:Axe,SelectionDirection:Oxe,Token:$xe,Uri:Wxe,editor:Hxe,languages:VT},Symbol.toStringTag,{value:"Module"})),Xwt="modulepreload",Ywt=function(i){return"/ir-virtual-machine/"+i},rde={},Rt=function(e,t,n){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Ywt(o),o in rde)return;rde[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!n)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Xwt,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Zwt=Object.defineProperty,Qwt=Object.getOwnPropertyDescriptor,Jwt=Object.getOwnPropertyNames,eSt=Object.prototype.hasOwnProperty,ode=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Jwt(e))!eSt.call(i,r)&&r!==t&&Zwt(i,r,{get:()=>e[r],enumerable:!(n=Qwt(e,r))||n.enumerable});return i},tSt=(i,e,t)=>(ode(i,e,"default"),t&&ode(t,e,"default")),rE={};tSt(rE,w5);var Vxe={},O7={},nSt=class zxe{static getOrCreate(e){return O7[e]||(O7[e]=new zxe(e)),O7[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Vxe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Pt(i){const e=i.id;Vxe[e]=i,rE.languages.register(i);const t=nSt.getOrCreate(e);rE.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),rE.languages.onLanguageEncountered(e,async()=>{const n=await t.load();rE.languages.setLanguageConfiguration(e,n.conf)})}Pt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Rt(()=>import("./abap-ad6e811d.js"),[])});Pt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Rt(()=>import("./apex-992ba105.js"),[])});Pt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Rt(()=>import("./azcli-2ae42e71.js"),[])});Pt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Rt(()=>import("./bat-638cac0f.js"),[])});Pt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Rt(()=>import("./bicep-389290ac.js"),[])});Pt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Rt(()=>import("./cameligo-e2b87a47.js"),[])});Pt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Rt(()=>import("./clojure-9f651a27.js"),[])});Pt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Rt(()=>import("./coffee-4e075114.js"),[])});Pt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Rt(()=>import("./cpp-8ffe77ae.js"),[])});Pt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Rt(()=>import("./cpp-8ffe77ae.js"),[])});Pt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Rt(()=>import("./csharp-0b267c6b.js"),[])});Pt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Rt(()=>import("./csp-c23415e1.js"),[])});Pt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Rt(()=>import("./css-c62f5578.js"),[])});Pt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Rt(()=>import("./cypher-16871f29.js"),[])});Pt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Rt(()=>import("./dart-20618e99.js"),[])});Pt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Rt(()=>import("./dockerfile-13942c6d.js"),[])});Pt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Rt(()=>import("./ecl-82a13cc7.js"),[])});Pt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Rt(()=>import("./elixir-941d33da.js"),[])});Pt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Rt(()=>import("./flow9-82e25a0d.js"),[])});Pt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Rt(()=>import("./fsharp-930eb6d7.js"),[])});Pt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Pt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagAngleInterpolationDollar)});Pt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagBracketInterpolationDollar)});Pt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagAngleInterpolationBracket)});Pt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagBracketInterpolationBracket)});Pt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Pt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-16cf0c28.js"),[]).then(i=>i.TagAutoInterpolationBracket)});Pt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Rt(()=>import("./go-ace823b2.js"),[])});Pt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Rt(()=>import("./graphql-9395e6dd.js"),[])});Pt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Rt(()=>import("./handlebars-8e9b88a4.js"),[])});Pt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Rt(()=>import("./hcl-4160620f.js"),[])});Pt({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:()=>Rt(()=>import("./html-d0e282cb.js"),[])});Pt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Rt(()=>import("./ini-1cc2fa96.js"),[])});Pt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Rt(()=>import("./java-fe979474.js"),[])});Pt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Rt(()=>import("./javascript-399e9239.js"),["assets/javascript-399e9239.js","assets/typescript-e9193306.js"])});Pt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Rt(()=>import("./julia-1a2d9387.js"),[])});Pt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Rt(()=>import("./kotlin-45b3a4f3.js"),[])});Pt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Rt(()=>import("./less-a184ed1c.js"),[])});Pt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Rt(()=>import("./lexon-ebf376fd.js"),[])});Pt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Rt(()=>import("./lua-666d20d5.js"),[])});Pt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Rt(()=>import("./liquid-a87f169a.js"),[])});Pt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Rt(()=>import("./m3-bbbbbca9.js"),[])});Pt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Rt(()=>import("./markdown-5de2301d.js"),[])});Pt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Rt(()=>import("./mdx-31bb8f6b.js"),[])});Pt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Rt(()=>import("./mips-7b46d093.js"),[])});Pt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Rt(()=>import("./msdax-295c0d3c.js"),[])});Pt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Rt(()=>import("./mysql-28fc43b5.js"),[])});Pt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Rt(()=>import("./objective-c-5f7f7623.js"),[])});Pt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Rt(()=>import("./pascal-830d8a16.js"),[])});Pt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Rt(()=>import("./pascaligo-ff6a611d.js"),[])});Pt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Rt(()=>import("./perl-0c4cf450.js"),[])});Pt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Rt(()=>import("./pgsql-85eb1e14.js"),[])});Pt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Rt(()=>import("./php-571f6521.js"),[])});Pt({id:"pla",extensions:[".pla"],loader:()=>Rt(()=>import("./pla-5e6cd4d5.js"),[])});Pt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Rt(()=>import("./postiats-4d02d044.js"),[])});Pt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Rt(()=>import("./powerquery-c6baddff.js"),[])});Pt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Rt(()=>import("./powershell-8bfccb2f.js"),[])});Pt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Rt(()=>import("./protobuf-7c245adb.js"),[])});Pt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Rt(()=>import("./pug-e0d77a81.js"),[])});Pt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Rt(()=>import("./python-a17e322c.js"),[])});Pt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Rt(()=>import("./qsharp-560af9ec.js"),[])});Pt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Rt(()=>import("./r-96b98db0.js"),[])});Pt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Rt(()=>import("./razor-3c2726ff.js"),[])});Pt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Rt(()=>import("./redis-2313a258.js"),[])});Pt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Rt(()=>import("./redshift-e81279f9.js"),[])});Pt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Rt(()=>import("./restructuredtext-23e36e2c.js"),[])});Pt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Rt(()=>import("./ruby-6e5b4752.js"),[])});Pt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Rt(()=>import("./rust-c4e1d9a9.js"),[])});Pt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Rt(()=>import("./sb-095651a8.js"),[])});Pt({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:()=>Rt(()=>import("./scala-dfd2c035.js"),[])});Pt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Rt(()=>import("./scheme-4bd59040.js"),[])});Pt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Rt(()=>import("./scss-0b769ec8.js"),[])});Pt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Rt(()=>import("./shell-5fa60225.js"),[])});Pt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Rt(()=>import("./solidity-3efd84d4.js"),[])});Pt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Rt(()=>import("./sophia-156a057a.js"),[])});Pt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Rt(()=>import("./sparql-25a61c8a.js"),[])});Pt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Rt(()=>import("./sql-ef431720.js"),[])});Pt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Rt(()=>import("./st-06071006.js"),[])});Pt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Rt(()=>import("./swift-941c2e3c.js"),[])});Pt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Rt(()=>import("./systemverilog-dc0c3813.js"),[])});Pt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Rt(()=>import("./systemverilog-dc0c3813.js"),[])});Pt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Rt(()=>import("./tcl-cc963d5c.js"),[])});Pt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Rt(()=>import("./twig-cdf47909.js"),[])});Pt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Rt(()=>import("./typescript-e9193306.js"),[])});Pt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Rt(()=>import("./vb-3ff3c116.js"),[])});Pt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Rt(()=>import("./wgsl-7be617f0.js"),[])});Pt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Rt(()=>import("./xml-91f8402c.js"),[])});Pt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Rt(()=>import("./yaml-36087f86.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Zwt=Object.defineProperty,Qwt=Object.getOwnPropertyDescriptor,Jwt=Object.getOwnPropertyNames,eSt=Object.prototype.hasOwnProperty,ode=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Jwt(e))!eSt.call(i,r)&&r!==t&&Zwt(i,r,{get:()=>e[r],enumerable:!(n=Qwt(e,r))||n.enumerable});return i},tSt=(i,e,t)=>(ode(i,e,"default"),t&&ode(t,e,"default")),rE={};tSt(rE,w5);var Vxe={},O7={},nSt=class zxe{static getOrCreate(e){return O7[e]||(O7[e]=new zxe(e)),O7[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Vxe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Pt(i){const e=i.id;Vxe[e]=i,rE.languages.register(i);const t=nSt.getOrCreate(e);rE.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),rE.languages.onLanguageEncountered(e,async()=>{const n=await t.load();rE.languages.setLanguageConfiguration(e,n.conf)})}Pt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Rt(()=>import("./abap-ad6e811d.js"),[])});Pt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Rt(()=>import("./apex-992ba105.js"),[])});Pt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Rt(()=>import("./azcli-2ae42e71.js"),[])});Pt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Rt(()=>import("./bat-638cac0f.js"),[])});Pt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Rt(()=>import("./bicep-389290ac.js"),[])});Pt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Rt(()=>import("./cameligo-e2b87a47.js"),[])});Pt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Rt(()=>import("./clojure-9f651a27.js"),[])});Pt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Rt(()=>import("./coffee-4e075114.js"),[])});Pt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Rt(()=>import("./cpp-8ffe77ae.js"),[])});Pt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Rt(()=>import("./cpp-8ffe77ae.js"),[])});Pt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Rt(()=>import("./csharp-0b267c6b.js"),[])});Pt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Rt(()=>import("./csp-c23415e1.js"),[])});Pt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Rt(()=>import("./css-c62f5578.js"),[])});Pt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Rt(()=>import("./cypher-16871f29.js"),[])});Pt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Rt(()=>import("./dart-20618e99.js"),[])});Pt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Rt(()=>import("./dockerfile-13942c6d.js"),[])});Pt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Rt(()=>import("./ecl-82a13cc7.js"),[])});Pt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Rt(()=>import("./elixir-941d33da.js"),[])});Pt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Rt(()=>import("./flow9-82e25a0d.js"),[])});Pt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Rt(()=>import("./fsharp-930eb6d7.js"),[])});Pt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Pt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagAngleInterpolationDollar)});Pt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagBracketInterpolationDollar)});Pt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagAngleInterpolationBracket)});Pt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagBracketInterpolationBracket)});Pt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Pt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Rt(()=>import("./freemarker2-d4fc4a18.js"),[]).then(i=>i.TagAutoInterpolationBracket)});Pt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Rt(()=>import("./go-ace823b2.js"),[])});Pt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Rt(()=>import("./graphql-9395e6dd.js"),[])});Pt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Rt(()=>import("./handlebars-84ede268.js"),[])});Pt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Rt(()=>import("./hcl-4160620f.js"),[])});Pt({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:()=>Rt(()=>import("./html-c86539dd.js"),[])});Pt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Rt(()=>import("./ini-1cc2fa96.js"),[])});Pt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Rt(()=>import("./java-fe979474.js"),[])});Pt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Rt(()=>import("./javascript-f8924fc5.js"),["assets/javascript-f8924fc5.js","assets/typescript-b38ad017.js"])});Pt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Rt(()=>import("./julia-1a2d9387.js"),[])});Pt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Rt(()=>import("./kotlin-45b3a4f3.js"),[])});Pt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Rt(()=>import("./less-a184ed1c.js"),[])});Pt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Rt(()=>import("./lexon-ebf376fd.js"),[])});Pt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Rt(()=>import("./lua-666d20d5.js"),[])});Pt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Rt(()=>import("./liquid-6545a9f9.js"),[])});Pt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Rt(()=>import("./m3-bbbbbca9.js"),[])});Pt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Rt(()=>import("./markdown-5de2301d.js"),[])});Pt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Rt(()=>import("./mdx-41f16e00.js"),[])});Pt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Rt(()=>import("./mips-7b46d093.js"),[])});Pt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Rt(()=>import("./msdax-295c0d3c.js"),[])});Pt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Rt(()=>import("./mysql-28fc43b5.js"),[])});Pt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Rt(()=>import("./objective-c-5f7f7623.js"),[])});Pt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Rt(()=>import("./pascal-830d8a16.js"),[])});Pt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Rt(()=>import("./pascaligo-ff6a611d.js"),[])});Pt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Rt(()=>import("./perl-0c4cf450.js"),[])});Pt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Rt(()=>import("./pgsql-85eb1e14.js"),[])});Pt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Rt(()=>import("./php-571f6521.js"),[])});Pt({id:"pla",extensions:[".pla"],loader:()=>Rt(()=>import("./pla-5e6cd4d5.js"),[])});Pt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Rt(()=>import("./postiats-4d02d044.js"),[])});Pt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Rt(()=>import("./powerquery-c6baddff.js"),[])});Pt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Rt(()=>import("./powershell-8bfccb2f.js"),[])});Pt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Rt(()=>import("./protobuf-7c245adb.js"),[])});Pt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Rt(()=>import("./pug-e0d77a81.js"),[])});Pt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Rt(()=>import("./python-a4947be7.js"),[])});Pt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Rt(()=>import("./qsharp-560af9ec.js"),[])});Pt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Rt(()=>import("./r-96b98db0.js"),[])});Pt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Rt(()=>import("./razor-939b62e5.js"),[])});Pt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Rt(()=>import("./redis-2313a258.js"),[])});Pt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Rt(()=>import("./redshift-e81279f9.js"),[])});Pt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Rt(()=>import("./restructuredtext-23e36e2c.js"),[])});Pt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Rt(()=>import("./ruby-6e5b4752.js"),[])});Pt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Rt(()=>import("./rust-c4e1d9a9.js"),[])});Pt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Rt(()=>import("./sb-095651a8.js"),[])});Pt({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:()=>Rt(()=>import("./scala-dfd2c035.js"),[])});Pt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Rt(()=>import("./scheme-4bd59040.js"),[])});Pt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Rt(()=>import("./scss-0b769ec8.js"),[])});Pt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Rt(()=>import("./shell-5fa60225.js"),[])});Pt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Rt(()=>import("./solidity-3efd84d4.js"),[])});Pt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Rt(()=>import("./sophia-156a057a.js"),[])});Pt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Rt(()=>import("./sparql-25a61c8a.js"),[])});Pt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Rt(()=>import("./sql-ef431720.js"),[])});Pt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Rt(()=>import("./st-06071006.js"),[])});Pt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Rt(()=>import("./swift-941c2e3c.js"),[])});Pt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Rt(()=>import("./systemverilog-dc0c3813.js"),[])});Pt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Rt(()=>import("./systemverilog-dc0c3813.js"),[])});Pt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Rt(()=>import("./tcl-cc963d5c.js"),[])});Pt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Rt(()=>import("./twig-cdf47909.js"),[])});Pt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Rt(()=>import("./typescript-b38ad017.js"),[])});Pt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Rt(()=>import("./vb-3ff3c116.js"),[])});Pt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Rt(()=>import("./wgsl-7be617f0.js"),[])});Pt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Rt(()=>import("./xml-1046e63e.js"),[])});Pt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Rt(()=>import("./yaml-01b0ca08.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var iSt=Object.defineProperty,rSt=Object.getOwnPropertyDescriptor,oSt=Object.getOwnPropertyNames,sSt=Object.prototype.hasOwnProperty,sde=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oSt(e))!sSt.call(i,r)&&r!==t&&iSt(i,r,{get:()=>e[r],enumerable:!(n=rSt(e,r))||n.enumerable});return i},aSt=(i,e,t)=>(sde(i,e,"default"),t&&sde(t,e,"default")),nx={};aSt(nx,w5);var wQ=class{constructor(e,t,n){this._onDidChange=new nx.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}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)}},SQ={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}},xQ={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},Uxe=new wQ("css",SQ,xQ),jxe=new wQ("scss",SQ,xQ),Kxe=new wQ("less",SQ,xQ);nx.languages.css={cssDefaults:Uxe,lessDefaults:Kxe,scssDefaults:jxe};function LQ(){return Rt(()=>import("./cssMode-016766a9.js"),[])}nx.languages.onLanguage("less",()=>{LQ().then(i=>i.setupMode(Kxe))});nx.languages.onLanguage("scss",()=>{LQ().then(i=>i.setupMode(jxe))});nx.languages.onLanguage("css",()=>{LQ().then(i=>i.setupMode(Uxe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var iSt=Object.defineProperty,rSt=Object.getOwnPropertyDescriptor,oSt=Object.getOwnPropertyNames,sSt=Object.prototype.hasOwnProperty,sde=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oSt(e))!sSt.call(i,r)&&r!==t&&iSt(i,r,{get:()=>e[r],enumerable:!(n=rSt(e,r))||n.enumerable});return i},aSt=(i,e,t)=>(sde(i,e,"default"),t&&sde(t,e,"default")),nx={};aSt(nx,w5);var wQ=class{constructor(e,t,n){this._onDidChange=new nx.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}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)}},SQ={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}},xQ={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},Uxe=new wQ("css",SQ,xQ),jxe=new wQ("scss",SQ,xQ),Kxe=new wQ("less",SQ,xQ);nx.languages.css={cssDefaults:Uxe,lessDefaults:Kxe,scssDefaults:jxe};function LQ(){return Rt(()=>import("./cssMode-a70b8ffe.js"),[])}nx.languages.onLanguage("less",()=>{LQ().then(i=>i.setupMode(Kxe))});nx.languages.onLanguage("scss",()=>{LQ().then(i=>i.setupMode(jxe))});nx.languages.onLanguage("css",()=>{LQ().then(i=>i.setupMode(Uxe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var lSt=Object.defineProperty,cSt=Object.getOwnPropertyDescriptor,uSt=Object.getOwnPropertyNames,dSt=Object.prototype.hasOwnProperty,ade=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of uSt(e))!dSt.call(i,r)&&r!==t&&lSt(i,r,{get:()=>e[r],enumerable:!(n=cSt(e,r))||n.enumerable});return i},hSt=(i,e,t)=>(ade(i,e,"default"),t&&ade(t,e,"default")),S5={};hSt(S5,w5);var fSt=class{constructor(e,t,n){this._onDidChange=new S5.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}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)}},gSt={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"},x5={format:gSt,suggest:{},data:{useDefaultDataProvider:!0}};function L5(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===iD,documentFormattingEdits:i===iD,documentRangeFormattingEdits:i===iD}}var iD="html",lde="handlebars",cde="razor",Gxe=E5(iD,x5,L5(iD)),pSt=Gxe.defaults,qxe=E5(lde,x5,L5(lde)),mSt=qxe.defaults,Xxe=E5(cde,x5,L5(cde)),vSt=Xxe.defaults;S5.languages.html={htmlDefaults:pSt,razorDefaults:vSt,handlebarDefaults:mSt,htmlLanguageService:Gxe,handlebarLanguageService:qxe,razorLanguageService:Xxe,registerHTMLLanguageService:E5};function _St(){return Rt(()=>import("./htmlMode-486a6d1f.js"),[])}function E5(i,e=x5,t=L5(i)){const n=new fSt(i,e,t);let r;const o=S5.languages.onLanguage(i,async()=>{r=(await _St()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var bSt=class{constructor(e,t,n){this._onDidChange=new yQ,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},CSt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ySt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Yxe=new bSt("json",CSt,ySt),wSt=()=>Zxe().then(i=>i.getWorker());VT.json={jsonDefaults:Yxe,getWorker:wSt};function Zxe(){return Rt(()=>import("./jsonMode-2b57b708.js"),[])}VT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});VT.onLanguage("json",()=>{Zxe().then(i=>i.setupMode(Yxe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var lSt=Object.defineProperty,cSt=Object.getOwnPropertyDescriptor,uSt=Object.getOwnPropertyNames,dSt=Object.prototype.hasOwnProperty,ade=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of uSt(e))!dSt.call(i,r)&&r!==t&&lSt(i,r,{get:()=>e[r],enumerable:!(n=cSt(e,r))||n.enumerable});return i},hSt=(i,e,t)=>(ade(i,e,"default"),t&&ade(t,e,"default")),S5={};hSt(S5,w5);var fSt=class{constructor(e,t,n){this._onDidChange=new S5.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}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)}},gSt={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"},x5={format:gSt,suggest:{},data:{useDefaultDataProvider:!0}};function L5(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===iD,documentFormattingEdits:i===iD,documentRangeFormattingEdits:i===iD}}var iD="html",lde="handlebars",cde="razor",Gxe=E5(iD,x5,L5(iD)),pSt=Gxe.defaults,qxe=E5(lde,x5,L5(lde)),mSt=qxe.defaults,Xxe=E5(cde,x5,L5(cde)),vSt=Xxe.defaults;S5.languages.html={htmlDefaults:pSt,razorDefaults:vSt,handlebarDefaults:mSt,htmlLanguageService:Gxe,handlebarLanguageService:qxe,razorLanguageService:Xxe,registerHTMLLanguageService:E5};function _St(){return Rt(()=>import("./htmlMode-f0b3914e.js"),[])}function E5(i,e=x5,t=L5(i)){const n=new fSt(i,e,t);let r;const o=S5.languages.onLanguage(i,async()=>{r=(await _St()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var bSt=class{constructor(e,t,n){this._onDidChange=new yQ,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},CSt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ySt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Yxe=new bSt("json",CSt,ySt),wSt=()=>Zxe().then(i=>i.getWorker());VT.json={jsonDefaults:Yxe,getWorker:wSt};function Zxe(){return Rt(()=>import("./jsonMode-d2a2b345.js"),[])}VT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});VT.onLanguage("json",()=>{Zxe().then(i=>i.setupMode(Yxe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var SSt=Object.defineProperty,xSt=Object.getOwnPropertyDescriptor,LSt=Object.getOwnPropertyNames,ESt=Object.prototype.hasOwnProperty,ude=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of LSt(e))!ESt.call(i,r)&&r!==t&&SSt(i,r,{get:()=>e[r],enumerable:!(n=xSt(e,r))||n.enumerable});return i},DSt=(i,e,t)=>(ude(i,e,"default"),t&&ude(t,e,"default")),ISt="5.0.2",_S={};DSt(_S,w5);var Qxe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Qxe||{}),Jxe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(Jxe||{}),eLe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(eLe||{}),tLe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(tLe||{}),nLe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(nLe||{}),iLe=class{constructor(i,e,t,n,r){this._onDidChange=new _S.Emitter,this._onDidExtraLibsChange=new _S.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),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(i,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===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,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(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},kSt=ISt,rLe={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},oLe=new iLe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},rLe),sLe=new iLe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},rLe),TSt=()=>D5().then(i=>i.getTypeScriptWorker()),NSt=()=>D5().then(i=>i.getJavaScriptWorker());_S.languages.typescript={ModuleKind:Qxe,JsxEmit:Jxe,NewLineKind:eLe,ScriptTarget:tLe,ModuleResolutionKind:nLe,typescriptVersion:kSt,typescriptDefaults:oLe,javascriptDefaults:sLe,getTypeScriptWorker:TSt,getJavaScriptWorker:NSt};function D5(){return Rt(()=>import("./tsMode-dc546b1f.js"),[])}_S.languages.onLanguage("typescript",()=>D5().then(i=>i.setupTypeScript(oLe)));_S.languages.onLanguage("javascript",()=>D5().then(i=>i.setupJavaScript(sLe)));class RSt extends dl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Hn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:tt.map,toggled:Re.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Re.has("isInDiffEditor"),menu:{when:Re.has("isInDiffEditor"),id:H.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}ki(RSt);class aLe extends dl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Hn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Re.has("isInDiffEditor")})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}ki(aLe);class lLe extends dl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Hn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Re.has("isInDiffEditor")})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}ki(lLe);ns.appendMenuItem(H.EditorTitle,{command:{id:new lLe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Re.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Re.has("isInDiffEditor")},order:11,group:"1_diff",when:Re.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Re.has("isInDiffEditor"))});ns.appendMenuItem(H.EditorTitle,{command:{id:new aLe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:tt.move,toggled:US.create("config.diffEditor.experimental.showMoves",!0),precondition:Re.has("isInDiffEditor")},order:10,group:"1_diff",when:Re.has("isInDiffEditor")});const I5=Hn("diffEditor","Diff Editor");class MSt extends Nh{constructor(){super({id:"diffEditor.switchSide",title:Hn("switchSide","Switch Side"),icon:tt.arrowSwap,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,n){const r=rx(e);if(r instanceof a_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}ki(MSt);class PSt extends Nh{constructor(){super({id:"diffEditor.exitCompareMove",title:Hn("exitCompareMove","Exit Compare Move"),icon:tt.close,precondition:K.comparingMovedCode,f1:!1,category:I5,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof a_&&r.exitCompareMove()}}ki(PSt);class ASt extends Nh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Hn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:tt.fold,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof a_&&r.collapseAllUnchangedRegions()}}ki(ASt);class OSt extends Nh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Hn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:tt.unfold,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof a_&&r.showAllUnchangedRegions()}}ki(OSt);const cLe=Hn("accessibleDiffViewer","Accessible Diff Viewer");class ix extends dl{constructor(){super({id:ix.id,title:Hn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:cLe,precondition:Re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=rx(e);t==null||t.accessibleDiffViewerNext()}}ix.id="editor.action.accessibleDiffViewer.next";ns.appendMenuItem(H.EditorTitle,{command:{id:ix.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Re.has("isInDiffEditor")},order:10,group:"2_diff",when:Re.and(K.accessibleDiffViewerVisible.negate(),Re.has("isInDiffEditor"))});class zT extends dl{constructor(){super({id:zT.id,title:Hn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:cLe,precondition:Re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=rx(e);t==null||t.accessibleDiffViewerPrev()}}zT.id="editor.action.accessibleDiffViewer.prev";function rx(i){const t=i.get(jn).listDiffEditors(),n=ps();if(n)for(const r of t){const o=r.getContainerDomNode();if(FSt(o,n))return r}return null}function FSt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}kn.registerCommandAlias("editor.action.diffReview.next",ix.id);ki(ix);kn.registerCommandAlias("editor.action.diffReview.prev",zT.id);ki(zT);var BSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kj;const k5=new ct("selectionAnchorSet",!1);let $p=kj=class{static get(e){return e.getContribution(kj.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k5.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(Et.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ns().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Pl(w("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(Et.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()}};$p.ID="editor.contrib.selectionAnchorController";$p=kj=BSt([WSt(1,Gt)],$p);class $St extends pt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2080),weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.setSelectionAnchor()}}class HSt extends pt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k5})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class VSt extends pt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k5,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2089),weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class zSt extends pt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k5,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}Kn($p.ID,$p,4);Ke($St);Ke(HSt);Ke(VSt);Ke(zSt);const USt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class jSt extends pt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=nd.get(t))===null||n===void 0||n.jumpToBracket()}}class KSt extends pt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Hn("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,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=nd.get(t))===null||r===void 0||r.selectToBracket(o)}}class GSt extends pt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=nd.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class qSt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class nd extends me{static get(e){return e.getContribution(nd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new mi(()=>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(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new Et(s.lineNumber,s.column,s.lineNumber,s.column):new Et(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(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(W.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new Et(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.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(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(le.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Ke(QSt);const T5=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function JSt(i,e,t){const n={id:T5(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class dLe{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 In.some(this,([n,r])=>r.asFile())&&t.push("files"),fLe(rF(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return rF(e)}}function rF(i){return i.toLowerCase()}function hLe(i,e){return fLe(rF(i),e.map(rF))}function fLe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N5=Object.freeze({create:i=>Ap(i.map(e=>e.toString())).join(`\r + *-----------------------------------------------------------------------------*/var SSt=Object.defineProperty,xSt=Object.getOwnPropertyDescriptor,LSt=Object.getOwnPropertyNames,ESt=Object.prototype.hasOwnProperty,ude=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of LSt(e))!ESt.call(i,r)&&r!==t&&SSt(i,r,{get:()=>e[r],enumerable:!(n=xSt(e,r))||n.enumerable});return i},DSt=(i,e,t)=>(ude(i,e,"default"),t&&ude(t,e,"default")),ISt="5.0.2",_S={};DSt(_S,w5);var Qxe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Qxe||{}),Jxe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(Jxe||{}),eLe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(eLe||{}),tLe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(tLe||{}),nLe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(nLe||{}),iLe=class{constructor(i,e,t,n,r){this._onDidChange=new _S.Emitter,this._onDidExtraLibsChange=new _S.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),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(i,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===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,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(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},kSt=ISt,rLe={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},oLe=new iLe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},rLe),sLe=new iLe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},rLe),TSt=()=>D5().then(i=>i.getTypeScriptWorker()),NSt=()=>D5().then(i=>i.getJavaScriptWorker());_S.languages.typescript={ModuleKind:Qxe,JsxEmit:Jxe,NewLineKind:eLe,ScriptTarget:tLe,ModuleResolutionKind:nLe,typescriptVersion:kSt,typescriptDefaults:oLe,javascriptDefaults:sLe,getTypeScriptWorker:TSt,getJavaScriptWorker:NSt};function D5(){return Rt(()=>import("./tsMode-f8221b75.js"),[])}_S.languages.onLanguage("typescript",()=>D5().then(i=>i.setupTypeScript(oLe)));_S.languages.onLanguage("javascript",()=>D5().then(i=>i.setupJavaScript(sLe)));class RSt extends dl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Hn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:tt.map,toggled:Re.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Re.has("isInDiffEditor"),menu:{when:Re.has("isInDiffEditor"),id:H.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}ki(RSt);class aLe extends dl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Hn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Re.has("isInDiffEditor")})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}ki(aLe);class lLe extends dl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Hn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Re.has("isInDiffEditor")})}run(e,...t){const n=e.get(mn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}ki(lLe);ns.appendMenuItem(H.EditorTitle,{command:{id:new lLe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Re.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Re.has("isInDiffEditor")},order:11,group:"1_diff",when:Re.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Re.has("isInDiffEditor"))});ns.appendMenuItem(H.EditorTitle,{command:{id:new aLe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:tt.move,toggled:US.create("config.diffEditor.experimental.showMoves",!0),precondition:Re.has("isInDiffEditor")},order:10,group:"1_diff",when:Re.has("isInDiffEditor")});const I5=Hn("diffEditor","Diff Editor");class MSt extends Nh{constructor(){super({id:"diffEditor.switchSide",title:Hn("switchSide","Switch Side"),icon:tt.arrowSwap,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,n){const r=rx(e);if(r instanceof l_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}ki(MSt);class PSt extends Nh{constructor(){super({id:"diffEditor.exitCompareMove",title:Hn("exitCompareMove","Exit Compare Move"),icon:tt.close,precondition:K.comparingMovedCode,f1:!1,category:I5,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof l_&&r.exitCompareMove()}}ki(PSt);class ASt extends Nh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Hn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:tt.fold,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof l_&&r.collapseAllUnchangedRegions()}}ki(ASt);class OSt extends Nh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Hn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:tt.unfold,precondition:Re.has("isInDiffEditor"),f1:!0,category:I5})}runEditorCommand(e,t,...n){const r=rx(e);r instanceof l_&&r.showAllUnchangedRegions()}}ki(OSt);const cLe=Hn("accessibleDiffViewer","Accessible Diff Viewer");class ix extends dl{constructor(){super({id:ix.id,title:Hn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:cLe,precondition:Re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=rx(e);t==null||t.accessibleDiffViewerNext()}}ix.id="editor.action.accessibleDiffViewer.next";ns.appendMenuItem(H.EditorTitle,{command:{id:ix.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Re.has("isInDiffEditor")},order:10,group:"2_diff",when:Re.and(K.accessibleDiffViewerVisible.negate(),Re.has("isInDiffEditor"))});class zT extends dl{constructor(){super({id:zT.id,title:Hn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:cLe,precondition:Re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=rx(e);t==null||t.accessibleDiffViewerPrev()}}zT.id="editor.action.accessibleDiffViewer.prev";function rx(i){const t=i.get(jn).listDiffEditors(),n=ps();if(n)for(const r of t){const o=r.getContainerDomNode();if(FSt(o,n))return r}return null}function FSt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}kn.registerCommandAlias("editor.action.diffReview.next",ix.id);ki(ix);kn.registerCommandAlias("editor.action.diffReview.prev",zT.id);ki(zT);var BSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kj;const k5=new ct("selectionAnchorSet",!1);let $p=kj=class{static get(e){return e.getContribution(kj.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k5.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(Et.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ns().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Pl(w("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(Et.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()}};$p.ID="editor.contrib.selectionAnchorController";$p=kj=BSt([WSt(1,Gt)],$p);class $St extends pt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2080),weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.setSelectionAnchor()}}class HSt extends pt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k5})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class VSt extends pt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k5,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2089),weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class zSt extends pt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k5,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=$p.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}Kn($p.ID,$p,4);Ke($St);Ke(HSt);Ke(VSt);Ke(zSt);const USt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class jSt extends pt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=nd.get(t))===null||n===void 0||n.jumpToBracket()}}class KSt extends pt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Hn("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,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=nd.get(t))===null||r===void 0||r.selectToBracket(o)}}class GSt extends pt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=nd.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class qSt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class nd extends me{static get(e){return e.getContribution(nd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new mi(()=>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(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new Et(s.lineNumber,s.column,s.lineNumber,s.column):new Et(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(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(W.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new Et(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.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(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(le.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Ke(QSt);const T5=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function JSt(i,e,t){const n={id:T5(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class dLe{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 In.some(this,([n,r])=>r.asFile())&&t.push("files"),fLe(rF(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return rF(e)}}function rF(i){return i.toLowerCase()}function hLe(i,e){return fLe(rF(i),e.map(rF))}function fLe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N5=Object.freeze({create:i=>Ap(i.map(e=>e.toString())).join(`\r `),split:i=>i.split(`\r -`),parse:i=>N5.split(i).filter(e=>!e.startsWith("#"))}),dde={EDITORS:"CodeEditors",FILES:"CodeFiles"};class ext{}const txt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ur.add(txt.DragAndDropContribution,new ext);class lk{constructor(){}static getInstance(){return lk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}lk.INSTANCE=new lk;function gLe(i){const e=new dLe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(n,EQ(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(n,nxt(r))}}return e}function nxt(i){const e=i.path?Ft.parse(i.path):void 0;return JSt(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const ixt=Object.freeze([dde.EDITORS,dde.FILES,zI.RESOURCES,zI.INTERNAL_URI_LIST]);function pLe(i,e=!1){const t=gLe(i),n=t.get(zI.INTERNAL_URI_LIST);if(n)t.replace(wr.uriList,n);else if(e||!t.has(wr.uriList)){const r=[];for(const o of i.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(Ft.file(a).toString()):r.push(Ft.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(wr.uriList,EQ(N5.create(r)))}for(const r of ixt)t.delete(r);return t}class Bu{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,n=this.value.charCodeAt(e),r;if(r=Bu._table[n],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Bu.isDigitCharacter(n)){r=8;do t+=1,n=this.value.charCodeAt(e+t);while(Bu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}if(Bu.isVariableCharacter(n)){r=9;do n=this.value.charCodeAt(e+ ++t);while(Bu.isVariableCharacter(n)||Bu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof Bu._table[n]>"u"&&!Bu.isDigitCharacter(n)&&!Bu.isVariableCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}}Bu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class ox{constructor(){this._children=[]}appendChild(e){return e instanceof va&&this._children[this._children.length-1]instanceof va?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,r=n.children.indexOf(e),o=n.children.slice(0);o.splice(r,1,...t),n._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 UT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class va extends ox{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new va(this.value)}}class mLe extends ox{}class jc extends mLe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.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 sx?this._children[0]:void 0}clone(){const e=new jc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class sx extends ox{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof va&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new sx;return this.options.forEach(e.appendChild,e),e}}class DQ extends ox{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(o=>o instanceof Fd&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const n of this._children)if(n instanceof Fd){let r=e[n.index]||"";r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return""}clone(){const e=new DQ;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 Fd extends ox{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,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(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,r)=>r===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Fd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ck extends mLe{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 va(t)],!0):!1}clone(){const e=new ck(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function hde(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class UT extends ox{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof jc&&(e.push(n),t=!t||t.indexr===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return hde([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof jc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ck&&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 UT;return this._children=this.children.map(t=>t.clone()),e}walk(e){hde(this.children,e)}}class Zb{constructor(){this._scanner=new Bu,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){const r=new UT;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof jc&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new jc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof jc&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new jc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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 n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new va(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new jc(Number(t)):new ck(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const o=new jc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new va("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new sx;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];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;n.push(r)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new va(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const o=new ck(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new va("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseTransform(e){const t=new DQ;let n="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,n+=o;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new va(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const r=this._accept(8,!0);if(r)if(n){if(this._accept(4))return e.appendChild(new Fd(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Fd(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Fd(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Fd(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new va(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function vLe(i,e,t){var n,r,o,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(r=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]}:{edits:[...e.map(a=>new Nv(i,{range:a,text:typeof t.insertText=="string"?Zb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(s=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]}}function _Le(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var rxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const sxt=an.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:h1e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class R5 extends me{constructor(e,t,n,r,o){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Xe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Xe("span.icon");this.domNode.append(t),t.classList.add(...Vt.asClassNameArray(tt.loading),"codicon-modifier-spin");const n=()=>{const r=this.editor.getOption(67);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};n(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(67))&&n()})),this._register(xe(this.domNode,Je.CLICK,r=>{this.delegate.cancel()}))}getId(){return R5.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)}}R5.baseId="editor.widget.inlineProgressWidget";let oF=class extends me{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Vo),this._currentWidget=new Vo,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,n){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Zv(()=>{const o=W.fromPositions(e);this._currentDecorations.set([{range:o,options:sxt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(R5,this.id,this._editor,o,t,n))},this._showDelay);try{return await n}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};oF=rxt([oxt(2,Wt)],oF);var bLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rD=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Tj;let sF=Tj=class extends me{constructor(e,t,n,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Ot(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ot(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(ot.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=Xe(".post-edit-widget"),this.button=this._register(new GO(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(xe(this.domNode,Je.CLICK,()=>this.showSelector()))}getId(){return Tj.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Hr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Yy({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};sF.baseId="editor.widget.postEditWidget";sF=Tj=bLe([rD(7,$l),rD(8,Gt),rD(9,ci)],sF);let aF=class extends me{constructor(e,t,n,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Vo),this._register(ot.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const s=t.allEdits[t.activeEditIndex];if(!s)return;const a=vLe(o.uri,e,s),l=e[0],c=o.deltaDecorations([],[{range:l,options:{description:"paste-line-suffix",stickiness:0}}]);let u,d;try{u=await this._bulkEditService.apply(a,{editor:this._editor,token:r}),d=o.getDecorationRange(c[0])}finally{o.deltaDecorations(c,[])}n&&u.isApplied&&t.allEdits.length>1&&this.show(d??l,t,async h=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:h,allEdits:t.allEdits},n,r))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(sF,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};aF=bLe([rD(4,Wt),rD(5,NT)],aF);var axt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lP;let Da=lP=class{static get(e){return e.getContribution(lP.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Vo,this._messageListeners=new Fe,this._mouseOverMessage=!1,this._editor=e,this._visible=lP.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Pl(Bf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Bf(e)?X3(e,{actionHandler:{callback:r=>{this.closeMessage(),AZ(this._openerService,r,Bf(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new gde(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ot.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ts(ps(),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(xe(this._messageWidget.value.getDomNode(),Je.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(xe(this._messageWidget.value.getDomNode(),Je.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(n?n.containsPosition(r.target.position)||this.closeMessage():n=new W(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(gde.fadeOut(this._messageWidget.value))}};Da.ID="editor.contrib.messageController";Da.MESSAGE_VISIBLE=new ct("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));Da=lP=axt([fde(1,Gt),fde(2,hl)],Da);const lxt=zo.bindToContribution(Da.get);st(new lxt({id:"leaveEditorMessage",precondition:Da.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let gde=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Kn(Da.ID,Da,4);var cxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},S1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Nj;const CLe="editor.changePasteType",yLe=new ct("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),F7="application/vnd.code.copyMetadata";let Hp=Nj=class extends me{static get(e){return e.getContribution(Nj.ID)}constructor(e,t,n,r,o,s,a){super(),this._bulkEditService=n,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(xe(l,"copy",c=>this.handleCopy(c))),this._register(xe(l,"cut",c=>this.handleCopy(c))),this._register(xe(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new oF("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(aF,"pasteIntoEditor",e,yLe,{id:CLe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},zS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(I_&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new W(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,Os),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=gLe(e.clipboardData),g=h.flatMap(v=>{var _;return(_=v.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=T5();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const m=No(async v=>{const _=hh(await Promise.all(h.map(async y=>{try{return await y.prepareDocumentPaste(r,a,f,v)}catch(S){console.error(S);return}})));_.reverse();for(const y of _)for(const[S,L]of y)f.replace(S,L);return f});(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:m}}async handlePaste(e){var t,n,r,o,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=Da.get(this._editor))===null||t===void 0||t.closeMessage(),(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const a=this._editor.getModel(),l=this._editor.getSelections();if(!(l!=null&&l.length)||!a||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const c=this.fetchCopyMetadata(e),u=pLe(e.clipboardData);u.delete(F7);const d=[...e.clipboardData.types,...(r=c==null?void 0:c.providerCopyMimeTypes)!==null&&r!==void 0?r:[],wr.uriList],h=this._languageFeaturesService.documentPasteEditProvider.ordered(a).filter(f=>{var g,p;return!((g=this._pasteAsActionContext)===null||g===void 0)&&g.preferredId&&this._pasteAsActionContext.preferredId!==f.id?!1:(p=f.pasteMimeTypes)===null||p===void 0?void 0:p.some(m=>hLe(m,d))});if(!h.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferredId&&this.showPasteAsNoEditMessage(l,(s=this._pasteAsActionContext)===null||s===void 0?void 0:s.preferredId);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,h,l,u,c,{trigger:"explicit",only:this._pasteAsActionContext.preferredId}):this.doPasteInline(h,l,u,c,{trigger:"implicit"})}showPasteAsNoEditMessage(e,t){var n;(n=Da.get(this._editor))===null||n===void 0||n.showMessage(w("pasteAsError","No paste edits for '{0}' found",t),e[0].getStartPosition())}doPasteInline(e,t,n,r,o){const s=No(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new l_(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,r,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>pde(f,n));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}const h=await this.getPasteEdits(d,n,c,t,o,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}if(h.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},f,u.token)}await this.applyDefaultPasteHandler(n,r,u.token)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,o,s){const a=No(async l=>{const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new l_(c,3,void 0,l);try{if(await this.mergeInDataFromCopy(r,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(m=>pde(m,r));e&&(h=h.filter(m=>m.id===e));const f=await this.getPasteEdits(h,r,u,n,s,d.token);if(d.token.isCancellationRequested)return;if(!f.length){s.only&&this.showPasteAsNoEditMessage(n,s.only);return}let g;if(e)g=f.at(0);else{const m=await this._quickInputService.pick(f.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});g=m==null?void 0:m.edit}if(!g)return;const p=vLe(u.uri,n,g);await this._bulkEditService.apply(p,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,t){e.setData(F7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(F7);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=Tz.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n){var r;if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=await this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(wr.uriList)){const o=await this._clipboardService.readResources();if(n.isCancellationRequested)return;o.length&&e.append(wr.uriList,EQ(N5.create(o)))}}async getPasteEdits(e,t,n,r,o,s){const a=await gT(Promise.all(e.map(async c=>{var u;try{const d=await((u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,n,r,t,o,s));if(d)return{...d,providerId:c.id}}catch(d){console.error(d)}})),s),l=hh(a??[]);return _Le(l)}async applyDefaultPasteHandler(e,t,n){var r,o,s;const a=(r=e.get(wr.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=await a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)}};Hp.ID="editor.contrib.copyPasteActionController";Hp=Nj=cxt([S1(1,Wt),S1(2,NT),S1(3,Zp),S1(4,yt),S1(5,Ph),S1(6,lSe)],Hp);function pde(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}const Qb="9_cutcopypaste",uxt=nh||document.queryCommandSupported("cut"),wLe=nh||document.queryCommandSupported("copy"),dxt=typeof navigator.clipboard>"u"||lu?document.queryCommandSupported("paste"):!0;function IQ(i){return i.register(),i}const hxt=uxt?IQ(new jS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:nh?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:H.EditorContext,group:Qb,title:w("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:H.SimpleEditorContext,group:Qb,title:w("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1}]})):void 0,fxt=wLe?IQ(new jS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:nh?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:H.EditorContext,group:Qb,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:H.SimpleEditorContext,group:Qb,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ns.appendMenuItem(H.MenubarEditMenu,{submenu:H.MenubarCopy,title:Hn("copy as","Copy As"),group:"2_ccp",order:3});ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextCopy,title:Hn("copy as","Copy As"),group:Qb,order:3});ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextShare,title:Hn("share","Share"),group:"11_share",order:-1,when:Re.and(Re.notEquals("resourceScheme","output"),K.editorTextFocus)});ns.appendMenuItem(H.EditorTitleContext,{submenu:H.EditorTitleContextShare,title:Hn("share","Share"),group:"11_share",order:-1});ns.appendMenuItem(H.ExplorerContext,{submenu:H.ExplorerContextShare,title:Hn("share","Share"),group:"11_share",order:-1});const B7=dxt?IQ(new jS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:nh?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:H.EditorContext,group:Qb,title:w("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:H.SimpleEditorContext,group:Qb,title:w("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4}]})):void 0;class gxt extends pt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(Iz.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Iz.forceCopyWithSyntaxHighlighting=!1)}}function SLe(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const r=t.get(jn).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(zS().execCommand(e),!0)))}SLe(hxt,"cut");SLe(fxt,"copy");B7&&(B7.addImplementation(1e4,"code-editor",(i,e)=>{var t,n;const r=i.get(jn),o=i.get(Zp),s=r.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?(n=(t=Hp.get(s))===null||t===void 0?void 0:t.finishedPaste())!==null&&n!==void 0?n:Promise.resolve():I_?(async()=>{const l=await o.readText();if(l!==""){const c=EI.INSTANCE.get(l);let u=!1,d=null,h=null;c&&(u=s.getOption(37)&&!!c.isFromEmptySelection,d=typeof c.multicursorText<"u"?c.multicursorText:null,h=c.mode),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:u,multicursorText:d,mode:h})}})():!0:!1}),B7.addImplementation(0,"generic-dom",(i,e)=>(zS().execCommand("paste"),!0)));wLe&&Ke(gxt);class qt{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+qt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new qt(this.value+qt.sep+e)}}qt.sep=".";qt.None=new qt("@@none@@");qt.Empty=new qt("");qt.QuickFix=new qt("quickfix");qt.Refactor=new qt("refactor");qt.RefactorExtract=qt.Refactor.append("extract");qt.RefactorInline=qt.Refactor.append("inline");qt.RefactorMove=qt.Refactor.append("move");qt.RefactorRewrite=qt.Refactor.append("rewrite");qt.Notebook=new qt("notebook");qt.Source=new qt("source");qt.SourceOrganizeImports=qt.Source.append("organizeImports");qt.SourceFixAll=qt.Source.append("fixAll");qt.SurroundWith=qt.Refactor.append("surround");var Al;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(Al||(Al={}));function pxt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>xLe(e,t,i.include))||!i.includeSourceActions&&qt.Source.contains(e))}function mxt(i,e){const t=e.kind?new qt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>xLe(t,n,i.include))||!i.includeSourceActions&&t&&qt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function xLe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class yf{static fromUser(e,t){return!e||typeof e!="object"?new yf(t.kind,t.apply,!1):new yf(yf.getKindFromUser(e,t.kind),yf.getApplyFromUser(e,t.apply),yf.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 qt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class vxt{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(r){eo(r)}n&&(this.action.edit=n.edit)}return this}}const LLe="editor.action.codeAction",kQ="editor.action.quickFix",ELe="editor.action.autoFix",DLe="editor.action.refactor",ILe="editor.action.sourceAction",TQ="editor.action.organizeImports",NQ="editor.action.fixAll";class oD extends me{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:Ms(e.diagnostics)?Ms(t.diagnostics)?oD.codeActionsPreferredComparator(e,t):-1:Ms(t.diagnostics)?1:oD.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(oD.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&qt.QuickFix.contains(new qt(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 mde={actions:[],documentation:void 0};async function sD(i,e,t,n,r,o){var s;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],qt.Notebook]},c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new bQ(e,o),d=n.type===2,h=_xt(i,e,d?l:a),f=new Fe,g=h.map(async m=>{try{r.report(m);const v=await m.provideCodeActions(e,t,c,u.token);if(v&&f.add(v),u.token.isCancellationRequested)return mde;const _=((v==null?void 0:v.actions)||[]).filter(S=>S&&mxt(a,S)),y=Cxt(m,_,a.include);return{actions:_.map(S=>new vxt(S,m)),documentation:y}}catch(v){if(Th(v))throw v;return eo(v),mde}}),p=i.onDidChange(()=>{const m=i.all(e);lr(m,h)||u.cancel()});try{const m=await Promise.all(g),v=m.map(y=>y.actions).flat(),_=[...hh(m.map(y=>y.documentation)),...bxt(i,e,n,v)];return new oD(v,_,f)}finally{p.dispose(),u.dispose()}}function _xt(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(r=>pxt(t,new qt(r))):!0)}function*bxt(i,e,t,n){var r,o,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Cxt(i,e,t){if(!i.documentation)return;const n=i.documentation.map(r=>({kind:new qt(r.kind),command:r.command}));if(t){let r;for(const o of n)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of n)if(o.kind.contains(new qt(r.kind)))return o.command}}var vw;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions",i.FromAILightbulb="fromAILightbulb"})(vw||(vw={}));async function yxt(i,e,t,n,r=wn.None){var o;const s=i.get(NT),a=i.get(cr),l=i.get(ia),c=i.get(zr);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==vw.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=wxt(u);c.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function wxt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}kn.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,r){if(!(e instanceof Ft))throw iu();const{codeActionProvider:o}=i.get(yt),s=i.get(rr).getModel(e);if(!s)throw iu();const a=Et.isISelection(t)?Et.liftSelection(t):W.isIRange(t)?s.validateRange(t):void 0;if(!a)throw iu();const l=typeof n=="string"?new qt(n):void 0,c=await sD(o,s,a,{type:1,triggerAction:Al.Default,filter:{includeSourceActions:!0,include:l}},yp.None,wn.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}});var Sxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rj;let lF=Rj=class{constructor(e){this.keybindingService=e}getResolver(){const e=new tg(()=>this.keybindingService.getKeybindings().filter(t=>Rj.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===TQ?n={kind:qt.SourceOrganizeImports.value}:t.command===NQ&&(n={kind:qt.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...yf.fromUser(n,{kind:qt.None,apply:"never"})}}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new qt(e.kind);return t.filter(r=>r.kind.contains(n)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};lF.codeActionCommands=[DLe,LLe,ILe,TQ,NQ];lF=Rj=Sxt([xxt(0,ci)],lF);X("symbolIcon.arrayForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.booleanForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.colorForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constantForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fileForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.folderForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keyForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keywordForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.moduleForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.namespaceForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.nullForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.numberForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.objectForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.operatorForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.packageForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.propertyForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.referenceForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.snippetForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.stringForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.structForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.textForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.typeParameterForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.unitForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const kLe=Object.freeze({kind:qt.Empty,title:w("codeAction.widget.id.more","More Actions...")}),Lxt=Object.freeze([{kind:qt.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix")},{kind:qt.RefactorExtract,title:w("codeAction.widget.id.extract","Extract"),icon:tt.wrench},{kind:qt.RefactorInline,title:w("codeAction.widget.id.inline","Inline"),icon:tt.wrench},{kind:qt.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite"),icon:tt.wrench},{kind:qt.RefactorMove,title:w("codeAction.widget.id.move","Move"),icon:tt.wrench},{kind:qt.SurroundWith,title:w("codeAction.widget.id.surround","Surround With"),icon:tt.surroundWith},{kind:qt.Source,title:w("codeAction.widget.id.source","Source Action"),icon:tt.symbolFile},kLe]);function Ext(i,e,t){if(!e)return i.map(o=>{var s;return{kind:"action",item:o,group:kLe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const n=Lxt.map(o=>({group:o,actions:[]}));for(const o of i){const s=o.action.kind?new qt(o.action.kind):qt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of n)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions){const a=o.group;r.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:tt.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return r}var Dxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mj,ky;(function(i){i.Hidden={type:0};class e{constructor(n,r,o,s){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}i.Showing=e})(ky||(ky={}));let Jb=Mj=class extends me{constructor(e,t,n){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new ae),this.onClick=this._onClick.event,this._state=ky.Hidden,this._iconClasses=[],this._domNode=Xe("div.lightBulbWidget"),this._register(Li.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(bot(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=Hr(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(ot.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o,s,a;this._preferredKbLabel=(o=(r=this._keybindingService.lookupKeybinding(ELe))===null||r===void 0?void 0:r.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(s=this._keybindingService.lookupKeybinding(kQ))===null||s===void 0?void 0:s.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(n),l=o.getOptions().tabSize,c=this._editor.getOptions().get(50),u=o.getLineContent(s),d=$3(u,l),h=c.spaceWidth*d>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s,p=1;if(!h){if(s>1&&!f(s-1))g-=1;else if(s=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pj=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const NLe="acceptSelectedCodeAction",RLe="previewSelectedCodeAction";class Ixt{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,n){var r,o;n.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Aj=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 n=document.createElement("span");n.className="title",e.append(n);const r=new ex(e,Ll);return{container:e,icon:t,text:n,keybinding:r}}renderElement(e,t,n){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(n.icon.className=Vt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ft(e.group.icon.color.id))):(n.icon.className=Vt.asClassName(tt.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=MLe(e.label),n.keybinding.set(e.keybinding),Pot(!!e.keybinding,n.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(NLe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(RLe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};Aj=TLe([Pj(1,ci)],Aj);class kxt extends UIEvent{constructor(){super("acceptSelectedAction")}}class _de extends UIEvent{constructor(){super("previewSelectedAction")}}function Txt(i){if(i.kind==="action")return i.label}let Oj=class extends me{constructor(e,t,n,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new xr),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 Ec(e,this.domNode,a,[new Aj(t,this._keybindingService),new Ixt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Txt},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?MLe(l==null?void 0:l.label):"";return l.disabled&&(c=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(O_),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=n,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 o=e;if(this._allMenuItems.length>=50)o=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 h=d.getBoundingClientRect().width;return d.style.width="",h}return 0});o=Math.max(...l,e)}const s=.7,a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*s);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}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 n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;const o=e?new _de:new kxt;this._list.setSelection([n],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof _de):this._list.setSelection([])}onFocus(){var e,t;const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.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 n=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};Oj=TLe([Pj(4,og),Pj(5,ci)],Oj);function MLe(i){return i.replace(/\r\n|\r|\n/g," ")}var Nxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};X("actionBar.toggledBackground",{dark:G0,light:G0,hcDark:G0,hcLight:G0},w("actionBar.toggledBackground","Background color for toggled action items in action bar."));const eC={Visible:new ct("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},kC=Sn("actionWidgetService");let tC=class extends me{get isVisible(){return eC.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Vo)}show(e,t,n,r,o,s,a){const l=eC.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Oj,e,t,n,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Fe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(xe(l,Je.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(xe(u,Je.POINTER_MOVE,()=>u.remove())),s.add(xe(u,Je.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(ph(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=Xe(e),r=new du(n);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};tC=Nxt([W7(0,og),W7(1,Gt),W7(2,Wt)],tC);Tn(kC,tC,1);const jT=100+1e3;ki(class extends dl{constructor(){super({id:"hideCodeActionWidget",title:Hn("hideCodeActionWidget.title","Hide action widget"),precondition:eC.Visible,keybinding:{weight:jT,primary:9,secondary:[1033]}})}run(i){i.get(kC).hide()}});ki(class extends dl{constructor(){super({id:"selectPrevCodeAction",title:Hn("selectPrevCodeAction.title","Select previous action"),precondition:eC.Visible,keybinding:{weight:jT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(kC);e instanceof tC&&e.focusPrevious()}});ki(class extends dl{constructor(){super({id:"selectNextCodeAction",title:Hn("selectNextCodeAction.title","Select next action"),precondition:eC.Visible,keybinding:{weight:jT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(kC);e instanceof tC&&e.focusNext()}});ki(class extends dl{constructor(){super({id:NLe,title:Hn("acceptSelected.title","Accept selected action"),precondition:eC.Visible,keybinding:{weight:jT,primary:3,secondary:[2137]}})}run(i){const e=i.get(kC);e instanceof tC&&e.acceptSelected()}});ki(class extends dl{constructor(){super({id:RLe,title:Hn("previewSelected.title","Preview selected action"),precondition:eC.Visible,keybinding:{weight:jT,primary:2051}})}run(i){const e=i.get(kC);e instanceof tC&&e.acceptSelected(!0)}});const PLe=new ct("supportedCodeAction",""),bde="_typescript.applyFixAllCodeAction";class Rxt extends me{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new gd),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(n=>sZ(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Al.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const n=this._editor.getOption(65).enabled;if(n!==$u.Off){{if(n===$u.On)return t;if(n===$u.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),l=o.getLineContent(s);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(s)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var A0;(function(i){i.Empty={type:0};class e{constructor(n,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(Th(s))return ALe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(A0||(A0={}));const ALe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Mxt extends me{constructor(e,t,n,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Vo),this._state=A0.Empty,this._onDidChangeState=this._register(new ae),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=PLe.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(a=>{a.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(A0.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(A0.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(n=>{var r;return(r=n.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Rxt(this._editor,this._markerService,n=>{var r;if(!n){this.setState(A0.Empty);return}const o=n.selection.getStartPosition(),s=No(async a=>{var l,c,u,d,h,f,g,p,m,v;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Al.QuickFix||!((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(qt.QuickFix))){const _=await sD(this._registry,e,n.selection,n.trigger,yp.None,a),y=[..._.allActions];if(a.isCancellationRequested)return ALe;const S=(u=_.validActions)===null||u===void 0?void 0:u.some(E=>E.action.kind?qt.QuickFix.contains(new qt(E.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(S){for(const E of _.validActions)!((h=(d=E.action.command)===null||d===void 0?void 0:d.arguments)===null||h===void 0)&&h.some(D=>typeof D=="string"&&D.includes(bde))&&(E.action.diagnostics=[...L.filter(D=>D.relatedInformation)]);return{validActions:_.validActions,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}else if(!S&&L.length>0){const E=n.selection.getPosition();let D=E,k=Number.MAX_VALUE;const T=[..._.validActions];for(const P of L){const N=P.endColumn,R=P.endLineNumber,O=P.startLineNumber;if(R===E.lineNumber||O===E.lineNumber){D=new le(R,N);const B={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((f=n.trigger.filter)===null||f===void 0)&&f.include?(g=n.trigger.filter)===null||g===void 0?void 0:g.include:qt.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((p=n.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:D}},$=new Et(D.lineNumber,D.column,D.lineNumber,D.column),G=await sD(this._registry,e,$,B,yp.None,a);if(G.validActions.length!==0){for(const U of G.validActions)!((v=(m=U.action.command)===null||m===void 0?void 0:m.arguments)===null||v===void 0)&&v.some(j=>typeof j=="string"&&j.includes(bde))&&(U.action.diagnostics=[...L.filter(j=>j.relatedInformation)]);_.allActions.length===0&&y.push(...G.allActions),Math.abs(E.column-N)R.findIndex(O=>O.action.title===P.action.title)===N);return M.sort((P,N)=>P.action.isPreferred&&!N.action.isPreferred?-1:!P.action.isPreferred&&N.action.isPreferred||P.action.isAI&&!N.action.isAI?1:!P.action.isAI&&N.action.isAI?-1:0),{validActions:M,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}}return sD(this._registry,e,n.selection,n.trigger,yp.None,a)});n.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new A0.Triggered(n.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Al.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Pxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},H1;const Axt="quickfix-edit-highlight";let c_=H1=class extends me{static get(e){return e.getContribution(H1.ID)}constructor(e,t,n,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Vo),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Mxt(this._editor,o.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new tg(()=>{const d=this._editor.getContribution(Jb.ID);return d&&this._register(d.onClick(h=>this.showCodeActionsFromLightbulb(h.actions,h))),d}),this._resolver=r.createInstance(lF),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 n=e.validActions[0],r=n.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(n,!1,!1,vw.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){var o;if(!this._editor.hasModel())return;(o=Da.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,n,r){try{await this._instantiationService.invokeFunction(yxt,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Al.QuickFix,filter:{}})}}async update(e){var t,n,r,o,s,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=await e.actions}catch(u){nn(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(d,!1,!1,vw.FromCodeActions)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=Da.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=Da.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.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,n){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=le.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,vw.FromCodeActions),this._actionWidgetService.hide(),r.clear()},onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:async(c,u)=>{var d;if(!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const h=c.action.ranges,f=c.action.diagnostics;if(r.clear(),h&&h.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:H1.DECORATION})):h.map(p=>({range:p,options:H1.DECORATION}));r.set(g)}else if(f&&f.length>0){const g=f.map(m=>({range:m,options:H1.DECORATION}));r.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const m=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||d===void 0?void 0:d.word;jf(w("editingNewSelection","Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Ext(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=Hr(this._editor.getDomNode()),r=n.left+t.left,o=n.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};c_.ID="editor.contrib.codeActionController";c_.DECORATION=an.register({description:"quickfix-highlight",className:Axt});c_=H1=Pxt([xg(1,sg),xg(2,Gt),xg(3,Wt),xg(4,yt),xg(5,P_),xg(6,cr),xg(7,mn),xg(8,kC),xg(9,Wt)],c_);vu((i,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(sp));const n=i.getColor(tv);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${sh(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function KT(i){return Re.regex(PLe.keys()[0],new RegExp("(\\s|^)"+vc(i.value)+"\\b"))}const RQ={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function TC(i,e,t,n,r=Al.Default){if(i.hasModel()){const o=c_.get(i);o==null||o.manualTriggerAtCurrentPosition(e,r,t,n)}}class Oxt extends pt{constructor(){super({id:kQ,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),kbOpts:{kbExpr:K.textInputFocus,primary:2137,weight:100}})}run(e,t){return TC(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Al.QuickFix)}}class Fxt extends zo{constructor(){super({id:LLe,precondition:Re.and(K.writable,K.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:RQ}]}})}runEditorCommand(e,t,n){const r=yf.fromUser(n,{kind:qt.Empty,apply:"ifSingle"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class Bxt extends pt{constructor(){super({id:DLe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),kbOpts:{kbExpr:K.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Re.and(K.writable,KT(qt.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:RQ}]}})}run(e,t,n){const r=yf.fromUser(n,{kind:qt.Refactor,apply:"never"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:qt.Refactor.contains(r.kind)?r.kind:qt.None,onlyIncludePreferredActions:r.preferred},r.apply,Al.Refactor)}}class Wxt extends pt{constructor(){super({id:ILe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Re.and(K.writable,KT(qt.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:RQ}]}})}run(e,t,n){const r=yf.fromUser(n,{kind:qt.Source,apply:"never"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:qt.Source.contains(r.kind)?r.kind:qt.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Al.SourceAction)}}class $xt extends pt{constructor(){super({id:TQ,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Re.and(K.writable,KT(qt.SourceOrganizeImports)),kbOpts:{kbExpr:K.textInputFocus,primary:1581,weight:100}})}run(e,t){return TC(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:qt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Al.OrganizeImports)}}class Hxt extends pt{constructor(){super({id:NQ,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:Re.and(K.writable,KT(qt.SourceFixAll))})}run(e,t){return TC(t,w("fixAll.noneMessage","No fix all action available"),{include:qt.SourceFixAll,includeSourceActions:!0},"ifSingle",Al.FixAll)}}class Vxt extends pt{constructor(){super({id:ELe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Re.and(K.writable,KT(qt.QuickFix)),kbOpts:{kbExpr:K.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return TC(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:qt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Al.AutoFix)}}Kn(c_.ID,c_,3);Kn(Jb.ID,Jb,4);Ke(Oxt);Ke(Bxt);Ke(Wxt);Ke($xt);Ke(Vxt);Ke(Hxt);st(new Fxt);ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:w("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class Fj{constructor(){this.lenses=[],this._disposables=new Fe}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function OLe(i,e,t){const n=i.ordered(e),r=new Map,o=new Fj,s=n.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){eo(c)}});return await Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o}kn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Yn(Ft.isUri(t)),Yn(typeof n=="number"||!n);const{codeLensProvider:r}=i.get(yt),o=i.get(rr).getModel(t);if(!o)throw iu();const s=[],a=new Fe;return OLe(r,o,wn.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||u.symbol.command?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,wn.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Uxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const FLe=Sn("ICodeLensCache");class Cde{constructor(e,t){this.lineCount=e,this.data=t}}let Bj=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new N_(20,.75);const t="codelens/cache";HL(hi,()=>e.remove(t,1));const n="codelens/cache2",r=e.get(n,1,"{}");this._deserialize(r),ot.once(e.onWillSaveState)(o=>{o.reason===UI.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new Fj;r.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new Cde(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,n]of this._cache){const r=new Set;for(const o of n.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const r=t[n],o=[];for(const a of r.lines)o.push({range:new W(a,1,a,11)});const s=new Fj;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(n,new Cde(r.lineCount,s))}}catch{}}};Bj=zxt([Uxt(0,md)],Bj);Tn(FLe,Bj,1);class jxt{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class uk{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${uk._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let r=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:yde},d=>this._decorationIds[u]=d),a?a=W.plusRange(a,c.symbol.range):a=W.lift(c.symbol.range)}),this._viewZone=new jxt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new uk(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 n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&W.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,r)=>{t.addDecoration({range:n.symbol.range,options:yde},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let bS=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new Fe,this._localToDispose=new Fe,this._lenses=[],this._oldCodeLensModels=new Fe,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new mi(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(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(),n=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),n&&(o.setProperty("--vscode-editorCodeLens-fontFamily",n),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",il.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.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&&Zv(()=>{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 o=r.onDidChange(()=>n.schedule());this._localToDispose.add(o)}const n=new mi(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=No(s=>OLe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},nn)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Ot(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new $7;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.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(Ot(()=>{if(this._editor.getModel()){const r=wh.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new $7;for(const r of this._lenses)r.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];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],n.push(r)))}if(!n.length&&!this._lenses.length)return;const o=wh.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new $7;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),r.push(a))}),n.length===0)return;const o=Date.now(),s=No(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},eo):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{nn(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};bS.ID="css.editor.codeLens";bS=Kxt([CL(1,yt),CL(2,_u),CL(3,cr),CL(4,zr),CL(5,FLe)],bS);Kn(bS.ID,bS,1);Ke(class extends pt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:K.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const n=e.get(Ph),r=e.get(cr),o=e.get(zr),s=t.getSelection().positionLineNumber,a=t.getContribution(bS.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=await n.pick(c,{canPickMany:!1,placeHolder:w("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=await a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}}});var Gxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},H7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class MQ{constructor(e,t){this._editorWorkerClient=new OY(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const r=t.range,o=t.color,s=o.alpha,a=new Ce(new Rn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?Ce.Format.CSS.formatRGB(a):Ce.Format.CSS.formatRGBA(a),c=s?Ce.Format.CSS.formatHSL(a):Ce.Format.CSS.formatHSLA(a),u=s?Ce.Format.CSS.formatHex(a):Ce.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Wj=class extends me{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new MQ(e,t)))}};Wj=Gxt([H7(0,rr),H7(1,Ti),H7(2,yt)],Wj);BT(Wj);async function BLe(i,e,t,n=!0){return PQ(new qxt,i,e,t,n)}function WLe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class qxt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)}}class Xxt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}}class Yxt{constructor(e){this.colorInfo=e}async compute(e,t,n,r){const o=await e.provideColorPresentations(t,this.colorInfo,wn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)}}async function PQ(i,e,t,n,r){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof MQ)s=u;else try{await i.compute(u,t,n,a)&&(o=!0)}catch(d){eo(d)}}return o?a:s&&r?(await i.compute(s,t,n,a),a):[]}function $Le(i,e){const{colorProvider:t}=i.get(yt),n=i.get(rr).getModel(e);if(!n)throw iu();const r=i.get(mn).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}kn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Ft))throw iu();const{model:n,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=$Le(i,t);return PQ(new Xxt,r,n,wn.None,o)});kn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:r,range:o}=n;if(!(r instanceof Ft)||!Array.isArray(t)||t.length!==4||!W.isIRange(o))throw iu();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=$Le(i,r),[c,u,d,h]=t;return PQ(new Yxt({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,wn.None,l)});var Zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},V7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$j;const HLe=Object.create({});let u_=$j=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Fe),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new yT(this._editor),this._decoratorLimitReporter=new Qxt,this._colorDecorationClassRefs=this._register(new Fe),this._debounceInformation=r.for(n.colorProvider,"Document Colors",{min:$j.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(146);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const r=n.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 gd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=No(async e=>{const t=this._editor.getModel();if(!t)return[];const n=new Fs(!1),r=await BLe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){nn(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:an.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(r.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};u_.ID="editor.contrib.colorDetector";u_.RECOMPUTE_TIME=1e3;u_=$j=Zxt([V7(1,mn),V7(2,yt),V7(3,_u)],u_);class Qxt{constructor(){this._onDidChange=new ae,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Kn(u_.ID,u_,1);class Jxt{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,n){this.presentationIndex=n,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new ae,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new ae,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 n=-1;for(let r=0;r{this.backgroundColor=s.getColor(eO)||Ce.white})),this._register(xe(this._pickedColorNode,Je.CLICK,()=>this.model.selectNextColorPresentation())),this._register(xe(this._originalColorNode,Je.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=Ce.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 tLt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Ce.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 tLt extends me{constructor(e){super(),this._onClicked=this._register(new ae),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Oe(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Oe(this._button,t),Oe(t,cc(".button"+Vt.asCSSSelector(Or("color-picker-close",tt.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(xe(this._button,Je.CLICK,()=>{this._onClicked.fire()}))}}class nLt extends me{constructor(e,t,n,r=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=cc(".colorpicker-body"),Oe(e,this._domNode),this._saturationBox=new iLt(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 rLt(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 oLt(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 sLt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new Ce(new Sf(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Ce(new Sf(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new Ce(new Sf(n===360?0:n,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 iLt extends me{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,this._domNode=cc(".saturation-wrap"),Oe(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Oe(this._domNode,this._canvas),this.selection=cc(".saturation-selection"),Oe(this._domNode,this.selection),this.layout(),this._register(xe(this._domNode,Je.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 qS);const t=Hr(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 n=xe(e.target.ownerDocument,Je.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,r),this._onDidChange.fire({s:n,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 Ce(new Sf(e.h,1,1,1)),n=this._canvas.getContext("2d"),r=n.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=Ce.Format.CSS.format(t),n.fill(),n.fillStyle=r,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class VLe extends me{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Oe(e,cc(".standalone-strip")),this.overlay=Oe(this.domNode,cc(".standalone-overlay"))):(this.domNode=Oe(e,cc(".strip")),this.overlay=Oe(this.domNode,cc(".overlay"))),this.slider=Oe(this.domNode,cc(".slider")),this.slider.style.top="0px",this._register(xe(this.domNode,Je.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 qS),n=Hr(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-n.top),()=>null);const r=xe(e.target.ownerDocument,Je.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 rLt extends VLe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:r}=e.rgba,o=new Ce(new Rn(t,n,r,1)),s=new Ce(new Rn(t,n,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class oLt extends VLe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class sLt extends me{constructor(e){super(),this._onClicked=this._register(new ae),this.onClicked=this._onClicked.event,this._button=Oe(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(xe(this._button,Je.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class aLt extends Lc{constructor(e,t,n,r,o=!1){super(),this.model=t,this.pixelRatio=n,this._register(cI.getInstance(Bt(e)).onDidChange(()=>this.layout()));const s=cc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new eLt(s,this.model,r,o)),this.body=this._register(new nLt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var zLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ULe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class lLt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,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 cF=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Xr.fromPromise(this._computeAsync(e,t,n))}async _computeAsync(e,t,n){if(!this._editor.hasModel())return[];const r=u_.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[await jLe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(e,t){return KLe(this,this._editor,this._themeService,t,e)}};cF=zLe([ULe(1,Mo)],cF);class cLt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r}}let dk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,n){if(!this._editor.hasModel()||!u_.get(this._editor))return null;const o=await BLe(n,this._editor.getModel(),wn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;W.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:await jLe(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let n=new W(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await cP(this._editor.getModel(),t,this._color,n,e),n=GLe(this._editor,n,t))}renderHoverParts(e,t){return KLe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};dk=zLe([ULe(1,Mo)],dk);async function jLe(i,e,t,n){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Rn(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new Ce(c),d=await WLe(e,t,n,wn.None),h=new Jxt(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),i instanceof cF?new lLt(i,W.lift(t.range),h,n):new cLt(i,W.lift(t.range),h,n)}function KLe(i,e,t,n,r){if(n.length===0||!e.hasModel())return me.None;if(r.setMinimumDimensions){const h=e.getOption(67)+8;r.setMinimumDimensions(new Gn(302,h))}const o=new Fe,s=n[0],a=e.getModel(),l=s.model,c=o.add(new aLt(r.fragment,l,e.getOption(142),t,i instanceof dk));r.setColorPicker(c);let u=!1,d=new W(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof dk){const h=n[0].model.color;i.color=h,cP(a,l,h,d,s),o.add(l.onColorFlushed(f=>{i.color=f}))}else o.add(l.onColorFlushed(async h=>{await cP(a,l,h,d,s),u=!0,d=GLe(e,d,l)}));return o.add(l.onDidChangeColor(h=>{cP(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function GLe(i,e,t){var n,r;const o=[],s=(n=t.presentation.textEdit)!==null&&n!==void 0?n:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(s),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=W.lift(s.range),l=i.getModel()._setTrackedRange(null,a,3);return i.executeEdits("colorpicker",o),i.pushUndoStop(),(r=i.getModel()._getTrackedRange(l))!==null&&r!==void 0?r:a}async function cP(i,e,t,n,r){const o=await WLe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,wn.None);e.colorPresentations=o||[]}function Hj(i,e){return!!i[e]}class z7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Hj(e.event,t.triggerModifier),this.hasSideBySideModifier=Hj(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Sde{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Hj(e,t.triggerModifier)}}class N2{constructor(e,t,n,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function xde(i){return i==="altKey"?Dn?new N2(57,"metaKey",6,"altKey"):new N2(5,"ctrlKey",6,"altKey"):Dn?new N2(6,"altKey",57,"metaKey"):new N2(6,"altKey",5,"ctrlKey")}class M5 extends me{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new ae),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new ae),this.onExecute=this._onExecute.event,this._onCancel=this._register(new ae),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:r=>r.target.position?r.target.position.lineNumber:0,this._opts=xde(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(78)){const o=xde(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new z7(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new z7(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new z7(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new Sde(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new Sde(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var uLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let d_=class extends sS{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},n,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){i3(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};d_=uLt([Lg(4,Wt),Lg(5,jn),Lg(6,cr),Lg(7,Gt),Lg(8,Mo),Lg(9,zr),Lg(10,pd),Lg(11,Ti),Lg(12,yt)],d_);const Lde=new Ce(new Rn(0,122,204)),dLt={showArrow:!0,showFrame:!0,className:"",frameColor:Lde,arrowColor:Lde,keepEditorSelection:!1},hLt="vs.editor.contrib.zoneWidget";class fLt{constructor(e,t,n,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class gLt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class P5{constructor(e){this._editor=e,this._ruleName=P5._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),rz(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(){rz(this._ruleName),zA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:W.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}P5._IdGenerator=new MZ(".arrow-decoration-");class pLt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Fe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Fg(t),i3(this.options,dLt,!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(n=>{const r=this._getWidth(n);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(n)+"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 P5(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 n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const r=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=W.isIRange(e)?W.lift(e):W.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:an.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new fLt(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new gLt(hLt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new W(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Is(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 n=(t.currentY-e.startY)/this.editor.getOption(67),r=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var qLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XLe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const YLe=Sn("IPeekViewService");Tn(YLe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const r=this._widgets.get(i);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var al;(function(i){i.inPeekEditor=new ct("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(al||(al={}));let hk=class{constructor(e,t){e instanceof d_&&al.inPeekEditor.bindTo(t)}dispose(){}};hk.ID="editor.contrib.referenceController";hk=qLe([XLe(1,Gt)],hk);Kn(hk.ID,hk,0);function mLt(i){const e=i.get(jn).getFocusedCodeEditor();return e instanceof d_?e.getParentEditor():e}const vLt={headerBackgroundColor:Ce.white,primaryHeadingColor:Ce.fromHex("#333333"),secondaryHeadingColor:Ce.fromHex("#6c6c6cb3")};let uF=class extends pLt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new ae,this.onDidClose=this._onDidClose.event,i3(this.options,vLt,!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=Xe(".head"),this._bodyElement=Xe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=Xe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Lr(this._titleElement,"click",o=>this._onTitleClick(o))),Oe(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=Xe("span.filename"),this._secondaryHeading=Xe("span.dirname"),this._metaHeading=Xe("span.meta"),Oe(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=Xe(".peekview-actions");Oe(this._headElement,n);const r=this._getActionBarOptions();this._actionbarWidget=new du(n,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Il("peekview.close",w("label.close","Close"),Vt.asClassName(tt.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:ySe.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:Ps(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Sl(this._metaHeading)):pa(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(67)*1.2),r=Math.round(e-(n+2));this._doLayoutHead(n,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`)}};uF=qLe([XLe(2,Wt)],uF);const _Lt=X("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ce.black,hcLight:Ce.white},w("peekViewTitleBackground","Background color of the peek view title area.")),ZLe=X("peekViewTitleLabel.foreground",{dark:Ce.white,light:Ce.black,hcDark:Ce.white,hcLight:Xu},w("peekViewTitleForeground","Color of the peek view title.")),QLe=X("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),bLt=X("peekView.border",{dark:tl,light:tl,hcDark:Ln,hcLight:Ln},w("peekViewBorder","Color of the peek view borders and arrow.")),CLt=X("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ce.black,hcLight:Ce.white},w("peekViewResultsBackground","Background color of the peek view result list."));X("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));X("peekViewResult.fileForeground",{dark:Ce.white,light:"#1E1E1E",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));X("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));X("peekViewResult.selectionForeground",{dark:Ce.white,light:"#6C6C6C",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const lv=X("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Ce.black,hcLight:Ce.white},w("peekViewEditorBackground","Background color of the peek view editor."));X("peekViewEditorGutter.background",{dark:lv,light:lv,hcDark:lv,hcLight:lv},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));X("peekViewEditorStickyScroll.background",{dark:lv,light:lv,hcDark:lv,hcLight:lv},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));X("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));X("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));X("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class h_{constructor(e,t,n,r){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=r,this.id=cU.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?w({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,uu(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",uu(this.uri),this.range.startLineNumber,this.range.startColumn)}}class yLt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:r,column:o-t}),c=new W(r,l.startColumn,r,o),u=new W(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class fk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Mr}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",uu(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,uu(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 n=await e.createModelReference(t.uri);this._previews.set(t.uri,new yLt(n))}catch(n){nn(n)}return this}}class Tl{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new ae,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(Tl._compareReferences);let r;for(const o of e)if((!r||!Gi.isEqual(r.uri,o.uri,!0))&&(r=new fk(this,o.uri),this.groups.push(r)),r.children.length===0||Tl._compareReferences(o,r.children[r.children.length-1])!==0){const s=new h_(n===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Tl(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let r=n.children.indexOf(e);const o=n.children.length,s=n.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%s,n.parent.groups[r].children[0]):(r=(r+s-1)%s,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))}nearestReference(e,t){const n=this.references.map((r,o)=>({idx:o,prefixLen:qv(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&W.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Gi.compare(e.uri,t.uri)||W.compareRangesUsingStarts(e.range,t.range)}}var A5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},O5=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vj;let zj=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Tl||e instanceof fk}getChildren(e){if(e instanceof Tl)return e.groups;if(e instanceof fk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};zj=A5([O5(0,ul)],zj);class wLt{getHeight(){return 23}getTemplateId(e){return e instanceof fk?gk.id:GT.id}}let Uj=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof h_){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return uu(e.uri)}};Uj=A5([O5(0,ci)],Uj);class SLt{getId(e){return e instanceof h_?e.id:e.uri}}let jj=class extends me{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new KO(n,{supportHighlights:!0})),this.badge=new KU(Oe(n,Xe(".count")),{},bSe),e.appendChild(n)}set(e,t){const n=V3(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};jj=A5([O5(1,lS)],jj);let gk=Vj=class{constructor(e){this._instantiationService=e,this.templateId=Vj.id}renderTemplate(e){return this._instantiationService.createInstance(jj,e)}renderElement(e,t,n){n.set(e.element,TT(e.filterData))}disposeTemplate(e){e.dispose()}};gk.id="FileReferencesRenderer";gk=Vj=A5([O5(0,Wt)],gk);class xLt{constructor(e){this.label=new Mv(e)}set(e,t){var n;const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!r||!r.value)this.label.set(`${uu(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!ah.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,TT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class GT{constructor(){this.templateId=GT.id}renderTemplate(e){return new xLt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}GT.id="OneReferenceRenderer";class LLt{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var ELt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class F5{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Fe,this._callOnModelChange=new Fe,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=[],n=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(ILt,"ReferencesWidget",this._treeContainer,new wLt,[this._instantiationService.createInstance(gk),this._instantiationService.createInstance(GT)],this._instantiationService.createInstance(zj),n),this._splitView.addView({onDidChange:ot.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},$O.Distribute),this._splitView.addView({onDidChange:ot.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},$O.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof h_&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),pa(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Gn(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=w("noResults","No results"),Sl(this._messageContainer),Promise.resolve(void 0)):(pa(this._messageContainer),this._decorationsManager=new F5(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:n}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Sl(this._treeContainer),Sl(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 h_)return e;if(e instanceof fk&&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!==cn.inMemory?this.setTitle(jft(e.uri),this._uriLabel.getUriLabel(V3(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const n=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 n;if(!this._model){r.dispose();return}si(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=W.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};Kj=ELt([Eg(3,Mo),Eg(4,ul),Eg(5,Wt),Eg(6,YLe),Eg(7,lS),Eg(8,z3),Eg(9,ci),Eg(10,qi),Eg(11,Ti)],Kj);var kLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uP;const NC=new ct("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let f_=uP=class{static get(e){return e.getContribution(uP.ID)}constructor(e,t,n,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Fe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=NC.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=DLt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Kj,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new le(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).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 n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const r=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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 n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const r=W.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=uP.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,No(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,nn(o)})}openReference(e,t,n){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};f_.ID="editor.contrib.referencesController";f_=uP=kLt([x1(2,Gt),x1(3,jn),x1(4,zr),x1(5,Wt),x1(6,md),x1(7,mn)],f_);function RC(i,e){const t=mLt(i);if(!t)return;const n=f_.get(t);n&&e(n)}sl.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fo(2089,60),when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});sl.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.goToNextOrPreviousReference(!0)})}});sl.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.goToNextOrPreviousReference(!1)})}});kn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");kn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");kn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");kn.registerCommand("closeReferenceSearch",i=>RC(i,e=>e.closeWidget()));sl.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Re.and(al.inPeekEditor,Re.not("config.editor.stablePeek"))});sl.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Re.and(NC,Re.not("config.editor.stablePeek"),Re.or(K.editorTextFocus,ybt.negate()))});sl.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Re.and(NC,HSe,JZ.negate(),eQ.negate()),handler(i){var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof h_&&RC(i,r=>r.revealReference(n[0]))}});sl.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Re.and(NC,HSe,JZ.negate(),eQ.negate()),handler(i){var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof h_&&RC(i,r=>r.openReference(n[0],!0,!0))}});kn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof h_&&RC(i,r=>r.openReference(n[0],!1,!0))});var JLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const AQ=new ct("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),B5=Sn("ISymbolNavigationService");let Gj=class{constructor(e,t,n,r){this._editorService=t,this._notificationService=n,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=AQ.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new qj(this._editorService),r=n.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(sZ(d.uri,a.uri))c=!0,u=u||W.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=td(n,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:W.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Gj=JLe([oE(0,Gt),oE(1,jn),oE(2,zr),oE(3,ci)],Gj);Tn(B5,Gj,1);st(new class extends zo{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:AQ,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(B5).revealNext(e)}});sl.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:AQ,primary:9,handler(i){i.get(B5).reset()}});let qj=class{constructor(e){this._listener=new Map,this._disposables=new Fe,this._onDidChange=new ae,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,td(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};qj=JLe([oE(0,jn)],qj);async function qT(i,e,t,n){const o=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{eo(l)})),s=await Promise.all(o);return hh(s.flat())}function W5(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideDefinition(o,s,n))}function eEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideDeclaration(o,s,n))}function tEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideImplementation(o,s,n))}function nEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideTypeDefinition(o,s,n))}function $5(i,e,t,n,r){return qT(e,t,i,async(o,s,a)=>{const l=await o.provideReferences(s,a,{includeDeclaration:!0},r);if(!n||!l||l.length!==2)return l;const c=await o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l})}async function XT(i){const e=await i(),t=new Tl(e,""),n=t.references.map(r=>r.link);return t.dispose(),n}rg("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(yt),r=W5(n.definitionProvider,e,t,wn.None);return XT(()=>r)});rg("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(yt),r=nEe(n.typeDefinitionProvider,e,t,wn.None);return XT(()=>r)});rg("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(yt),r=eEe(n.declarationProvider,e,t,wn.None);return XT(()=>r)});rg("_executeReferenceProvider",(i,e,t)=>{const n=i.get(yt),r=$5(n.referenceProvider,e,t,!1,wn.None);return XT(()=>r)});rg("_executeImplementationProvider",(i,e,t)=>{const n=i.get(yt),r=tEe(n.implementationProvider,e,t,wn.None);return XT(()=>r)});var yL,wL,SL,R2,M2,P2,A2,O2;ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class CS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof CS||le.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Ys extends Nh{static all(){return Ys._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of In.wrap(t.menu))(n.id===H.EditorContext||n.id===H.EditorContextPeek)&&(n.when=Re.and(e.precondition,n.when));return t}constructor(e,t){super(Ys._patchConfig(t)),this.configuration=e,Ys._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(zr),s=e.get(jn),a=e.get(P_),l=e.get(B5),c=e.get(yt),u=e.get(Wt),d=t.getModel(),h=t.getPosition(),f=CS.is(n)?n:new CS(d,h),g=new l_(t,5),p=gT(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async m=>{var v;if(!m||g.token.isCancellationRequested)return;Pl(m.ariaMessage);let _;if(m.referenceAt(d.uri,h)){const S=this._getAlternativeCommand(t);!Ys._activeAlternativeCommands.has(S)&&Ys._allSymbolNavigationCommands.has(S)&&(_=Ys._allSymbolNavigationCommands.get(S))}const y=m.references.length;if(y===0){if(!this.configuration.muteMessage){const S=d.getWordAtPosition(h);(v=Da.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(S),h)}}else if(y===1&&_)Ys._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(S=>_.runEditorCommand(S,t,n,r).finally(()=>{Ys._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,m,r)},m=>{o.error(m)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,n,r,o){const s=this._getGoToPreference(n);if(!(n instanceof d_)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(n,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}}async _openReference(e,t,n,r,o){let s;if(ert(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:W.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,n){const r=f_.get(e);r&&e.hasModel()?r.toggleWidget(n??e.getSelection(),No(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Ys._allSymbolNavigationCommands=new Map;Ys._activeAlternativeCommands=new Set;class YT extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await W5(e.definitionProvider,t,n,r),w("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ki((yL=class extends YT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:yL.id,title:{...Hn("actions.goToDecl.label","Go to Definition"),mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:K.hasDefinitionProvider,keybinding:[{when:K.editorTextFocus,primary:70,weight:100},{when:Re.and(K.editorTextFocus,FSe),primary:2118,weight:100}],menu:[{id:H.EditorContext,group:"navigation",order:1.1},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),kn.registerCommandAlias("editor.action.goToDeclaration",yL.id)}},yL.id="editor.action.revealDefinition",yL));ki((wL=class extends YT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:wL.id,title:Hn("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:Re.and(K.hasDefinitionProvider,K.isInEmbeddedEditor.toNegated()),keybinding:[{when:K.editorTextFocus,primary:fo(2089,70),weight:100},{when:Re.and(K.editorTextFocus,FSe),primary:fo(2089,2118),weight:100}]}),kn.registerCommandAlias("editor.action.openDeclarationToTheSide",wL.id)}},wL.id="editor.action.revealDefinitionAside",wL));ki((SL=class extends YT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:SL.id,title:Hn("actions.previewDecl.label","Peek Definition"),precondition:Re.and(K.hasDefinitionProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:H.EditorContextPeek,group:"peek",order:2}}),kn.registerCommandAlias("editor.action.previewDeclaration",SL.id)}},SL.id="editor.action.peekDefinition",SL));class iEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await eEe(e.declarationProvider,t,n,r),w("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ki((R2=class extends iEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:R2.id,title:{...Hn("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Re.and(K.hasDeclarationProvider,K.isInEmbeddedEditor.toNegated()),menu:[{id:H.EditorContext,group:"navigation",order:1.3},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},R2.id="editor.action.revealDeclaration",R2));ki(class extends iEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Hn("actions.peekDecl.label","Peek Declaration"),precondition:Re.and(K.hasDeclarationProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:3}})}});class rEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await nEe(e.typeDefinitionProvider,t,n,r),w("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ki((M2=class extends rEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:M2.ID,title:{...Hn("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:K.hasTypeDefinitionProvider,keybinding:{when:K.editorTextFocus,primary:0,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.4},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},M2.ID="editor.action.goToTypeDefinition",M2));ki((P2=class extends rEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:P2.ID,title:Hn("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:Re.and(K.hasTypeDefinitionProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:4}})}},P2.ID="editor.action.peekTypeDefinition",P2));class oEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await tEe(e.implementationProvider,t,n,r),w("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ki((A2=class extends oEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:A2.ID,title:{...Hn("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:K.hasImplementationProvider,keybinding:{when:K.editorTextFocus,primary:2118,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.45},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},A2.ID="editor.action.goToImplementation",A2));ki((O2=class extends oEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:O2.ID,title:Hn("actions.peekImplementation.label","Peek Implementations"),precondition:Re.and(K.hasImplementationProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:3142,weight:100},menu:{id:H.EditorContextPeek,group:"peek",order:5}})}},O2.ID="editor.action.peekImplementation",O2));class sEe extends Ys{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ki(class extends sEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Hn("goToReferences.label","Go to References"),mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Re.and(K.hasReferenceProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:1094,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.45},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,n,r){return new Tl(await $5(e.referenceProvider,t,n,!0,r),w("ref.title","References"))}});ki(class extends sEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Hn("references.action.label","Peek References"),precondition:Re.and(K.hasReferenceProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,n,r){return new Tl(await $5(e.referenceProvider,t,n,!1,r),w("ref.title","References"))}});class TLt extends Ys{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:Hn("label.generic","Go to Any Symbol"),precondition:Re.and(al.notInPeekEditor,K.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,r){return new Tl(this._references,w("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}kn.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:Ft},{name:"position",description:"The position at which to start",constraint:le.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(i,e,t,n,r,o,s)=>{Yn(Ft.isUri(e)),Yn(le.isIPosition(t)),Yn(Array.isArray(n)),Yn(typeof r>"u"||typeof r=="string"),Yn(typeof s>"u"||typeof s=="boolean");const a=i.get(jn),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends TLt{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},n,r);c.get(Wt).invokeFunction(u.run.bind(u),l)})}});kn.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:Ft},{name:"position",description:"The position at which to start",constraint:le.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(i,e,t,n,r)=>{i.get(cr).executeCommand("editor.action.goToLocations",e,t,n,r,void 0,!0)}});kn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Yn(Ft.isUri(e)),Yn(le.isIPosition(t));const n=i.get(yt),r=i.get(jn);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!Qf(o)||!o.hasModel())return;const s=f_.get(o);if(!s)return;const a=No(c=>$5(n.referenceProvider,o.getModel(),le.lift(t),!1,c).then(u=>new Tl(u,w("ref.title","References")))),l=new W(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});kn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var NLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sE;let nC=sE=class{constructor(e,t,n,r){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=r,this.toUnhook=new Fe,this.toUnhookForKeyboard=new Fe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new M5(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{nn(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(sE.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 n=e.target.position;this.startFindDefinition(n)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new Lxe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=No(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){nn(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?W.lift(o[0].originSelectionRange):new W(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=W.plusRange(a,l));this.addDecoration(a,new Ns().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Ns().appendCodeblock(h||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,n){let r=n.range;return r.endLineNumber-r.startLineNumber>=sE.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,n){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(n);return new YT({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Gt);return al.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};nC.ID="editor.contrib.gotodefinitionatposition";nC.MAX_SOURCE_PREVIEW_LINES=8;nC=sE=NLt([U7(1,ul),U7(2,qi),U7(3,yt)],nC);Kn(nC.ID,nC,2);let RLt=class{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}};class aEe extends me{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new ae),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new mi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new mi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new mi(()=>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=$rt(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){nn(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 RLt(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 j7{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,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 bb{constructor(e,t,n,r,o,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const W_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class OQ{constructor(){this._onDidWillResize=new ae,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new ae,this.onDidResize=this._onDidResize.event,this._sashListener=new Fe,this._size=new Gn(0,0),this._minSize=new Gn(0,0),this._maxSize=new Gn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Is(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Is(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Is(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:BO.North}),this._southSash=new Is(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:BO.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,n=0;this._sashListener.add(ot.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(ot.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ot.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(ot.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,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new Gn(t,e);Gn.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 MLt=30,PLt=24;class ALt extends me{constructor(e,t=new Gn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new OQ),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Gn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Gn(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?le.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Hr(t).top+n.top-MLt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const r=Hr(t),o=Wp(t.ownerDocument.body),s=r.top+n.top+n.height;return o.height-s-PLt}_findPositionPreference(e,t){var n,r;const o=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var FQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dP,Zh;const Ede=Xe;let dF=dP=class extends me{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Ov,this._editor)),this._participants=[];for(const r of W_.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new fF(this._editor,this._participants),this._hoverOperation=this._register(new aEe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new lEe(this._computer.anchor,o,r.isComplete))})),this._register(Lr(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(gr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,n,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:r,highlightRange:o}=dP.computeHoverRanges(this._editor,e.range,t),s=new Fe,a=s.add(new hF(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:dP._DECORATION_OPTIONS}]),s.add(Ot(()=>{h.clear()}))}this._widget.showAt(l,new FLt(e.initialMousePosX,e.initialMousePosY,c,n,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,s))}else s.dispose()}static computeHoverRanges(e,t,n){let r=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,f=h.convertModelRangeToViewRange(t),g=new le(f.startLineNumber,d.getLineMinColumn(f.startLineNumber));r=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const d of n)a=W.plusRange(a,d.range),d.range.startLineNumber===o&&d.range.endLineNumber===o&&(s=Math.max(Math.min(s,d.range.startColumn),r)),d.forceShowAtRange&&(l=d.range);const c=l?l.getStartPosition():new le(o,t.startColumn),u=l?l.getStartPosition():new le(o,s);return{showAtPosition:c,showAtSecondaryPosition:u,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const n=e.target;if(n.type===6&&t.push(new j7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,r){this._startShowingOrUpdateHover(new j7(0,e,void 0,void 0),t,n,r,null)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};dF._DECORATION_OPTIONS=an.register({description:"content-hover-highlight",className:"hoverHighlight"});dF=dP=FQ([tb(1,Wt),tb(2,ci)],dF);class lEe{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new OLt(this,this.anchor,t,this.isComplete)}}class OLt extends lEe{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}}class FLt{constructor(e,t,n,r,o,s,a,l,c,u){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=n,this.showAtPosition=r,this.showAtSecondaryPosition=o,this.preferAbove=s,this.stoleFocus=a,this.source=l,this.isBeforeContent=c,this.disposables=u,this.closestMouseDistance=void 0}}const Dde=30,K7=10,BLt=6;let Ov=Zh=class extends ALt{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,r,o){const s=e.getOption(67)+8,a=150,l=new Gn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new xZ),this._minimumSize=l,this._hoverVisibleKey=K.hoverVisible.bindTo(t),this._hoverFocusedKey=K.hoverFocused.bindTo(t),Oe(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(ph(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Zh.ID}static _applyDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return Zh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return Zh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Zh._applyMaxDimensions(this._hover.contentsDomNode,e,t),Zh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-K7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Gn(n,r),this._setHoverWidgetMaxDimensions(n,r)}_resize(e){var t,n;Zh._lastDimensions=new Gn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=BLt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=K7),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"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const n=Hr(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Ide(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,n.left,n.top,n.width,n.height));const r=Ide(e,t,n.left,n.top,n.width,n.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_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,Zh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Zh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=ep(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const u=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&qwe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Gn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ha(n),Math.min(o,e)),this._setContentsDomNodeDimensions(ha(r),Math.min(o,e-K7))}setMinimumDimensions(e){this._minimumSize=new Gn(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 Gn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=ep(t),r=ha(t);if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=ep(t),r=ha(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=ep(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-Dde})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+Dde})}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})}};Ov.ID="editor.contrib.resizableContentHoverWidget";Ov._lastDimensions=new Gn(0,0);Ov=Zh=FQ([tb(1,Gt),tb(2,mn),tb(3,pd),tb(4,ci)],Ov);let hF=class extends me{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Ede("div.hover-row.status-bar"),this.actionsElement=Oe(this.hoverElement,Ede("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(K3.render(this.actionsElement,e,n))}append(e){const t=Oe(this.actionsElement,e);return this._hasContent=!0,t}};hF=FQ([tb(0,ci)],hF);class fF{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 n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];const o=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Xr.EMPTY;const n=fF._getLineDecorations(this._editor,t);return Xr.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,n,e):Xr.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=fF._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return hh(t)}}function Ide(i,e,t,n,r,o){const s=t+r/2,a=n+o/2,l=Math.max(Math.abs(i-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const kde=Xe;class _w extends me{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Fe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new xZ),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new qf({editor:this._editor},t,n)),this._computer=new WLt(this._editor),this._hoverOperation=this._register(new aEe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return _w.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e,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 n=document.createDocumentFragment();for(const r of t){const o=kde("div.hover-row.markdown-hover"),s=Oe(o,kde("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),n.appendChild(o)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(67),s=this._hover.containerDomNode.clientHeight,a=n-r-(s-o)/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`}}_w.ID="editor.contrib.modesGlyphHoverWidget";class WLt{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=Uf.Center}computeSync(){var e,t;const n=a=>({value:a}),r=this._editor.getLineDecorations(this._lineNumber),o=[],s=this._laneOrLine==="lineNo";if(!r)return o;for(const a of r){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:Uf.Center;if(!s&&l!==this._laneOrLine)continue;const c=s?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||aS(c)||o.push(...qX(c).map(n))}return o}}class $Lt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function HLt(i,e,t,n,r){try{const o=await Promise.resolve(i.provideHover(t,n,r));if(o&&zLt(o))return new $Lt(i,o,e)}catch(o){eo(o)}}function BQ(i,e,t,n){const o=i.ordered(e).map((s,a)=>HLt(s,a,e,t,n));return Xr.fromPromises(o).coalesce()}function VLt(i,e,t,n){return BQ(i,e,t,n).map(r=>r.hover).toPromise()}rg("_executeHoverProvider",(i,e,t)=>{const n=i.get(yt);return VLt(n.hoverProvider,e,t,wn.None)});function zLt(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var ULt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Tde=Xe;class qd{constructor(e,t,n,r,o){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gF=class{constructor(e,t,n,r,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new qd(this,e.range,[new Ns().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];let a=1e3;const l=n.getLineLength(r),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(117),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new qd(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new qd(this,e.range,[{value:w("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===r?g.range.startColumn:1,m=g.range.endLineNumber===r?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||aS(v))continue;g.options.beforeContentClassName&&(f=!0);const _=new W(e.range.startLineNumber,p,e.range.startLineNumber,m);s.push(new qd(this,_,qX(v),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Xr.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Xr.EMPTY;const o=new le(e.range.startLineNumber,e.range.startColumn);return BQ(this._languageFeaturesService.hoverProvider,r,o,n).filter(s=>!aS(s.hover.contents)).map(s=>{const a=s.hover.range?W.lift(s.hover.range):e.range;return new qd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return cEe(e,t,this._editor,this._languageService,this._openerService)}};gF=ULt([F2(1,qi),F2(2,hl),F2(3,mn),F2(4,yt)],gF);function cEe(i,e,t,n,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new Fe;for(const s of e)for(const a of s.contents){if(aS(a))continue;const l=Tde("div.hover-row.markdown-hover"),c=Oe(l,Tde("div.hover-contents")),u=o.add(new qf({editor:t},n,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return o}var uEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Nde{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Xj=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._dispoables=new Fe,this._markers=[],this._nextIdx=-1,Ft.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=sI(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=W.compareRangesUsingStarts(a,l)||vr.compare(a.severity,l.severity):c=vr.compare(a.severity,l.severity)||W.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Ft.isUri(e)?e:void 0,severities:vr.Error|vr.Warning|vr.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Nde(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=JD(this._markers,{resource:e.uri},(s,a)=>sI(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},L1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qj;class KLt{constructor(e,t,n,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Fe,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Lr(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new Vye(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=ng(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ps(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=Xe("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Oe(this._codeLink,Xe("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ps(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ms(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const m=document.createElement("span");m.innerText=f.message,g.appendChild(p),g.appendChild(m),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case vr.Error:t=w("Error","Error");break;case vr.Warning:t=w("Warning","Warning");break;case vr.Info:t=w("Info","Info");break;case vr.Hint:t=w("Hint","Hint");break}let n=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(n=`${r.getLineContent(e.startLineNumber)}, ${n}`),n}}let yS=Qj=class extends uF{constructor(e,t,n,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Fe,this._onDidSelectRelatedInformation=new ae,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=vr.Warning,this._backgroundColor=Ce.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(YLt);let t=Jj,n=GLt;this._severity===vr.Warning?(t=hP,n=qLt):this._severity===vr.Info&&(t=eK,n=XLt);const r=e.getColor(t),o=e.getColor(n);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(ZLe),secondaryHeadingColor:e.getColor(QLe)})}_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=[],n=this._menuService.createMenu(Qj.TitleMenu,this._contextKeyService);n5(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Oe(e,Xe(""))}_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 KLt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=W.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?w("problems","{0} of {1} problems",t,n):w("change","{0} of {1} problem",t,n);this.setTitle(uu(a.uri),l)}this._icon.className=`codicon ${Zj.className(vr.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};yS.TitleMenu=new H("gotoErrorTitleMenu");yS=Qj=jLt([L1(1,Mo),L1(2,hl),L1(3,mu),L1(4,Wt),L1(5,Gt),L1(6,lS)],yS);const Rde=SI(Ef,wct),Mde=SI(Zs,yI),Pde=SI(tl,wI),Jj=X("editorMarkerNavigationError.background",{dark:Rde,light:Rde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),GLt=X("editorMarkerNavigationError.headerBackground",{dark:Mt(Jj,.1),light:Mt(Jj,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),hP=X("editorMarkerNavigationWarning.background",{dark:Mde,light:Mde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),qLt=X("editorMarkerNavigationWarning.headerBackground",{dark:Mt(hP,.1),light:Mt(hP,.1),hcDark:"#0C141F",hcLight:Mt(hP,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),eK=X("editorMarkerNavigationInfo.background",{dark:Pde,light:Pde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),XLt=X("editorMarkerNavigationInfo.headerBackground",{dark:Mt(eK,.1),light:Mt(eK,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),YLt=X("editorMarkerNavigation.background",{dark:ko,light:ko,hcDark:ko,hcLight:ko},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var ZLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aE;let g_=aE=class{static get(e){return e.getContribution(aE.ID)}constructor(e,t,n,r,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new Fe,this._editor=e,this._widgetVisible=hEe.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(yS,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(n=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!W.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:W.lift(n).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 le(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var n,r;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((n=aE.get(s))===null||n===void 0||n.close(),(r=aE.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};g_.ID="editor.contrib.markerController";g_=aE=ZLt([B2(1,dEe),B2(2,Gt),B2(3,jn),B2(4,Wt)],g_);class H5 extends pt{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=g_.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Fv extends H5{constructor(){super(!0,!1,{id:Fv.ID,label:Fv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:578,weight:100},menuOpts:{menuId:yS.TitleMenu,title:Fv.LABEL,icon:Or("marker-navigation-next",tt.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Fv.ID="editor.action.marker.next";Fv.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Cb extends H5{constructor(){super(!1,!1,{id:Cb.ID,label:Cb.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:1602,weight:100},menuOpts:{menuId:yS.TitleMenu,title:Cb.LABEL,icon:Or("marker-navigation-previous",tt.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Cb.ID="editor.action.marker.prev";Cb.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class QLt extends H5{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("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:K.focus,primary:66,weight:100},menuOpts:{menuId:H.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class JLt extends H5{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("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:K.focus,primary:1090,weight:100},menuOpts:{menuId:H.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Kn(g_.ID,g_,4);Ke(Fv);Ke(Cb);Ke(QLt);Ke(JLt);const hEe=new ct("markersNavigationVisible",!1),eEt=zo.bindToContribution(g_.get);st(new eEt({id:"closeMarkersNavigation",precondition:hEe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:K.focus,primary:9,secondary:[1033]}}));var tEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},G7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Pu=Xe;class nEt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Ade={type:1,filter:{include:qt.QuickFix},triggerAction:Al.QuickFixHover};let tK=class{constructor(e,t,n,r){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new W(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new nEt(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return me.None;const n=new Fe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,n)));const r=t.length===1?t[0]:t.sort((o,s)=>vr.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,n),n}renderMarkerHover(e,t){const n=Pu("div.hover-row"),r=Oe(n,Pu("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=Oe(r,Pu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=Pu("span");if(o){const g=Oe(u,Pu("span"));g.innerText=o}const d=Oe(u,Pu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(xe(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Oe(d,Pu("span"));h.innerText=a.value;const f=Oe(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=Oe(r,Pu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Ms(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=Oe(r,Pu("div"));g.style.marginTop="8px";const p=Oe(g,Pu("a"));p.innerText=`${uu(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(xe(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(nn)}));const m=Oe(g,Pu("span"));m.innerText=u,this._editor.applyFontInfo(m)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity===vr.Error||t.marker.severity===vr.Warning||t.marker.severity===vr.Info){const r=g_.get(this._editor);r&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:Fv.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const r=e.statusBar.append(Pu("div"));this.recentMarkerCodeActionsInfo&&(OO.makeKey(this.recentMarkerCodeActionsInfo.marker)===OO.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?me.None:Zv(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,n);r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(Ot(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;n.add(Ot(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:kQ,run:c=>{l=!0;const u=c_.get(this._editor),d=Hr(c);e.hide(),u==null||u.showCodeActions(Ade,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},nn)}}getCodeActions(e){return No(t=>sD(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Ade,yp.None,t))}};tK=tEt([G7(1,HY),G7(2,hl),G7(3,yt)],tK);const fEe="editor.action.inlineSuggest.commit",gEe="editor.action.inlineSuggest.showPrevious",pEe="editor.action.inlineSuggest.showNext";var WQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fP;let nK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=en(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new le(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ah((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(p_,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ot(()=>e.removeContentWidget(a))),o.add(yn(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==_p.Explicit&&s.triggerExplicitly()}))}))}};nK=WQ([Xd(2,Wt)],nK);const iEt=Or("inline-suggestion-hints-next",tt.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),rEt=Or("inline-suggestion-hints-previous",tt.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let p_=fP=class extends me{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const r=new Il(e,t,n,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,n,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${fP.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=pi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[pi("div@toolBar")]),this.previousAction=this.createCommandAction(gEe,w("previous","Previous"),Vt.asClassName(rEt)),this.availableSuggestionCountAction=new Il("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(pEe,w("next","Next"),Vt.asClassName(iEt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(H.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new mi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new mi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(iK,this.nodes.toolBar,H.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof bc)return l.createInstance(sEt,h,void 0);if(h===this.availableSuggestionCountAction){const g=new oEt(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{fP._dropDownVisible=h})),this._register(yn(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(yn(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(yn(h=>{const f=this._extraCommands.read(h);if(lr(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:m=>this._commandService.executeCommand(p.id)}));for(const[p,m]of this.inlineCompletionsActionsMenus.getActions())for(const v of m)v instanceof bc&&g.push(v);g.length>0&&g.unshift(new ho),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};p_._dropDownVisible=!1;p_.id=0;p_=fP=WQ([Xd(6,cr),Xd(7,Wt),Xd(8,ci),Xd(9,Gt),Xd(10,mu)],p_);class oEt extends dS{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 sEt=class extends s_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=pi("div.keybinding").root;new ex(t,Ll,{disableTitle:!0,...GSe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},iK=class extends sk{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];n5(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){lr(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){lr(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};iK=WQ([Xd(3,mu),Xd(4,Gt),Xd(5,$l),Xd(6,ci),Xd(7,ia)],iK);var aEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rK;const lEt=!1;let ll=rK=class extends me{constructor(e,t,n,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=r,this._keybindingService=o,this._listenersStore=new Fe,this._hoverState={mouseDown:!1,contentHoverFocused:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new mi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(rK.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},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){var t;this._hoverState.mouseDown=!0;const n=e.target;if(n.type===9&&n.detail===Ov.ID){this._hoverState.contentHoverFocused=!0;return}n.type===12&&n.detail===_w.ID||(n.type!==12&&(this._hoverState.contentHoverFocused=!1),!(!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing)&&this._hideWidgets())}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){var t,n;this._cancelScheduler();const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((n=this._contentWidget)===null||n===void 0)&&n.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,n,r,o,s;const a=e.target,l=this._hoverSettings.sticky;return!!(l&&a.type===9&&a.detail===Ov.ID||l&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!l&&a.type===9&&a.detail===Ov.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||l&&a.type===12&&a.detail===_w.ID)}_onEditorMouseMove(e){var t,n,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((n=this._contentWidget)===null||n===void 0)&&n.isResizing||this._hoverState.mouseDown&&this._hoverState.contentHoverFocused)return;const s=this._hoverSettings.sticky;if(s&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&s&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,r,o;if(!e)return;const s=e.target,a=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(147),c=this._hoverSettings.enabled,u=this._hoverState.activatedByDecoratorClick;if(a&&(l==="click"&&!u||l==="hover"&&!c&&!lEt||l==="clickAndHover"&&!c&&!u)||!a&&!c&&!u){this._hideWidgets();return}if(this._getOrCreateContentWidget().showsOrWillShow(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(s.type===2&&s.position&&s.detail.glyphMarginLane){(r=this._contentWidget)===null||r===void 0||r.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,s.detail.glyphMarginLane);return}if(s.type===3&&s.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,"lineNo");return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||r||this._hideWidgets()}_hideWidgets(){var e,t,n;this._hoverState.mouseDown&&this._hoverState.contentHoverFocused&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||p_.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._hoverState.contentHoverFocused=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(dF,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=new _w(this._editor,this._languageService,this._openerService)),this._glyphWidget}showContentHover(e,t,n,r,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ll.ID="editor.contrib.hover";ll=rK=aEt([W2(1,Wt),W2(2,hl),W2(3,qi),W2(4,ci)],ll);var Nd;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Nd||(Nd={}));class cEt extends pt{constructor(){super({id:"editor.action.showHover",label:w({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:"Show or Focus Hover",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:[Nd.NoAutoFocus,Nd.FocusIfVisible,Nd.AutoFocusImmediately],enumDescriptions:[w("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),w("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),w("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Nd.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const r=ll.get(t);if(!r)return;const o=n==null?void 0:n.focus;let s=Nd.FocusIfVisible;Object.values(Nd).includes(o)?s=o:typeof o=="boolean"&&o&&(s=Nd.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new W(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?s!==Nd.NoAutoFocus?r.focus():a(l):a(l||s===Nd.AutoFocusImmediately)}}class uEt extends pt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=ll.get(t);if(!n)return;const r=t.getPosition();if(!r)return;const o=new W(r.lineNumber,r.column,r.lineNumber,r.column),s=nC.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{n.showContentHover(o,1,1,!0)})}}class dEt extends pt{constructor(){super({id:"editor.action.scrollUpHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:16,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollUp()}}class hEt extends pt{constructor(){super({id:"editor.action.scrollDownHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:18,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollDown()}}class fEt extends pt{constructor(){super({id:"editor.action.scrollLeftHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:15,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollLeft()}}class gEt extends pt{constructor(){super({id:"editor.action.scrollRightHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:17,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollRight()}}class pEt extends pt{constructor(){super({id:"editor.action.pageUpHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=ll.get(t);n&&n.pageUp()}}class mEt extends pt{constructor(){super({id:"editor.action.pageDownHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=ll.get(t);n&&n.pageDown()}}class vEt extends pt{constructor(){super({id:"editor.action.goToTopHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=ll.get(t);n&&n.goToTop()}}class _Et extends pt{constructor(){super({id:"editor.action.goToBottomHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=ll.get(t);n&&n.goToBottom()}}Kn(ll.ID,ll,2);Ke(cEt);Ke(uEt);Ke(dEt);Ke(hEt);Ke(fEt);Ke(gEt);Ke(pEt);Ke(mEt);Ke(vEt);Ke(_Et);W_.register(gF);W_.register(tK);vu((i,e)=>{const t=i.getColor(Nye);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class oK extends me{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(147);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==HLe||!n.range)return;const r=this._editor.getContribution(ll.ID);if(r&&!r.isColorPickerVisible){const o=new W(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}oK.ID="editor.contrib.colorContribution";Kn(oK.ID,oK,2);W_.register(cF);var mEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ud=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sK,aK;let m_=sK=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=K.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=K.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new mF(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(sK.ID)}};m_.ID="editor.contrib.standaloneColorPickerController";m_=sK=mEe([Ud(1,Gt),Ud(2,rr),Ud(3,ci),Ud(4,Wt),Ud(5,yt),Ud(6,Ti)],m_);Kn(m_.ID,m_,1);const Ode=8,bEt=22;let mF=aK=class extends me{constructor(e,t,n,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new ae),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(dk,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(ph(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?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(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return aK.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 CEt(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}},n=await this._standaloneColorPickerParticipant.createColorHover(t,new MQ(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null}_render(e,t){const n=document.createDocumentFragment(),r=this._register(new hF(this._keybindingService));let o;const s={fragment:n,statusBar:r,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-bEt-Ode,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+Ode+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};mF.ID="editor.contrib.standaloneColorPickerWidget";mF=aK=mEe([Ud(3,Wt),Ud(4,rr),Ud(5,ci),Ud(6,yt),Ud(7,Ti)],mF);class CEt{constructor(e,t){this.value=e,this.foundInEditor=t}}class yEt extends Nh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Hn("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:H.CommandPalette}]})}runEditorCommand(e,t){var n;(n=m_.get(t))===null||n===void 0||n.showOrFocus()}}class wEt extends pt{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:K.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=m_.get(t))===null||n===void 0||n.hide()}}class SEt extends pt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({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:K.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=m_.get(t))===null||n===void 0||n.insertColor()}}Ke(wEt);Ke(SEt);ki(yEt);class cv{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const r=t.length,o=e.length;if(n+r>o)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const m=d.substring(f+t.length),v=h.substring(0,g);(m.indexOf(n)>=0||v.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=cv._createRemoveBlockCommentOperations(new W(a,f+t.length+1,c,g+1),t,n)):(p=cv._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const m of p)s.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,n){const r=[];return W.isEmpty(e)?r.push(Qi.delete(new W(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(r.push(Qi.delete(new W(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Qi.delete(new W(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),r}static _createAddBlockCommentOperations(e,t,n,r){const o=[];return W.isEmpty(e)?o.push(Qi.replace(new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(Qi.insert(new le(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Qi.insert(new le(e.endLineNumber,e.endColumn),(r?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const r=n[0],o=n[1];return new Et(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=n[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Et(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class Ag{constructor(e,t,n,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;co?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class $Q extends pt{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>W.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lK;let wS=lK=class{static get(e){return e.getContribution(lK.ID)}constructor(e,t,n,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Fe,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&&$b(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 n=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?H.SimpleEditorContext:H.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof dI){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new jw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new ho)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Hr(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(127)&&!fh;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new dS(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new dS(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||r_t(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let n=0;const r=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new jw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=m=>()=>{this._configurationService.updateValue(d,m)},p=[];for(const m of f)p.push(r({label:m.label,checked:h===m.value,run:g(m.value)}));return o(c,p)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new ho),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!fh;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()}};wS.ID="editor.contrib.contextmenu";wS=lK=IEt([u0(1,$l),u0(2,og),u0(3,Gt),u0(4,ci),u0(5,mu),u0(6,mn),u0(7,jb)],wS);class kEt extends pt{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=wS.get(t))===null||n===void 0||n.showContextMenu()}}Kn(wS.ID,wS,2);Ke(kEt);class q7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let r=0;r{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 n=new q7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new X7(n,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 X7(new q7(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 X7(new q7(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}}iC.ID="editor.contrib.cursorUndoRedoController";class TEt extends pt{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var r;(r=iC.get(t))===null||r===void 0||r.cursorUndo()}}class NEt extends pt{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var r;(r=iC.get(t))===null||r===void 0||r.cursorRedo()}}Kn(iC.ID,iC,0);Ke(TEt);Ke(NEt);class REt{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new W(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Et(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 Et(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.lineNumberthis._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)||(E1(e)&&(this._modifierPressed=!0),this._mouseDown&&E1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(E1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===wp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}E1(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 le(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;n=[new Et(o,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new Et(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(E1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(wp.ID,new REt(this._dragSelection,t,E1(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 W(e.lineNumber,e.column,e.lineNumber,e.column),options:wp._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()}}wp.ID="editor.contrib.dragAndDrop";wp.TRIGGER_KEY_VALUE=Dn?6:5;wp._DECORATION_OPTIONS=an.register({description:"dnd-target",className:"dnd-target"});Kn(wp.ID,wp,2);var HQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const V5=w("builtIn","Built-in");class VQ{async provideDocumentPasteEdits(e,t,n,r,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,r){const o=await this.getEdit(n,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class vEe extends VQ{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[wr.text],this.pasteMimeTypes=[wr.text]}async getEdit(e,t){const n=e.get(wr.text);if(!n||e.has(wr.uriList))return;const r=await n.asString();return{handledMimeType:wr.text,label:w("text.label","Insert Plain Text"),detail:V5,insertText:r}}}class _Ee extends VQ{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[wr.uriList],this.pasteMimeTypes=[wr.uriList]}async getEdit(e,t){const n=await bEe(e);if(!n.length||t.isCancellationRequested)return;let r=0;const o=n.map(({uri:a,originalText:l})=>a.scheme===cn.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=n.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:wr.uriList,insertText:o,label:s,detail:V5}}}let vF=class extends VQ{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[wr.uriList],this.pasteMimeTypes=[wr.uriList]}async getEdit(e,t){const n=await bEe(e);if(!n.length||t.isCancellationRequested)return;const r=hh(n.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Xft(s.uri,o):void 0}));if(r.length)return{handledMimeType:wr.uriList,insertText:r.join(" "),label:n.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:V5}}};vF=HQ([pk(0,jb)],vF);class MEt{constructor(){this.id="html",this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:wr.text}]}async provideDocumentPasteEdits(e,t,n,r,o){if(r.trigger!=="explicit"&&r.only!==this.id)return;const s=n.get("text/html"),a=await(s==null?void 0:s.asString());if(!(!a||o.isCancellationRequested))return{insertText:a,yieldTo:this._yieldTo,label:w("pasteHtmlLabel","Insert HTML"),detail:V5}}}async function bEe(i){const e=i.get(wr.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const r of N5.parse(t))try{n.push({uri:Ft.parse(r),originalText:r})}catch{}return n}let cK=class extends me{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new vEe)),this._register(e.documentOnDropEditProvider.register("*",new _Ee)),this._register(e.documentOnDropEditProvider.register("*",new vF(t)))}};cK=HQ([pk(0,yt),pk(1,jb)],cK);let uK=class extends me{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new vEe)),this._register(e.documentPasteEditProvider.register("*",new _Ee)),this._register(e.documentPasteEditProvider.register("*",new vF(t))),this._register(e.documentPasteEditProvider.register("*",new MEt))}};uK=HQ([pk(0,yt),pk(1,jb)],uK);Kn(Hp.ID,Hp,0);BT(uK);st(new class extends zo{constructor(){super({id:CLe,precondition:yLe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=Hp.get(e))===null||n===void 0?void 0:n.changePasteType()}});Ke(class extends pt{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:K.writable,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=Hp.get(e))===null||n===void 0?void 0:n.pasteAs(r)}});Ke(class extends pt{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:K.writable})}run(i,e,t){var n;return(n=Hp.get(e))===null||n===void 0?void 0:n.pasteAs("text")}});class PEt{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 Fde{constructor(e){this.identifier=e}}const CEe=Sn("treeViewsDndService");Tn(CEe,PEt,1);var AEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dK;const yEe="editor.experimental.dropIntoEditor.defaultProvider",wEe="editor.changeDropType",SEe=new ct("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let SS=dK=class extends me{static get(e){return e.getContribution(dK.ID)}constructor(e,t,n,r,o){super(),this._configService=n,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=lk.getInstance(),this._dropProgressManager=this._register(t.createInstance(oF,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(aF,"dropIntoEditor",e,SEe,{id:wEe,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,n){var r;if(!n.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=No(async s=>{const a=new l_(e,1,void 0,s);try{const l=await this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=await this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([W.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,n,r,o){const s=await gT(Promise.all(e.map(async l=>{try{const c=await l.provideDocumentOnDropEdits(t,n,r,o.token);if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),o.token),a=hh(s??[]);return _Le(a)}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(yEe,{resource:e.uri});for(const[r,o]of Object.entries(n)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&hLe(r,[a.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new dLe;const t=pLe(e.dataTransfer);if(this.treeItemsTransfer.hasData(Fde.prototype)){const n=this.treeItemsTransfer.getData(Fde.prototype);if(Array.isArray(n))for(const r of n){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t}};SS.ID="editor.contrib.dropIntoEditorController";SS=dK=AEt([$2(1,Wt),$2(2,mn),$2(3,yt),$2(4,CEe)],SS);Kn(SS.ID,SS,2);st(new class extends zo{constructor(){super({id:wEe,precondition:SEe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=SS.get(e))===null||n===void 0||n.changeDropType()}});BT(cK);ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{[yEe]:{type:"object",scope:5,description:w("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class Gs{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{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Gs._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Gs._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new W(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Gs._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let r=Gs._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Gs._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new W(d,1,h,1),options:Gs._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}o.push({range:new W(d,1,h,1),options:Gs._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Gs._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.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,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const n=[];for(let s=0;sW.compareRangesUsingStarts(s.range,a.range));const r=[];let o=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function Bde(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Wde(i,e,t){const n=e.split(t),r=i[0].split(t);let o="";return n.forEach((s,a)=>{o+=xEe([r[a]],s)+t}),o.slice(0,-1)}class $de{constructor(e){this.staticValue=e,this.kind=0}}class FEt{constructor(e){this.pieces=e,this.kind=1}}class xS{static fromStaticValue(e){return new xS([yb.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new $de(""):e.length===1&&e[0].staticValue!==null?this._state=new $de(e[0].staticValue):this._state=new FEt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?xEe(e,this._state.staticValue):this._state.staticValue;let n="";for(let r=0,o=this._state.pieces.length;r0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=r)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` -`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(n++,n>=r)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},$Et)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let n=null;typeof t<"u"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new W(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(n,!1,uv);this._decorations.set(r,n);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=pI(r.map(l=>l.range),l=>W.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===1?(n===1?n=o.getLineCount():n--,r=o.getLineMaxColumn(n)):r--,new le(n,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,r=1):r++,new le(n,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()aD._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=uv?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new b0(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(n,a.buildReplaceString(null,c));const u=new JY(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=n.length;ss.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(o=>new Et(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=n.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY),inputActiveOptionBackground:ft(G0)};this.caseSensitive=this._register(new LSe({appendTitle:this._keybindingLabelFor(Mi.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,...r})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new ESe({appendTitle:this._keybindingLabelFor(Mi.ToggleWholeWordCommand),isChecked:this._state.wholeWord,...r})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new DSe({appendTitle:this._keybindingLabelFor(Mi.ToggleRegexCommand),isChecked:this._state.isRegex,...r})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(xe(this._domNode,Je.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(xe(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 U5.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")}}U5.ID="editor.contrib.findOptionsWidget";function K2(i,e){return i===1?!0:i===2?!1:e}class HEt extends me{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return K2(this._isRegexOverride,this._isRegex)}get wholeWord(){return K2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return K2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return K2(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 ae),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,n){const r={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof n<"u"&&(W.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,n=!0){var r;const o={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!W.equalsRange(f,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=uv}}const VEt=w("defaultLabel","input"),zEt=w("label.preserveCaseToggle","Preserve Case");class UEt extends JS{constructor(e){super({icon:tt.preserveCase,title:zEt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jEt extends Lc{constructor(e,t,n,r){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new ae),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new ae),this._onInput=this._register(new ae),this._onKeyUp=this._register(new ae),this._onPreserveCaseKeyDown=this._register(new ae),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||VEt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ISe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new UEt({appendTitle:o,isChecked:!1,...r.toggleStyles})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),gn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var LEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EEe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UQ=new ct("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),jQ="historyNavigationWidgetFocus",DEe="historyNavigationForwardsEnabled",IEe="historyNavigationBackwardsEnabled";let Sp;const G2=[];function kEe(i,e){if(G2.includes(e))throw new Error("Cannot register the same widget multiple times");G2.push(e);const t=new Fe,n=new ct(jQ,!1).bindTo(i),r=new ct(DEe,!0).bindTo(i),o=new ct(IEe,!0).bindTo(i),s=()=>{n.set(!0),Sp=e},a=()=>{n.set(!1),Sp===e&&(Sp=void 0)};return pT(e.element)&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Ot(()=>{G2.splice(G2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let hK=class extends kSe{constructor(e,t,n,r){super(e,t,n);const o=this._register(r.createScoped(this.inputBox.element));this._register(kEe(o,this.inputBox))}};hK=LEe([EEe(3,Gt)],hK);let fK=class extends jEt{constructor(e,t,n,r,o=!1){super(e,t,o,n);const s=this._register(r.createScoped(this.inputBox.element));this._register(kEe(s,this.inputBox))}};fK=LEe([EEe(3,Gt)],fK);sl.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Re.and(Re.has(jQ),Re.equals(IEe,!0),Re.not("isComposing"),UQ.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Sp==null||Sp.showPreviousValue()}});sl.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Re.and(Re.has(jQ),Re.equals(DEe,!0),Re.not("isComposing"),UQ.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Sp==null||Sp.showNextValue()}});function Hde(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const KEt=Or("find-selection",tt.selection,w("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Vde=Or("find-collapsed",tt.chevronRight,w("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),zde=Or("find-expanded",tt.chevronDown,w("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),GEt=Or("find-replace",tt.replace,w("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),qEt=Or("find-replace-all",tt.replaceAll,w("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),XEt=Or("find-previous-match",tt.arrowUp,w("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),YEt=Or("find-next-match",tt.arrowDown,w("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),ZEt=w("label.findDialog","Find / Replace"),QEt=w("label.find","Find"),JEt=w("placeholder.find","Find"),eDt=w("label.previousMatchButton","Previous Match"),tDt=w("label.nextMatchButton","Next Match"),nDt=w("label.toggleSelectionFind","Find in Selection"),iDt=w("label.closeButton","Close"),rDt=w("label.replace","Replace"),oDt=w("placeholder.replace","Replace"),sDt=w("label.replaceButton","Replace"),aDt=w("label.replaceAllButton","Replace All"),lDt=w("label.toggleReplaceButton","Toggle Replace"),cDt=w("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",uv),uDt=w("label.matchesLocation","{0} of {1}"),Ude=w("label.noResults","No results"),Kh=419,dDt=275,hDt=dDt-54;let xL=69;const fDt=33,jde="ctrlEnterReplaceAll.windows.donotask",Kde=Dn?256:2048;class Y7{constructor(e){this.afterLineNumber=e,this.heightInPx=fDt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Gde(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function qde(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(91)&&(this._codeEditor.getOption(91)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(144)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new Y7(0),this._showViewZone()),!h&&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 u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=z5.bindTo(s),this._findFocusTracker=this._register(ph(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=zQ.bindTo(s),this._replaceFocusTracker=this._register(ph(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 Y7(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return j5.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(91)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ha(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,nn)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=xL+"px",this._state.matchesCount>=uv?this._matchesCount.title=cDt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=uv&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Ob(uDt,n,t)}else e=Ude;this._matchesCount.appendChild(document.createTextNode(e)),Pl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),xL=Math.max(xL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===Ude)return n===""?w("ariaSearchNoResultEmpty","{0} found",e):w("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const r=w("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return w("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);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 n=!this._codeEditor.getOption(91);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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 n=this._codeEditor.getDomNode();if(n){const r=Hr(n),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=k1e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(r=>{n.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new Y7(0));const n=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===n.heightInPx)return;const s=o-n.heightInPx;n.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(84).top,o<=0)return;n.heightInPx=o,this._viewZoneId=r.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!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 n=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&ha(this._domNode)>Kh){this._domNode.style.maxWidth=`${n-28-r-15}px`,this._replaceInput.width=ha(this._findInput.domNode);return}if(Kh+28+r>=n&&(s=!0),Kh+28+r-xL>=n&&(a=!0),Kh+28+r-xL>=n+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${n-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ha(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 n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!W.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(Kde|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),parse:i=>N5.split(i).filter(e=>!e.startsWith("#"))}),dde={EDITORS:"CodeEditors",FILES:"CodeFiles"};class ext{}const txt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ur.add(txt.DragAndDropContribution,new ext);class lk{constructor(){}static getInstance(){return lk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}lk.INSTANCE=new lk;function gLe(i){const e=new dLe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(n,EQ(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(n,nxt(r))}}return e}function nxt(i){const e=i.path?Ft.parse(i.path):void 0;return JSt(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const ixt=Object.freeze([dde.EDITORS,dde.FILES,zI.RESOURCES,zI.INTERNAL_URI_LIST]);function pLe(i,e=!1){const t=gLe(i),n=t.get(zI.INTERNAL_URI_LIST);if(n)t.replace(wr.uriList,n);else if(e||!t.has(wr.uriList)){const r=[];for(const o of i.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(Ft.file(a).toString()):r.push(Ft.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(wr.uriList,EQ(N5.create(r)))}for(const r of ixt)t.delete(r);return t}class Bu{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,n=this.value.charCodeAt(e),r;if(r=Bu._table[n],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Bu.isDigitCharacter(n)){r=8;do t+=1,n=this.value.charCodeAt(e+t);while(Bu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}if(Bu.isVariableCharacter(n)){r=9;do n=this.value.charCodeAt(e+ ++t);while(Bu.isVariableCharacter(n)||Bu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof Bu._table[n]>"u"&&!Bu.isDigitCharacter(n)&&!Bu.isVariableCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}}Bu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class ox{constructor(){this._children=[]}appendChild(e){return e instanceof va&&this._children[this._children.length-1]instanceof va?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,r=n.children.indexOf(e),o=n.children.slice(0);o.splice(r,1,...t),n._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 UT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class va extends ox{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new va(this.value)}}class mLe extends ox{}class jc extends mLe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.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 sx?this._children[0]:void 0}clone(){const e=new jc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class sx extends ox{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof va&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new sx;return this.options.forEach(e.appendChild,e),e}}class DQ extends ox{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(o=>o instanceof Fd&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const n of this._children)if(n instanceof Fd){let r=e[n.index]||"";r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return""}clone(){const e=new DQ;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 Fd extends ox{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,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(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,r)=>r===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Fd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ck extends mLe{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 va(t)],!0):!1}clone(){const e=new ck(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function hde(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class UT extends ox{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof jc&&(e.push(n),t=!t||t.indexr===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return hde([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof jc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ck&&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 UT;return this._children=this.children.map(t=>t.clone()),e}walk(e){hde(this.children,e)}}class Qb{constructor(){this._scanner=new Bu,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){const r=new UT;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof jc&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new jc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof jc&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new jc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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 n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new va(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new jc(Number(t)):new ck(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const o=new jc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new va("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new sx;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];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;n.push(r)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new va(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const o=new ck(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new va("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseTransform(e){const t=new DQ;let n="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,n+=o;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new va(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const r=this._accept(8,!0);if(r)if(n){if(this._accept(4))return e.appendChild(new Fd(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Fd(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Fd(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Fd(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Fd(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new va(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function vLe(i,e,t){var n,r,o,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(r=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]}:{edits:[...e.map(a=>new Nv(i,{range:a,text:typeof t.insertText=="string"?Qb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(s=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]}}function _Le(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var rxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const sxt=an.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:h1e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class R5 extends me{constructor(e,t,n,r,o){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Xe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Xe("span.icon");this.domNode.append(t),t.classList.add(...Vt.asClassNameArray(tt.loading),"codicon-modifier-spin");const n=()=>{const r=this.editor.getOption(67);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};n(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(67))&&n()})),this._register(xe(this.domNode,Je.CLICK,r=>{this.delegate.cancel()}))}getId(){return R5.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)}}R5.baseId="editor.widget.inlineProgressWidget";let oF=class extends me{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Vo),this._currentWidget=new Vo,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,n){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Qv(()=>{const o=W.fromPositions(e);this._currentDecorations.set([{range:o,options:sxt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(R5,this.id,this._editor,o,t,n))},this._showDelay);try{return await n}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};oF=rxt([oxt(2,Wt)],oF);var bLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rD=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Tj;let sF=Tj=class extends me{constructor(e,t,n,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Ot(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ot(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(ot.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=Xe(".post-edit-widget"),this.button=this._register(new GO(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(xe(this.domNode,Je.CLICK,()=>this.showSelector()))}getId(){return Tj.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Hr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Yy({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};sF.baseId="editor.widget.postEditWidget";sF=Tj=bLe([rD(7,$l),rD(8,Gt),rD(9,ci)],sF);let aF=class extends me{constructor(e,t,n,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Vo),this._register(ot.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const s=t.allEdits[t.activeEditIndex];if(!s)return;const a=vLe(o.uri,e,s),l=e[0],c=o.deltaDecorations([],[{range:l,options:{description:"paste-line-suffix",stickiness:0}}]);let u,d;try{u=await this._bulkEditService.apply(a,{editor:this._editor,token:r}),d=o.getDecorationRange(c[0])}finally{o.deltaDecorations(c,[])}n&&u.isApplied&&t.allEdits.length>1&&this.show(d??l,t,async h=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:h,allEdits:t.allEdits},n,r))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(sF,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};aF=bLe([rD(4,Wt),rD(5,NT)],aF);var axt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lP;let Da=lP=class{static get(e){return e.getContribution(lP.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Vo,this._messageListeners=new Fe,this._mouseOverMessage=!1,this._editor=e,this._visible=lP.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Pl(Bf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Bf(e)?X3(e,{actionHandler:{callback:r=>{this.closeMessage(),AZ(this._openerService,r,Bf(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new gde(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ot.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ts(ps(),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(xe(this._messageWidget.value.getDomNode(),Je.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(xe(this._messageWidget.value.getDomNode(),Je.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(n?n.containsPosition(r.target.position)||this.closeMessage():n=new W(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(gde.fadeOut(this._messageWidget.value))}};Da.ID="editor.contrib.messageController";Da.MESSAGE_VISIBLE=new ct("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));Da=lP=axt([fde(1,Gt),fde(2,hl)],Da);const lxt=zo.bindToContribution(Da.get);st(new lxt({id:"leaveEditorMessage",precondition:Da.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let gde=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Kn(Da.ID,Da,4);var cxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},S1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Nj;const CLe="editor.changePasteType",yLe=new ct("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),F7="application/vnd.code.copyMetadata";let Hp=Nj=class extends me{static get(e){return e.getContribution(Nj.ID)}constructor(e,t,n,r,o,s,a){super(),this._bulkEditService=n,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(xe(l,"copy",c=>this.handleCopy(c))),this._register(xe(l,"cut",c=>this.handleCopy(c))),this._register(xe(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new oF("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(aF,"pasteIntoEditor",e,yLe,{id:CLe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},zS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(k_&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new W(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,Os),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=gLe(e.clipboardData),g=h.flatMap(v=>{var _;return(_=v.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=T5();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const m=No(async v=>{const _=hh(await Promise.all(h.map(async y=>{try{return await y.prepareDocumentPaste(r,a,f,v)}catch(S){console.error(S);return}})));_.reverse();for(const y of _)for(const[S,L]of y)f.replace(S,L);return f});(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:m}}async handlePaste(e){var t,n,r,o,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=Da.get(this._editor))===null||t===void 0||t.closeMessage(),(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const a=this._editor.getModel(),l=this._editor.getSelections();if(!(l!=null&&l.length)||!a||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const c=this.fetchCopyMetadata(e),u=pLe(e.clipboardData);u.delete(F7);const d=[...e.clipboardData.types,...(r=c==null?void 0:c.providerCopyMimeTypes)!==null&&r!==void 0?r:[],wr.uriList],h=this._languageFeaturesService.documentPasteEditProvider.ordered(a).filter(f=>{var g,p;return!((g=this._pasteAsActionContext)===null||g===void 0)&&g.preferredId&&this._pasteAsActionContext.preferredId!==f.id?!1:(p=f.pasteMimeTypes)===null||p===void 0?void 0:p.some(m=>hLe(m,d))});if(!h.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferredId&&this.showPasteAsNoEditMessage(l,(s=this._pasteAsActionContext)===null||s===void 0?void 0:s.preferredId);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,h,l,u,c,{trigger:"explicit",only:this._pasteAsActionContext.preferredId}):this.doPasteInline(h,l,u,c,{trigger:"implicit"})}showPasteAsNoEditMessage(e,t){var n;(n=Da.get(this._editor))===null||n===void 0||n.showMessage(w("pasteAsError","No paste edits for '{0}' found",t),e[0].getStartPosition())}doPasteInline(e,t,n,r,o){const s=No(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new c_(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,r,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>pde(f,n));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}const h=await this.getPasteEdits(d,n,c,t,o,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}if(h.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},f,u.token)}await this.applyDefaultPasteHandler(n,r,u.token)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,o,s){const a=No(async l=>{const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new c_(c,3,void 0,l);try{if(await this.mergeInDataFromCopy(r,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(m=>pde(m,r));e&&(h=h.filter(m=>m.id===e));const f=await this.getPasteEdits(h,r,u,n,s,d.token);if(d.token.isCancellationRequested)return;if(!f.length){s.only&&this.showPasteAsNoEditMessage(n,s.only);return}let g;if(e)g=f.at(0);else{const m=await this._quickInputService.pick(f.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});g=m==null?void 0:m.edit}if(!g)return;const p=vLe(u.uri,n,g);await this._bulkEditService.apply(p,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,t){e.setData(F7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(F7);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=Tz.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n){var r;if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=await this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(wr.uriList)){const o=await this._clipboardService.readResources();if(n.isCancellationRequested)return;o.length&&e.append(wr.uriList,EQ(N5.create(o)))}}async getPasteEdits(e,t,n,r,o,s){const a=await gT(Promise.all(e.map(async c=>{var u;try{const d=await((u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,n,r,t,o,s));if(d)return{...d,providerId:c.id}}catch(d){console.error(d)}})),s),l=hh(a??[]);return _Le(l)}async applyDefaultPasteHandler(e,t,n){var r,o,s;const a=(r=e.get(wr.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=await a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)}};Hp.ID="editor.contrib.copyPasteActionController";Hp=Nj=cxt([S1(1,Wt),S1(2,NT),S1(3,Zp),S1(4,yt),S1(5,Ph),S1(6,lSe)],Hp);function pde(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}const Jb="9_cutcopypaste",uxt=nh||document.queryCommandSupported("cut"),wLe=nh||document.queryCommandSupported("copy"),dxt=typeof navigator.clipboard>"u"||lu?document.queryCommandSupported("paste"):!0;function IQ(i){return i.register(),i}const hxt=uxt?IQ(new jS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:nh?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:H.EditorContext,group:Jb,title:w("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:H.SimpleEditorContext,group:Jb,title:w("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1}]})):void 0,fxt=wLe?IQ(new jS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:nh?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:H.EditorContext,group:Jb,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:H.SimpleEditorContext,group:Jb,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ns.appendMenuItem(H.MenubarEditMenu,{submenu:H.MenubarCopy,title:Hn("copy as","Copy As"),group:"2_ccp",order:3});ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextCopy,title:Hn("copy as","Copy As"),group:Jb,order:3});ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextShare,title:Hn("share","Share"),group:"11_share",order:-1,when:Re.and(Re.notEquals("resourceScheme","output"),K.editorTextFocus)});ns.appendMenuItem(H.EditorTitleContext,{submenu:H.EditorTitleContextShare,title:Hn("share","Share"),group:"11_share",order:-1});ns.appendMenuItem(H.ExplorerContext,{submenu:H.ExplorerContextShare,title:Hn("share","Share"),group:"11_share",order:-1});const B7=dxt?IQ(new jS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:nh?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:H.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:H.EditorContext,group:Jb,title:w("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4},{menuId:H.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:H.SimpleEditorContext,group:Jb,title:w("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4}]})):void 0;class gxt extends pt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(Iz.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Iz.forceCopyWithSyntaxHighlighting=!1)}}function SLe(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const r=t.get(jn).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(zS().execCommand(e),!0)))}SLe(hxt,"cut");SLe(fxt,"copy");B7&&(B7.addImplementation(1e4,"code-editor",(i,e)=>{var t,n;const r=i.get(jn),o=i.get(Zp),s=r.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?(n=(t=Hp.get(s))===null||t===void 0?void 0:t.finishedPaste())!==null&&n!==void 0?n:Promise.resolve():k_?(async()=>{const l=await o.readText();if(l!==""){const c=EI.INSTANCE.get(l);let u=!1,d=null,h=null;c&&(u=s.getOption(37)&&!!c.isFromEmptySelection,d=typeof c.multicursorText<"u"?c.multicursorText:null,h=c.mode),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:u,multicursorText:d,mode:h})}})():!0:!1}),B7.addImplementation(0,"generic-dom",(i,e)=>(zS().execCommand("paste"),!0)));wLe&&Ke(gxt);class qt{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+qt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new qt(this.value+qt.sep+e)}}qt.sep=".";qt.None=new qt("@@none@@");qt.Empty=new qt("");qt.QuickFix=new qt("quickfix");qt.Refactor=new qt("refactor");qt.RefactorExtract=qt.Refactor.append("extract");qt.RefactorInline=qt.Refactor.append("inline");qt.RefactorMove=qt.Refactor.append("move");qt.RefactorRewrite=qt.Refactor.append("rewrite");qt.Notebook=new qt("notebook");qt.Source=new qt("source");qt.SourceOrganizeImports=qt.Source.append("organizeImports");qt.SourceFixAll=qt.Source.append("fixAll");qt.SurroundWith=qt.Refactor.append("surround");var Al;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(Al||(Al={}));function pxt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>xLe(e,t,i.include))||!i.includeSourceActions&&qt.Source.contains(e))}function mxt(i,e){const t=e.kind?new qt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>xLe(t,n,i.include))||!i.includeSourceActions&&t&&qt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function xLe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class yf{static fromUser(e,t){return!e||typeof e!="object"?new yf(t.kind,t.apply,!1):new yf(yf.getKindFromUser(e,t.kind),yf.getApplyFromUser(e,t.apply),yf.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 qt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class vxt{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(r){eo(r)}n&&(this.action.edit=n.edit)}return this}}const LLe="editor.action.codeAction",kQ="editor.action.quickFix",ELe="editor.action.autoFix",DLe="editor.action.refactor",ILe="editor.action.sourceAction",TQ="editor.action.organizeImports",NQ="editor.action.fixAll";class oD extends me{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:Ms(e.diagnostics)?Ms(t.diagnostics)?oD.codeActionsPreferredComparator(e,t):-1:Ms(t.diagnostics)?1:oD.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(oD.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&qt.QuickFix.contains(new qt(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 mde={actions:[],documentation:void 0};async function sD(i,e,t,n,r,o){var s;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],qt.Notebook]},c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new bQ(e,o),d=n.type===2,h=_xt(i,e,d?l:a),f=new Fe,g=h.map(async m=>{try{r.report(m);const v=await m.provideCodeActions(e,t,c,u.token);if(v&&f.add(v),u.token.isCancellationRequested)return mde;const _=((v==null?void 0:v.actions)||[]).filter(S=>S&&mxt(a,S)),y=Cxt(m,_,a.include);return{actions:_.map(S=>new vxt(S,m)),documentation:y}}catch(v){if(Th(v))throw v;return eo(v),mde}}),p=i.onDidChange(()=>{const m=i.all(e);lr(m,h)||u.cancel()});try{const m=await Promise.all(g),v=m.map(y=>y.actions).flat(),_=[...hh(m.map(y=>y.documentation)),...bxt(i,e,n,v)];return new oD(v,_,f)}finally{p.dispose(),u.dispose()}}function _xt(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(r=>pxt(t,new qt(r))):!0)}function*bxt(i,e,t,n){var r,o,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Cxt(i,e,t){if(!i.documentation)return;const n=i.documentation.map(r=>({kind:new qt(r.kind),command:r.command}));if(t){let r;for(const o of n)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of n)if(o.kind.contains(new qt(r.kind)))return o.command}}var vw;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions",i.FromAILightbulb="fromAILightbulb"})(vw||(vw={}));async function yxt(i,e,t,n,r=wn.None){var o;const s=i.get(NT),a=i.get(cr),l=i.get(ia),c=i.get(zr);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==vw.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=wxt(u);c.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function wxt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}kn.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,r){if(!(e instanceof Ft))throw iu();const{codeActionProvider:o}=i.get(yt),s=i.get(or).getModel(e);if(!s)throw iu();const a=Et.isISelection(t)?Et.liftSelection(t):W.isIRange(t)?s.validateRange(t):void 0;if(!a)throw iu();const l=typeof n=="string"?new qt(n):void 0,c=await sD(o,s,a,{type:1,triggerAction:Al.Default,filter:{includeSourceActions:!0,include:l}},yp.None,wn.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}});var Sxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rj;let lF=Rj=class{constructor(e){this.keybindingService=e}getResolver(){const e=new tg(()=>this.keybindingService.getKeybindings().filter(t=>Rj.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===TQ?n={kind:qt.SourceOrganizeImports.value}:t.command===NQ&&(n={kind:qt.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...yf.fromUser(n,{kind:qt.None,apply:"never"})}}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new qt(e.kind);return t.filter(r=>r.kind.contains(n)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};lF.codeActionCommands=[DLe,LLe,ILe,TQ,NQ];lF=Rj=Sxt([xxt(0,ci)],lF);X("symbolIcon.arrayForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.booleanForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.colorForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constantForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fileForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.folderForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keyForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keywordForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.moduleForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.namespaceForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.nullForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.numberForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.objectForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.operatorForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.packageForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.propertyForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.referenceForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.snippetForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.stringForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.structForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.textForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.typeParameterForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.unitForeground",{dark:et,light:et,hcDark:et,hcLight:et},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const kLe=Object.freeze({kind:qt.Empty,title:w("codeAction.widget.id.more","More Actions...")}),Lxt=Object.freeze([{kind:qt.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix")},{kind:qt.RefactorExtract,title:w("codeAction.widget.id.extract","Extract"),icon:tt.wrench},{kind:qt.RefactorInline,title:w("codeAction.widget.id.inline","Inline"),icon:tt.wrench},{kind:qt.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite"),icon:tt.wrench},{kind:qt.RefactorMove,title:w("codeAction.widget.id.move","Move"),icon:tt.wrench},{kind:qt.SurroundWith,title:w("codeAction.widget.id.surround","Surround With"),icon:tt.surroundWith},{kind:qt.Source,title:w("codeAction.widget.id.source","Source Action"),icon:tt.symbolFile},kLe]);function Ext(i,e,t){if(!e)return i.map(o=>{var s;return{kind:"action",item:o,group:kLe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const n=Lxt.map(o=>({group:o,actions:[]}));for(const o of i){const s=o.action.kind?new qt(o.action.kind):qt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of n)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions){const a=o.group;r.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:tt.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return r}var Dxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mj,ky;(function(i){i.Hidden={type:0};class e{constructor(n,r,o,s){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}i.Showing=e})(ky||(ky={}));let eC=Mj=class extends me{constructor(e,t,n){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new ae),this.onClick=this._onClick.event,this._state=ky.Hidden,this._iconClasses=[],this._domNode=Xe("div.lightBulbWidget"),this._register(Li.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(bot(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=Hr(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(ot.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o,s,a;this._preferredKbLabel=(o=(r=this._keybindingService.lookupKeybinding(ELe))===null||r===void 0?void 0:r.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(s=this._keybindingService.lookupKeybinding(kQ))===null||s===void 0?void 0:s.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(n),l=o.getOptions().tabSize,c=this._editor.getOptions().get(50),u=o.getLineContent(s),d=$3(u,l),h=c.spaceWidth*d>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s,p=1;if(!h){if(s>1&&!f(s-1))g-=1;else if(s=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pj=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const NLe="acceptSelectedCodeAction",RLe="previewSelectedCodeAction";class Ixt{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,n){var r,o;n.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Aj=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 n=document.createElement("span");n.className="title",e.append(n);const r=new ex(e,Ll);return{container:e,icon:t,text:n,keybinding:r}}renderElement(e,t,n){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(n.icon.className=Vt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ft(e.group.icon.color.id))):(n.icon.className=Vt.asClassName(tt.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=MLe(e.label),n.keybinding.set(e.keybinding),Pot(!!e.keybinding,n.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(NLe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(RLe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};Aj=TLe([Pj(1,ci)],Aj);class kxt extends UIEvent{constructor(){super("acceptSelectedAction")}}class _de extends UIEvent{constructor(){super("previewSelectedAction")}}function Txt(i){if(i.kind==="action")return i.label}let Oj=class extends me{constructor(e,t,n,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new xr),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 Ec(e,this.domNode,a,[new Aj(t,this._keybindingService),new Ixt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Txt},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?MLe(l==null?void 0:l.label):"";return l.disabled&&(c=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(F_),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=n,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 o=e;if(this._allMenuItems.length>=50)o=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 h=d.getBoundingClientRect().width;return d.style.width="",h}return 0});o=Math.max(...l,e)}const s=.7,a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*s);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}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 n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;const o=e?new _de:new kxt;this._list.setSelection([n],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof _de):this._list.setSelection([])}onFocus(){var e,t;const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.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 n=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};Oj=TLe([Pj(4,og),Pj(5,ci)],Oj);function MLe(i){return i.replace(/\r\n|\r|\n/g," ")}var Nxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};X("actionBar.toggledBackground",{dark:q0,light:q0,hcDark:q0,hcLight:q0},w("actionBar.toggledBackground","Background color for toggled action items in action bar."));const tC={Visible:new ct("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},kC=Sn("actionWidgetService");let nC=class extends me{get isVisible(){return tC.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Vo)}show(e,t,n,r,o,s,a){const l=tC.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Oj,e,t,n,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Fe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(xe(l,Je.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(xe(u,Je.POINTER_MOVE,()=>u.remove())),s.add(xe(u,Je.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(ph(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=Xe(e),r=new du(n);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};nC=Nxt([W7(0,og),W7(1,Gt),W7(2,Wt)],nC);Tn(kC,nC,1);const jT=100+1e3;ki(class extends dl{constructor(){super({id:"hideCodeActionWidget",title:Hn("hideCodeActionWidget.title","Hide action widget"),precondition:tC.Visible,keybinding:{weight:jT,primary:9,secondary:[1033]}})}run(i){i.get(kC).hide()}});ki(class extends dl{constructor(){super({id:"selectPrevCodeAction",title:Hn("selectPrevCodeAction.title","Select previous action"),precondition:tC.Visible,keybinding:{weight:jT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(kC);e instanceof nC&&e.focusPrevious()}});ki(class extends dl{constructor(){super({id:"selectNextCodeAction",title:Hn("selectNextCodeAction.title","Select next action"),precondition:tC.Visible,keybinding:{weight:jT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(kC);e instanceof nC&&e.focusNext()}});ki(class extends dl{constructor(){super({id:NLe,title:Hn("acceptSelected.title","Accept selected action"),precondition:tC.Visible,keybinding:{weight:jT,primary:3,secondary:[2137]}})}run(i){const e=i.get(kC);e instanceof nC&&e.acceptSelected()}});ki(class extends dl{constructor(){super({id:RLe,title:Hn("previewSelected.title","Preview selected action"),precondition:tC.Visible,keybinding:{weight:jT,primary:2051}})}run(i){const e=i.get(kC);e instanceof nC&&e.acceptSelected(!0)}});const PLe=new ct("supportedCodeAction",""),bde="_typescript.applyFixAllCodeAction";class Rxt extends me{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new gd),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(n=>sZ(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Al.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const n=this._editor.getOption(65).enabled;if(n!==$u.Off){{if(n===$u.On)return t;if(n===$u.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),l=o.getLineContent(s);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(s)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var O0;(function(i){i.Empty={type:0};class e{constructor(n,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(Th(s))return ALe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(O0||(O0={}));const ALe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Mxt extends me{constructor(e,t,n,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Vo),this._state=O0.Empty,this._onDidChangeState=this._register(new ae),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=PLe.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(a=>{a.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(O0.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(O0.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(n=>{var r;return(r=n.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Rxt(this._editor,this._markerService,n=>{var r;if(!n){this.setState(O0.Empty);return}const o=n.selection.getStartPosition(),s=No(async a=>{var l,c,u,d,h,f,g,p,m,v;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Al.QuickFix||!((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(qt.QuickFix))){const _=await sD(this._registry,e,n.selection,n.trigger,yp.None,a),y=[..._.allActions];if(a.isCancellationRequested)return ALe;const S=(u=_.validActions)===null||u===void 0?void 0:u.some(E=>E.action.kind?qt.QuickFix.contains(new qt(E.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(S){for(const E of _.validActions)!((h=(d=E.action.command)===null||d===void 0?void 0:d.arguments)===null||h===void 0)&&h.some(D=>typeof D=="string"&&D.includes(bde))&&(E.action.diagnostics=[...L.filter(D=>D.relatedInformation)]);return{validActions:_.validActions,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}else if(!S&&L.length>0){const E=n.selection.getPosition();let D=E,k=Number.MAX_VALUE;const T=[..._.validActions];for(const P of L){const N=P.endColumn,R=P.endLineNumber,O=P.startLineNumber;if(R===E.lineNumber||O===E.lineNumber){D=new le(R,N);const B={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((f=n.trigger.filter)===null||f===void 0)&&f.include?(g=n.trigger.filter)===null||g===void 0?void 0:g.include:qt.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((p=n.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:D}},$=new Et(D.lineNumber,D.column,D.lineNumber,D.column),G=await sD(this._registry,e,$,B,yp.None,a);if(G.validActions.length!==0){for(const U of G.validActions)!((v=(m=U.action.command)===null||m===void 0?void 0:m.arguments)===null||v===void 0)&&v.some(j=>typeof j=="string"&&j.includes(bde))&&(U.action.diagnostics=[...L.filter(j=>j.relatedInformation)]);_.allActions.length===0&&y.push(...G.allActions),Math.abs(E.column-N)R.findIndex(O=>O.action.title===P.action.title)===N);return M.sort((P,N)=>P.action.isPreferred&&!N.action.isPreferred?-1:!P.action.isPreferred&&N.action.isPreferred||P.action.isAI&&!N.action.isAI?1:!P.action.isAI&&N.action.isAI?-1:0),{validActions:M,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}}return sD(this._registry,e,n.selection,n.trigger,yp.None,a)});n.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new O0.Triggered(n.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Al.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Pxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},H1;const Axt="quickfix-edit-highlight";let u_=H1=class extends me{static get(e){return e.getContribution(H1.ID)}constructor(e,t,n,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Vo),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Mxt(this._editor,o.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new tg(()=>{const d=this._editor.getContribution(eC.ID);return d&&this._register(d.onClick(h=>this.showCodeActionsFromLightbulb(h.actions,h))),d}),this._resolver=r.createInstance(lF),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 n=e.validActions[0],r=n.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(n,!1,!1,vw.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){var o;if(!this._editor.hasModel())return;(o=Da.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,n,r){try{await this._instantiationService.invokeFunction(yxt,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Al.QuickFix,filter:{}})}}async update(e){var t,n,r,o,s,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=await e.actions}catch(u){nn(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(d,!1,!1,vw.FromCodeActions)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=Da.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=Da.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.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,n){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=le.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,vw.FromCodeActions),this._actionWidgetService.hide(),r.clear()},onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:async(c,u)=>{var d;if(!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const h=c.action.ranges,f=c.action.diagnostics;if(r.clear(),h&&h.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:H1.DECORATION})):h.map(p=>({range:p,options:H1.DECORATION}));r.set(g)}else if(f&&f.length>0){const g=f.map(m=>({range:m,options:H1.DECORATION}));r.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const m=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||d===void 0?void 0:d.word;jf(w("editingNewSelection","Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Ext(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=Hr(this._editor.getDomNode()),r=n.left+t.left,o=n.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};u_.ID="editor.contrib.codeActionController";u_.DECORATION=an.register({description:"quickfix-highlight",className:Axt});u_=H1=Pxt([xg(1,sg),xg(2,Gt),xg(3,Wt),xg(4,yt),xg(5,A_),xg(6,cr),xg(7,mn),xg(8,kC),xg(9,Wt)],u_);vu((i,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(sp));const n=i.getColor(tv);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${sh(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function KT(i){return Re.regex(PLe.keys()[0],new RegExp("(\\s|^)"+vc(i.value)+"\\b"))}const RQ={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function TC(i,e,t,n,r=Al.Default){if(i.hasModel()){const o=u_.get(i);o==null||o.manualTriggerAtCurrentPosition(e,r,t,n)}}class Oxt extends pt{constructor(){super({id:kQ,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),kbOpts:{kbExpr:K.textInputFocus,primary:2137,weight:100}})}run(e,t){return TC(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Al.QuickFix)}}class Fxt extends zo{constructor(){super({id:LLe,precondition:Re.and(K.writable,K.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:RQ}]}})}runEditorCommand(e,t,n){const r=yf.fromUser(n,{kind:qt.Empty,apply:"ifSingle"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class Bxt extends pt{constructor(){super({id:DLe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),kbOpts:{kbExpr:K.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Re.and(K.writable,KT(qt.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:RQ}]}})}run(e,t,n){const r=yf.fromUser(n,{kind:qt.Refactor,apply:"never"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:qt.Refactor.contains(r.kind)?r.kind:qt.None,onlyIncludePreferredActions:r.preferred},r.apply,Al.Refactor)}}class Wxt extends pt{constructor(){super({id:ILe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:Re.and(K.writable,K.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Re.and(K.writable,KT(qt.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:RQ}]}})}run(e,t,n){const r=yf.fromUser(n,{kind:qt.Source,apply:"never"});return TC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:qt.Source.contains(r.kind)?r.kind:qt.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Al.SourceAction)}}class $xt extends pt{constructor(){super({id:TQ,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Re.and(K.writable,KT(qt.SourceOrganizeImports)),kbOpts:{kbExpr:K.textInputFocus,primary:1581,weight:100}})}run(e,t){return TC(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:qt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Al.OrganizeImports)}}class Hxt extends pt{constructor(){super({id:NQ,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:Re.and(K.writable,KT(qt.SourceFixAll))})}run(e,t){return TC(t,w("fixAll.noneMessage","No fix all action available"),{include:qt.SourceFixAll,includeSourceActions:!0},"ifSingle",Al.FixAll)}}class Vxt extends pt{constructor(){super({id:ELe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Re.and(K.writable,KT(qt.QuickFix)),kbOpts:{kbExpr:K.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return TC(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:qt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Al.AutoFix)}}Kn(u_.ID,u_,3);Kn(eC.ID,eC,4);Ke(Oxt);Ke(Bxt);Ke(Wxt);Ke($xt);Ke(Vxt);Ke(Hxt);st(new Fxt);ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:w("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class Fj{constructor(){this.lenses=[],this._disposables=new Fe}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function OLe(i,e,t){const n=i.ordered(e),r=new Map,o=new Fj,s=n.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){eo(c)}});return await Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o}kn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Yn(Ft.isUri(t)),Yn(typeof n=="number"||!n);const{codeLensProvider:r}=i.get(yt),o=i.get(or).getModel(t);if(!o)throw iu();const s=[],a=new Fe;return OLe(r,o,wn.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||u.symbol.command?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,wn.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Uxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const FLe=Sn("ICodeLensCache");class Cde{constructor(e,t){this.lineCount=e,this.data=t}}let Bj=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new R_(20,.75);const t="codelens/cache";HL(hi,()=>e.remove(t,1));const n="codelens/cache2",r=e.get(n,1,"{}");this._deserialize(r),ot.once(e.onWillSaveState)(o=>{o.reason===UI.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new Fj;r.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new Cde(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,n]of this._cache){const r=new Set;for(const o of n.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const r=t[n],o=[];for(const a of r.lines)o.push({range:new W(a,1,a,11)});const s=new Fj;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(n,new Cde(r.lineCount,s))}}catch{}}};Bj=zxt([Uxt(0,md)],Bj);Tn(FLe,Bj,1);class jxt{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class uk{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${uk._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let r=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:yde},d=>this._decorationIds[u]=d),a?a=W.plusRange(a,c.symbol.range):a=W.lift(c.symbol.range)}),this._viewZone=new jxt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new uk(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 n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&W.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,r)=>{t.addDecoration({range:n.symbol.range,options:yde},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let bS=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new Fe,this._localToDispose=new Fe,this._lenses=[],this._oldCodeLensModels=new Fe,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new mi(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(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(),n=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),n&&(o.setProperty("--vscode-editorCodeLens-fontFamily",n),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",il.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.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&&Qv(()=>{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 o=r.onDidChange(()=>n.schedule());this._localToDispose.add(o)}const n=new mi(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=No(s=>OLe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},nn)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Ot(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new $7;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.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(Ot(()=>{if(this._editor.getModel()){const r=wh.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new $7;for(const r of this._lenses)r.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];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],n.push(r)))}if(!n.length&&!this._lenses.length)return;const o=wh.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new $7;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),r.push(a))}),n.length===0)return;const o=Date.now(),s=No(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},eo):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{nn(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};bS.ID="css.editor.codeLens";bS=Kxt([CL(1,yt),CL(2,_u),CL(3,cr),CL(4,zr),CL(5,FLe)],bS);Kn(bS.ID,bS,1);Ke(class extends pt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:K.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const n=e.get(Ph),r=e.get(cr),o=e.get(zr),s=t.getSelection().positionLineNumber,a=t.getContribution(bS.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=await n.pick(c,{canPickMany:!1,placeHolder:w("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=await a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}}});var Gxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},H7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class MQ{constructor(e,t){this._editorWorkerClient=new OY(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const r=t.range,o=t.color,s=o.alpha,a=new Ce(new Rn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?Ce.Format.CSS.formatRGB(a):Ce.Format.CSS.formatRGBA(a),c=s?Ce.Format.CSS.formatHSL(a):Ce.Format.CSS.formatHSLA(a),u=s?Ce.Format.CSS.formatHex(a):Ce.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Wj=class extends me{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new MQ(e,t)))}};Wj=Gxt([H7(0,or),H7(1,Ti),H7(2,yt)],Wj);BT(Wj);async function BLe(i,e,t,n=!0){return PQ(new qxt,i,e,t,n)}function WLe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class qxt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)}}class Xxt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}}class Yxt{constructor(e){this.colorInfo=e}async compute(e,t,n,r){const o=await e.provideColorPresentations(t,this.colorInfo,wn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)}}async function PQ(i,e,t,n,r){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof MQ)s=u;else try{await i.compute(u,t,n,a)&&(o=!0)}catch(d){eo(d)}}return o?a:s&&r?(await i.compute(s,t,n,a),a):[]}function $Le(i,e){const{colorProvider:t}=i.get(yt),n=i.get(or).getModel(e);if(!n)throw iu();const r=i.get(mn).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}kn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Ft))throw iu();const{model:n,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=$Le(i,t);return PQ(new Xxt,r,n,wn.None,o)});kn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:r,range:o}=n;if(!(r instanceof Ft)||!Array.isArray(t)||t.length!==4||!W.isIRange(o))throw iu();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=$Le(i,r),[c,u,d,h]=t;return PQ(new Yxt({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,wn.None,l)});var Zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},V7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$j;const HLe=Object.create({});let d_=$j=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Fe),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new yT(this._editor),this._decoratorLimitReporter=new Qxt,this._colorDecorationClassRefs=this._register(new Fe),this._debounceInformation=r.for(n.colorProvider,"Document Colors",{min:$j.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(146);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const r=n.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 gd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=No(async e=>{const t=this._editor.getModel();if(!t)return[];const n=new Fs(!1),r=await BLe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){nn(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:an.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(r.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};d_.ID="editor.contrib.colorDetector";d_.RECOMPUTE_TIME=1e3;d_=$j=Zxt([V7(1,mn),V7(2,yt),V7(3,_u)],d_);class Qxt{constructor(){this._onDidChange=new ae,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Kn(d_.ID,d_,1);class Jxt{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,n){this.presentationIndex=n,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new ae,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new ae,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 n=-1;for(let r=0;r{this.backgroundColor=s.getColor(eO)||Ce.white})),this._register(xe(this._pickedColorNode,Je.CLICK,()=>this.model.selectNextColorPresentation())),this._register(xe(this._originalColorNode,Je.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=Ce.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 tLt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Ce.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 tLt extends me{constructor(e){super(),this._onClicked=this._register(new ae),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Oe(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Oe(this._button,t),Oe(t,cc(".button"+Vt.asCSSSelector(Or("color-picker-close",tt.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(xe(this._button,Je.CLICK,()=>{this._onClicked.fire()}))}}class nLt extends me{constructor(e,t,n,r=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=cc(".colorpicker-body"),Oe(e,this._domNode),this._saturationBox=new iLt(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 rLt(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 oLt(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 sLt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new Ce(new Sf(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Ce(new Sf(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new Ce(new Sf(n===360?0:n,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 iLt extends me{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,this._domNode=cc(".saturation-wrap"),Oe(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Oe(this._domNode,this._canvas),this.selection=cc(".saturation-selection"),Oe(this._domNode,this.selection),this.layout(),this._register(xe(this._domNode,Je.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 qS);const t=Hr(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 n=xe(e.target.ownerDocument,Je.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,r),this._onDidChange.fire({s:n,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 Ce(new Sf(e.h,1,1,1)),n=this._canvas.getContext("2d"),r=n.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=Ce.Format.CSS.format(t),n.fill(),n.fillStyle=r,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class VLe extends me{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Oe(e,cc(".standalone-strip")),this.overlay=Oe(this.domNode,cc(".standalone-overlay"))):(this.domNode=Oe(e,cc(".strip")),this.overlay=Oe(this.domNode,cc(".overlay"))),this.slider=Oe(this.domNode,cc(".slider")),this.slider.style.top="0px",this._register(xe(this.domNode,Je.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 qS),n=Hr(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-n.top),()=>null);const r=xe(e.target.ownerDocument,Je.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 rLt extends VLe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:r}=e.rgba,o=new Ce(new Rn(t,n,r,1)),s=new Ce(new Rn(t,n,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class oLt extends VLe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class sLt extends me{constructor(e){super(),this._onClicked=this._register(new ae),this.onClicked=this._onClicked.event,this._button=Oe(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(xe(this._button,Je.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class aLt extends Lc{constructor(e,t,n,r,o=!1){super(),this.model=t,this.pixelRatio=n,this._register(cI.getInstance(Bt(e)).onDidChange(()=>this.layout()));const s=cc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new eLt(s,this.model,r,o)),this.body=this._register(new nLt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var zLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ULe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class lLt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,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 cF=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Xr.fromPromise(this._computeAsync(e,t,n))}async _computeAsync(e,t,n){if(!this._editor.hasModel())return[];const r=d_.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[await jLe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(e,t){return KLe(this,this._editor,this._themeService,t,e)}};cF=zLe([ULe(1,Mo)],cF);class cLt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r}}let dk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,n){if(!this._editor.hasModel()||!d_.get(this._editor))return null;const o=await BLe(n,this._editor.getModel(),wn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;W.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:await jLe(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let n=new W(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await cP(this._editor.getModel(),t,this._color,n,e),n=GLe(this._editor,n,t))}renderHoverParts(e,t){return KLe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};dk=zLe([ULe(1,Mo)],dk);async function jLe(i,e,t,n){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Rn(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new Ce(c),d=await WLe(e,t,n,wn.None),h=new Jxt(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),i instanceof cF?new lLt(i,W.lift(t.range),h,n):new cLt(i,W.lift(t.range),h,n)}function KLe(i,e,t,n,r){if(n.length===0||!e.hasModel())return me.None;if(r.setMinimumDimensions){const h=e.getOption(67)+8;r.setMinimumDimensions(new Gn(302,h))}const o=new Fe,s=n[0],a=e.getModel(),l=s.model,c=o.add(new aLt(r.fragment,l,e.getOption(142),t,i instanceof dk));r.setColorPicker(c);let u=!1,d=new W(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof dk){const h=n[0].model.color;i.color=h,cP(a,l,h,d,s),o.add(l.onColorFlushed(f=>{i.color=f}))}else o.add(l.onColorFlushed(async h=>{await cP(a,l,h,d,s),u=!0,d=GLe(e,d,l)}));return o.add(l.onDidChangeColor(h=>{cP(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function GLe(i,e,t){var n,r;const o=[],s=(n=t.presentation.textEdit)!==null&&n!==void 0?n:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(s),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=W.lift(s.range),l=i.getModel()._setTrackedRange(null,a,3);return i.executeEdits("colorpicker",o),i.pushUndoStop(),(r=i.getModel()._getTrackedRange(l))!==null&&r!==void 0?r:a}async function cP(i,e,t,n,r){const o=await WLe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,wn.None);e.colorPresentations=o||[]}function Hj(i,e){return!!i[e]}class z7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Hj(e.event,t.triggerModifier),this.hasSideBySideModifier=Hj(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Sde{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Hj(e,t.triggerModifier)}}class N2{constructor(e,t,n,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function xde(i){return i==="altKey"?Dn?new N2(57,"metaKey",6,"altKey"):new N2(5,"ctrlKey",6,"altKey"):Dn?new N2(6,"altKey",57,"metaKey"):new N2(6,"altKey",5,"ctrlKey")}class M5 extends me{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new ae),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new ae),this.onExecute=this._onExecute.event,this._onCancel=this._register(new ae),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:r=>r.target.position?r.target.position.lineNumber:0,this._opts=xde(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(78)){const o=xde(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new z7(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new z7(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new z7(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new Sde(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new Sde(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var uLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let h_=class extends sS{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},n,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){i3(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};h_=uLt([Lg(4,Wt),Lg(5,jn),Lg(6,cr),Lg(7,Gt),Lg(8,Mo),Lg(9,zr),Lg(10,pd),Lg(11,Ti),Lg(12,yt)],h_);const Lde=new Ce(new Rn(0,122,204)),dLt={showArrow:!0,showFrame:!0,className:"",frameColor:Lde,arrowColor:Lde,keepEditorSelection:!1},hLt="vs.editor.contrib.zoneWidget";class fLt{constructor(e,t,n,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class gLt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class P5{constructor(e){this._editor=e,this._ruleName=P5._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),rz(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(){rz(this._ruleName),zA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:W.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}P5._IdGenerator=new MZ(".arrow-decoration-");class pLt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Fe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Fg(t),i3(this.options,dLt,!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(n=>{const r=this._getWidth(n);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(n)+"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 P5(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 n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const r=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=W.isIRange(e)?W.lift(e):W.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:an.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new fLt(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new gLt(hLt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new W(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Is(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 n=(t.currentY-e.startY)/this.editor.getOption(67),r=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var qLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XLe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const YLe=Sn("IPeekViewService");Tn(YLe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const r=this._widgets.get(i);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var al;(function(i){i.inPeekEditor=new ct("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(al||(al={}));let hk=class{constructor(e,t){e instanceof h_&&al.inPeekEditor.bindTo(t)}dispose(){}};hk.ID="editor.contrib.referenceController";hk=qLe([XLe(1,Gt)],hk);Kn(hk.ID,hk,0);function mLt(i){const e=i.get(jn).getFocusedCodeEditor();return e instanceof h_?e.getParentEditor():e}const vLt={headerBackgroundColor:Ce.white,primaryHeadingColor:Ce.fromHex("#333333"),secondaryHeadingColor:Ce.fromHex("#6c6c6cb3")};let uF=class extends pLt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new ae,this.onDidClose=this._onDidClose.event,i3(this.options,vLt,!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=Xe(".head"),this._bodyElement=Xe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=Xe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Lr(this._titleElement,"click",o=>this._onTitleClick(o))),Oe(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=Xe("span.filename"),this._secondaryHeading=Xe("span.dirname"),this._metaHeading=Xe("span.meta"),Oe(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=Xe(".peekview-actions");Oe(this._headElement,n);const r=this._getActionBarOptions();this._actionbarWidget=new du(n,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Il("peekview.close",w("label.close","Close"),Vt.asClassName(tt.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:ySe.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:Ps(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Sl(this._metaHeading)):pa(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(67)*1.2),r=Math.round(e-(n+2));this._doLayoutHead(n,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`)}};uF=qLe([XLe(2,Wt)],uF);const _Lt=X("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ce.black,hcLight:Ce.white},w("peekViewTitleBackground","Background color of the peek view title area.")),ZLe=X("peekViewTitleLabel.foreground",{dark:Ce.white,light:Ce.black,hcDark:Ce.white,hcLight:Xu},w("peekViewTitleForeground","Color of the peek view title.")),QLe=X("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),bLt=X("peekView.border",{dark:tl,light:tl,hcDark:Ln,hcLight:Ln},w("peekViewBorder","Color of the peek view borders and arrow.")),CLt=X("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ce.black,hcLight:Ce.white},w("peekViewResultsBackground","Background color of the peek view result list."));X("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));X("peekViewResult.fileForeground",{dark:Ce.white,light:"#1E1E1E",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));X("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));X("peekViewResult.selectionForeground",{dark:Ce.white,light:"#6C6C6C",hcDark:Ce.white,hcLight:Xu},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const lv=X("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Ce.black,hcLight:Ce.white},w("peekViewEditorBackground","Background color of the peek view editor."));X("peekViewEditorGutter.background",{dark:lv,light:lv,hcDark:lv,hcLight:lv},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));X("peekViewEditorStickyScroll.background",{dark:lv,light:lv,hcDark:lv,hcLight:lv},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));X("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));X("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));X("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ki,hcLight:Ki},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class f_{constructor(e,t,n,r){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=r,this.id=cU.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?w({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,uu(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",uu(this.uri),this.range.startLineNumber,this.range.startColumn)}}class yLt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:r,column:o-t}),c=new W(r,l.startColumn,r,o),u=new W(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class fk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Mr}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",uu(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,uu(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 n=await e.createModelReference(t.uri);this._previews.set(t.uri,new yLt(n))}catch(n){nn(n)}return this}}class Tl{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new ae,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(Tl._compareReferences);let r;for(const o of e)if((!r||!Gi.isEqual(r.uri,o.uri,!0))&&(r=new fk(this,o.uri),this.groups.push(r)),r.children.length===0||Tl._compareReferences(o,r.children[r.children.length-1])!==0){const s=new f_(n===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Tl(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let r=n.children.indexOf(e);const o=n.children.length,s=n.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%s,n.parent.groups[r].children[0]):(r=(r+s-1)%s,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))}nearestReference(e,t){const n=this.references.map((r,o)=>({idx:o,prefixLen:Xv(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&W.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Gi.compare(e.uri,t.uri)||W.compareRangesUsingStarts(e.range,t.range)}}var A5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},O5=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vj;let zj=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Tl||e instanceof fk}getChildren(e){if(e instanceof Tl)return e.groups;if(e instanceof fk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};zj=A5([O5(0,ul)],zj);class wLt{getHeight(){return 23}getTemplateId(e){return e instanceof fk?gk.id:GT.id}}let Uj=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof f_){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return uu(e.uri)}};Uj=A5([O5(0,ci)],Uj);class SLt{getId(e){return e instanceof f_?e.id:e.uri}}let jj=class extends me{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new KO(n,{supportHighlights:!0})),this.badge=new KU(Oe(n,Xe(".count")),{},bSe),e.appendChild(n)}set(e,t){const n=V3(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};jj=A5([O5(1,lS)],jj);let gk=Vj=class{constructor(e){this._instantiationService=e,this.templateId=Vj.id}renderTemplate(e){return this._instantiationService.createInstance(jj,e)}renderElement(e,t,n){n.set(e.element,TT(e.filterData))}disposeTemplate(e){e.dispose()}};gk.id="FileReferencesRenderer";gk=Vj=A5([O5(0,Wt)],gk);class xLt{constructor(e){this.label=new Mv(e)}set(e,t){var n;const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!r||!r.value)this.label.set(`${uu(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!ah.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,TT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class GT{constructor(){this.templateId=GT.id}renderTemplate(e){return new xLt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}GT.id="OneReferenceRenderer";class LLt{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var ELt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class F5{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Fe,this._callOnModelChange=new Fe,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=[],n=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(ILt,"ReferencesWidget",this._treeContainer,new wLt,[this._instantiationService.createInstance(gk),this._instantiationService.createInstance(GT)],this._instantiationService.createInstance(zj),n),this._splitView.addView({onDidChange:ot.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},$O.Distribute),this._splitView.addView({onDidChange:ot.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},$O.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof f_&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),pa(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Gn(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=w("noResults","No results"),Sl(this._messageContainer),Promise.resolve(void 0)):(pa(this._messageContainer),this._decorationsManager=new F5(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:n}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Sl(this._treeContainer),Sl(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 f_)return e;if(e instanceof fk&&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!==cn.inMemory?this.setTitle(jft(e.uri),this._uriLabel.getUriLabel(V3(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const n=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 n;if(!this._model){r.dispose();return}si(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=W.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};Kj=ELt([Eg(3,Mo),Eg(4,ul),Eg(5,Wt),Eg(6,YLe),Eg(7,lS),Eg(8,z3),Eg(9,ci),Eg(10,qi),Eg(11,Ti)],Kj);var kLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uP;const NC=new ct("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let g_=uP=class{static get(e){return e.getContribution(uP.ID)}constructor(e,t,n,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Fe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=NC.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=DLt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Kj,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new le(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).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 n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const r=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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 n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const r=W.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=uP.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,No(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,nn(o)})}openReference(e,t,n){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};g_.ID="editor.contrib.referencesController";g_=uP=kLt([x1(2,Gt),x1(3,jn),x1(4,zr),x1(5,Wt),x1(6,md),x1(7,mn)],g_);function RC(i,e){const t=mLt(i);if(!t)return;const n=g_.get(t);n&&e(n)}sl.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fo(2089,60),when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});sl.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.goToNextOrPreviousReference(!0)})}});sl.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Re.or(NC,al.inPeekEditor),handler(i){RC(i,e=>{e.goToNextOrPreviousReference(!1)})}});kn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");kn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");kn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");kn.registerCommand("closeReferenceSearch",i=>RC(i,e=>e.closeWidget()));sl.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Re.and(al.inPeekEditor,Re.not("config.editor.stablePeek"))});sl.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Re.and(NC,Re.not("config.editor.stablePeek"),Re.or(K.editorTextFocus,ybt.negate()))});sl.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Re.and(NC,HSe,JZ.negate(),eQ.negate()),handler(i){var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof f_&&RC(i,r=>r.revealReference(n[0]))}});sl.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Re.and(NC,HSe,JZ.negate(),eQ.negate()),handler(i){var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof f_&&RC(i,r=>r.openReference(n[0],!0,!0))}});kn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Cu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof f_&&RC(i,r=>r.openReference(n[0],!1,!0))});var JLe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const AQ=new ct("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),B5=Sn("ISymbolNavigationService");let Gj=class{constructor(e,t,n,r){this._editorService=t,this._notificationService=n,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=AQ.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new qj(this._editorService),r=n.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(sZ(d.uri,a.uri))c=!0,u=u||W.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=td(n,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:W.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Gj=JLe([oE(0,Gt),oE(1,jn),oE(2,zr),oE(3,ci)],Gj);Tn(B5,Gj,1);st(new class extends zo{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:AQ,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(B5).revealNext(e)}});sl.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:AQ,primary:9,handler(i){i.get(B5).reset()}});let qj=class{constructor(e){this._listener=new Map,this._disposables=new Fe,this._onDidChange=new ae,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,td(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};qj=JLe([oE(0,jn)],qj);async function qT(i,e,t,n){const o=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{eo(l)})),s=await Promise.all(o);return hh(s.flat())}function W5(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideDefinition(o,s,n))}function eEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideDeclaration(o,s,n))}function tEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideImplementation(o,s,n))}function nEe(i,e,t,n){return qT(e,t,i,(r,o,s)=>r.provideTypeDefinition(o,s,n))}function $5(i,e,t,n,r){return qT(e,t,i,async(o,s,a)=>{const l=await o.provideReferences(s,a,{includeDeclaration:!0},r);if(!n||!l||l.length!==2)return l;const c=await o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l})}async function XT(i){const e=await i(),t=new Tl(e,""),n=t.references.map(r=>r.link);return t.dispose(),n}rg("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(yt),r=W5(n.definitionProvider,e,t,wn.None);return XT(()=>r)});rg("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(yt),r=nEe(n.typeDefinitionProvider,e,t,wn.None);return XT(()=>r)});rg("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(yt),r=eEe(n.declarationProvider,e,t,wn.None);return XT(()=>r)});rg("_executeReferenceProvider",(i,e,t)=>{const n=i.get(yt),r=$5(n.referenceProvider,e,t,!1,wn.None);return XT(()=>r)});rg("_executeImplementationProvider",(i,e,t)=>{const n=i.get(yt),r=tEe(n.implementationProvider,e,t,wn.None);return XT(()=>r)});var yL,wL,SL,R2,M2,P2,A2,O2;ns.appendMenuItem(H.EditorContext,{submenu:H.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class CS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof CS||le.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Ys extends Nh{static all(){return Ys._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of In.wrap(t.menu))(n.id===H.EditorContext||n.id===H.EditorContextPeek)&&(n.when=Re.and(e.precondition,n.when));return t}constructor(e,t){super(Ys._patchConfig(t)),this.configuration=e,Ys._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(zr),s=e.get(jn),a=e.get(A_),l=e.get(B5),c=e.get(yt),u=e.get(Wt),d=t.getModel(),h=t.getPosition(),f=CS.is(n)?n:new CS(d,h),g=new c_(t,5),p=gT(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async m=>{var v;if(!m||g.token.isCancellationRequested)return;Pl(m.ariaMessage);let _;if(m.referenceAt(d.uri,h)){const S=this._getAlternativeCommand(t);!Ys._activeAlternativeCommands.has(S)&&Ys._allSymbolNavigationCommands.has(S)&&(_=Ys._allSymbolNavigationCommands.get(S))}const y=m.references.length;if(y===0){if(!this.configuration.muteMessage){const S=d.getWordAtPosition(h);(v=Da.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(S),h)}}else if(y===1&&_)Ys._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(S=>_.runEditorCommand(S,t,n,r).finally(()=>{Ys._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,m,r)},m=>{o.error(m)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,n,r,o){const s=this._getGoToPreference(n);if(!(n instanceof h_)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(n,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}}async _openReference(e,t,n,r,o){let s;if(ert(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:W.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,n){const r=g_.get(e);r&&e.hasModel()?r.toggleWidget(n??e.getSelection(),No(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Ys._allSymbolNavigationCommands=new Map;Ys._activeAlternativeCommands=new Set;class YT extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await W5(e.definitionProvider,t,n,r),w("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ki((yL=class extends YT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:yL.id,title:{...Hn("actions.goToDecl.label","Go to Definition"),mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:K.hasDefinitionProvider,keybinding:[{when:K.editorTextFocus,primary:70,weight:100},{when:Re.and(K.editorTextFocus,FSe),primary:2118,weight:100}],menu:[{id:H.EditorContext,group:"navigation",order:1.1},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),kn.registerCommandAlias("editor.action.goToDeclaration",yL.id)}},yL.id="editor.action.revealDefinition",yL));ki((wL=class extends YT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:wL.id,title:Hn("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:Re.and(K.hasDefinitionProvider,K.isInEmbeddedEditor.toNegated()),keybinding:[{when:K.editorTextFocus,primary:fo(2089,70),weight:100},{when:Re.and(K.editorTextFocus,FSe),primary:fo(2089,2118),weight:100}]}),kn.registerCommandAlias("editor.action.openDeclarationToTheSide",wL.id)}},wL.id="editor.action.revealDefinitionAside",wL));ki((SL=class extends YT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:SL.id,title:Hn("actions.previewDecl.label","Peek Definition"),precondition:Re.and(K.hasDefinitionProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:H.EditorContextPeek,group:"peek",order:2}}),kn.registerCommandAlias("editor.action.previewDeclaration",SL.id)}},SL.id="editor.action.peekDefinition",SL));class iEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await eEe(e.declarationProvider,t,n,r),w("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ki((R2=class extends iEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:R2.id,title:{...Hn("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Re.and(K.hasDeclarationProvider,K.isInEmbeddedEditor.toNegated()),menu:[{id:H.EditorContext,group:"navigation",order:1.3},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},R2.id="editor.action.revealDeclaration",R2));ki(class extends iEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Hn("actions.peekDecl.label","Peek Declaration"),precondition:Re.and(K.hasDeclarationProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:3}})}});class rEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await nEe(e.typeDefinitionProvider,t,n,r),w("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ki((M2=class extends rEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:M2.ID,title:{...Hn("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:K.hasTypeDefinitionProvider,keybinding:{when:K.editorTextFocus,primary:0,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.4},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},M2.ID="editor.action.goToTypeDefinition",M2));ki((P2=class extends rEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:P2.ID,title:Hn("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:Re.and(K.hasTypeDefinitionProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:4}})}},P2.ID="editor.action.peekTypeDefinition",P2));class oEe extends Ys{async _getLocationModel(e,t,n,r){return new Tl(await tEe(e.implementationProvider,t,n,r),w("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ki((A2=class extends oEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:A2.ID,title:{...Hn("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:K.hasImplementationProvider,keybinding:{when:K.editorTextFocus,primary:2118,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.45},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},A2.ID="editor.action.goToImplementation",A2));ki((O2=class extends oEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:O2.ID,title:Hn("actions.peekImplementation.label","Peek Implementations"),precondition:Re.and(K.hasImplementationProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:3142,weight:100},menu:{id:H.EditorContextPeek,group:"peek",order:5}})}},O2.ID="editor.action.peekImplementation",O2));class sEe extends Ys{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ki(class extends sEe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Hn("goToReferences.label","Go to References"),mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Re.and(K.hasReferenceProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),keybinding:{when:K.editorTextFocus,primary:1094,weight:100},menu:[{id:H.EditorContext,group:"navigation",order:1.45},{id:H.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,n,r){return new Tl(await $5(e.referenceProvider,t,n,!0,r),w("ref.title","References"))}});ki(class extends sEe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Hn("references.action.label","Peek References"),precondition:Re.and(K.hasReferenceProvider,al.notInPeekEditor,K.isInEmbeddedEditor.toNegated()),menu:{id:H.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,n,r){return new Tl(await $5(e.referenceProvider,t,n,!1,r),w("ref.title","References"))}});class TLt extends Ys{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:Hn("label.generic","Go to Any Symbol"),precondition:Re.and(al.notInPeekEditor,K.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,r){return new Tl(this._references,w("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}kn.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:Ft},{name:"position",description:"The position at which to start",constraint:le.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(i,e,t,n,r,o,s)=>{Yn(Ft.isUri(e)),Yn(le.isIPosition(t)),Yn(Array.isArray(n)),Yn(typeof r>"u"||typeof r=="string"),Yn(typeof s>"u"||typeof s=="boolean");const a=i.get(jn),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends TLt{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},n,r);c.get(Wt).invokeFunction(u.run.bind(u),l)})}});kn.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:Ft},{name:"position",description:"The position at which to start",constraint:le.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(i,e,t,n,r)=>{i.get(cr).executeCommand("editor.action.goToLocations",e,t,n,r,void 0,!0)}});kn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Yn(Ft.isUri(e)),Yn(le.isIPosition(t));const n=i.get(yt),r=i.get(jn);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!Qf(o)||!o.hasModel())return;const s=g_.get(o);if(!s)return;const a=No(c=>$5(n.referenceProvider,o.getModel(),le.lift(t),!1,c).then(u=>new Tl(u,w("ref.title","References")))),l=new W(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});kn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var NLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sE;let iC=sE=class{constructor(e,t,n,r){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=r,this.toUnhook=new Fe,this.toUnhookForKeyboard=new Fe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new M5(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{nn(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(sE.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 n=e.target.position;this.startFindDefinition(n)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new Lxe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=No(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){nn(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?W.lift(o[0].originSelectionRange):new W(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=W.plusRange(a,l));this.addDecoration(a,new Ns().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Ns().appendCodeblock(h||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,n){let r=n.range;return r.endLineNumber-r.startLineNumber>=sE.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,n){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(n);return new YT({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Gt);return al.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};iC.ID="editor.contrib.gotodefinitionatposition";iC.MAX_SOURCE_PREVIEW_LINES=8;iC=sE=NLt([U7(1,ul),U7(2,qi),U7(3,yt)],iC);Kn(iC.ID,iC,2);let RLt=class{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}};class aEe extends me{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new ae),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new mi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new mi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new mi(()=>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=$rt(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){nn(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 RLt(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 j7{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,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 Cb{constructor(e,t,n,r,o,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const $_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class OQ{constructor(){this._onDidWillResize=new ae,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new ae,this.onDidResize=this._onDidResize.event,this._sashListener=new Fe,this._size=new Gn(0,0),this._minSize=new Gn(0,0),this._maxSize=new Gn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Is(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Is(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Is(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:BO.North}),this._southSash=new Is(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:BO.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,n=0;this._sashListener.add(ot.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(ot.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ot.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(ot.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,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new Gn(t,e);Gn.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 MLt=30,PLt=24;class ALt extends me{constructor(e,t=new Gn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new OQ),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Gn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Gn(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?le.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Hr(t).top+n.top-MLt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const r=Hr(t),o=Wp(t.ownerDocument.body),s=r.top+n.top+n.height;return o.height-s-PLt}_findPositionPreference(e,t){var n,r;const o=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var FQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dP,Zh;const Ede=Xe;let dF=dP=class extends me{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Ov,this._editor)),this._participants=[];for(const r of $_.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new fF(this._editor,this._participants),this._hoverOperation=this._register(new aEe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new lEe(this._computer.anchor,o,r.isComplete))})),this._register(Lr(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(gr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,n,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:r,highlightRange:o}=dP.computeHoverRanges(this._editor,e.range,t),s=new Fe,a=s.add(new hF(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:dP._DECORATION_OPTIONS}]),s.add(Ot(()=>{h.clear()}))}this._widget.showAt(l,new FLt(e.initialMousePosX,e.initialMousePosY,c,n,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,s))}else s.dispose()}static computeHoverRanges(e,t,n){let r=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,f=h.convertModelRangeToViewRange(t),g=new le(f.startLineNumber,d.getLineMinColumn(f.startLineNumber));r=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const d of n)a=W.plusRange(a,d.range),d.range.startLineNumber===o&&d.range.endLineNumber===o&&(s=Math.max(Math.min(s,d.range.startColumn),r)),d.forceShowAtRange&&(l=d.range);const c=l?l.getStartPosition():new le(o,t.startColumn),u=l?l.getStartPosition():new le(o,s);return{showAtPosition:c,showAtSecondaryPosition:u,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const n=e.target;if(n.type===6&&t.push(new j7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,r){this._startShowingOrUpdateHover(new j7(0,e,void 0,void 0),t,n,r,null)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};dF._DECORATION_OPTIONS=an.register({description:"content-hover-highlight",className:"hoverHighlight"});dF=dP=FQ([nb(1,Wt),nb(2,ci)],dF);class lEe{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new OLt(this,this.anchor,t,this.isComplete)}}class OLt extends lEe{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}}class FLt{constructor(e,t,n,r,o,s,a,l,c,u){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=n,this.showAtPosition=r,this.showAtSecondaryPosition=o,this.preferAbove=s,this.stoleFocus=a,this.source=l,this.isBeforeContent=c,this.disposables=u,this.closestMouseDistance=void 0}}const Dde=30,K7=10,BLt=6;let Ov=Zh=class extends ALt{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,r,o){const s=e.getOption(67)+8,a=150,l=new Gn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new xZ),this._minimumSize=l,this._hoverVisibleKey=K.hoverVisible.bindTo(t),this._hoverFocusedKey=K.hoverFocused.bindTo(t),Oe(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(ph(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Zh.ID}static _applyDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return Zh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return Zh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Zh._applyMaxDimensions(this._hover.contentsDomNode,e,t),Zh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-K7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Gn(n,r),this._setHoverWidgetMaxDimensions(n,r)}_resize(e){var t,n;Zh._lastDimensions=new Gn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=BLt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=K7),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"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const n=Hr(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Ide(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,n.left,n.top,n.width,n.height));const r=Ide(e,t,n.left,n.top,n.width,n.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_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,Zh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Zh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=ep(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const u=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&qwe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Gn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ha(n),Math.min(o,e)),this._setContentsDomNodeDimensions(ha(r),Math.min(o,e-K7))}setMinimumDimensions(e){this._minimumSize=new Gn(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 Gn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=ep(t),r=ha(t);if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=ep(t),r=ha(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=ep(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-Dde})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+Dde})}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})}};Ov.ID="editor.contrib.resizableContentHoverWidget";Ov._lastDimensions=new Gn(0,0);Ov=Zh=FQ([nb(1,Gt),nb(2,mn),nb(3,pd),nb(4,ci)],Ov);let hF=class extends me{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Ede("div.hover-row.status-bar"),this.actionsElement=Oe(this.hoverElement,Ede("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(K3.render(this.actionsElement,e,n))}append(e){const t=Oe(this.actionsElement,e);return this._hasContent=!0,t}};hF=FQ([nb(0,ci)],hF);class fF{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 n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];const o=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Xr.EMPTY;const n=fF._getLineDecorations(this._editor,t);return Xr.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,n,e):Xr.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=fF._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return hh(t)}}function Ide(i,e,t,n,r,o){const s=t+r/2,a=n+o/2,l=Math.max(Math.abs(i-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const kde=Xe;class _w extends me{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Fe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new xZ),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new qf({editor:this._editor},t,n)),this._computer=new WLt(this._editor),this._hoverOperation=this._register(new aEe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return _w.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e,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 n=document.createDocumentFragment();for(const r of t){const o=kde("div.hover-row.markdown-hover"),s=Oe(o,kde("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),n.appendChild(o)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(67),s=this._hover.containerDomNode.clientHeight,a=n-r-(s-o)/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`}}_w.ID="editor.contrib.modesGlyphHoverWidget";class WLt{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=Uf.Center}computeSync(){var e,t;const n=a=>({value:a}),r=this._editor.getLineDecorations(this._lineNumber),o=[],s=this._laneOrLine==="lineNo";if(!r)return o;for(const a of r){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:Uf.Center;if(!s&&l!==this._laneOrLine)continue;const c=s?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||aS(c)||o.push(...qX(c).map(n))}return o}}class $Lt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function HLt(i,e,t,n,r){try{const o=await Promise.resolve(i.provideHover(t,n,r));if(o&&zLt(o))return new $Lt(i,o,e)}catch(o){eo(o)}}function BQ(i,e,t,n){const o=i.ordered(e).map((s,a)=>HLt(s,a,e,t,n));return Xr.fromPromises(o).coalesce()}function VLt(i,e,t,n){return BQ(i,e,t,n).map(r=>r.hover).toPromise()}rg("_executeHoverProvider",(i,e,t)=>{const n=i.get(yt);return VLt(n.hoverProvider,e,t,wn.None)});function zLt(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var ULt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Tde=Xe;class qd{constructor(e,t,n,r,o){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gF=class{constructor(e,t,n,r,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new qd(this,e.range,[new Ns().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];let a=1e3;const l=n.getLineLength(r),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(117),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new qd(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new qd(this,e.range,[{value:w("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===r?g.range.startColumn:1,m=g.range.endLineNumber===r?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||aS(v))continue;g.options.beforeContentClassName&&(f=!0);const _=new W(e.range.startLineNumber,p,e.range.startLineNumber,m);s.push(new qd(this,_,qX(v),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Xr.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Xr.EMPTY;const o=new le(e.range.startLineNumber,e.range.startColumn);return BQ(this._languageFeaturesService.hoverProvider,r,o,n).filter(s=>!aS(s.hover.contents)).map(s=>{const a=s.hover.range?W.lift(s.hover.range):e.range;return new qd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return cEe(e,t,this._editor,this._languageService,this._openerService)}};gF=ULt([F2(1,qi),F2(2,hl),F2(3,mn),F2(4,yt)],gF);function cEe(i,e,t,n,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new Fe;for(const s of e)for(const a of s.contents){if(aS(a))continue;const l=Tde("div.hover-row.markdown-hover"),c=Oe(l,Tde("div.hover-contents")),u=o.add(new qf({editor:t},n,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return o}var uEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Nde{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Xj=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new ae,this.onDidChange=this._onDidChange.event,this._dispoables=new Fe,this._markers=[],this._nextIdx=-1,Ft.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=sI(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=W.compareRangesUsingStarts(a,l)||vr.compare(a.severity,l.severity):c=vr.compare(a.severity,l.severity)||W.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Ft.isUri(e)?e:void 0,severities:vr.Error|vr.Warning|vr.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Nde(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=JD(this._markers,{resource:e.uri},(s,a)=>sI(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},L1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qj;class KLt{constructor(e,t,n,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Fe,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Lr(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new Vye(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=ng(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ps(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=Xe("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Oe(this._codeLink,Xe("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ps(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ms(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const m=document.createElement("span");m.innerText=f.message,g.appendChild(p),g.appendChild(m),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case vr.Error:t=w("Error","Error");break;case vr.Warning:t=w("Warning","Warning");break;case vr.Info:t=w("Info","Info");break;case vr.Hint:t=w("Hint","Hint");break}let n=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(n=`${r.getLineContent(e.startLineNumber)}, ${n}`),n}}let yS=Qj=class extends uF{constructor(e,t,n,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Fe,this._onDidSelectRelatedInformation=new ae,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=vr.Warning,this._backgroundColor=Ce.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(YLt);let t=Jj,n=GLt;this._severity===vr.Warning?(t=hP,n=qLt):this._severity===vr.Info&&(t=eK,n=XLt);const r=e.getColor(t),o=e.getColor(n);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(ZLe),secondaryHeadingColor:e.getColor(QLe)})}_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=[],n=this._menuService.createMenu(Qj.TitleMenu,this._contextKeyService);n5(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Oe(e,Xe(""))}_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 KLt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=W.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?w("problems","{0} of {1} problems",t,n):w("change","{0} of {1} problem",t,n);this.setTitle(uu(a.uri),l)}this._icon.className=`codicon ${Zj.className(vr.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};yS.TitleMenu=new H("gotoErrorTitleMenu");yS=Qj=jLt([L1(1,Mo),L1(2,hl),L1(3,mu),L1(4,Wt),L1(5,Gt),L1(6,lS)],yS);const Rde=SI(Ef,wct),Mde=SI(Zs,yI),Pde=SI(tl,wI),Jj=X("editorMarkerNavigationError.background",{dark:Rde,light:Rde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),GLt=X("editorMarkerNavigationError.headerBackground",{dark:Mt(Jj,.1),light:Mt(Jj,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),hP=X("editorMarkerNavigationWarning.background",{dark:Mde,light:Mde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),qLt=X("editorMarkerNavigationWarning.headerBackground",{dark:Mt(hP,.1),light:Mt(hP,.1),hcDark:"#0C141F",hcLight:Mt(hP,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),eK=X("editorMarkerNavigationInfo.background",{dark:Pde,light:Pde,hcDark:Ln,hcLight:Ln},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),XLt=X("editorMarkerNavigationInfo.headerBackground",{dark:Mt(eK,.1),light:Mt(eK,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),YLt=X("editorMarkerNavigation.background",{dark:ko,light:ko,hcDark:ko,hcLight:ko},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var ZLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aE;let p_=aE=class{static get(e){return e.getContribution(aE.ID)}constructor(e,t,n,r,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new Fe,this._editor=e,this._widgetVisible=hEe.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(yS,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(n=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!W.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:W.lift(n).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 le(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var n,r;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((n=aE.get(s))===null||n===void 0||n.close(),(r=aE.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};p_.ID="editor.contrib.markerController";p_=aE=ZLt([B2(1,dEe),B2(2,Gt),B2(3,jn),B2(4,Wt)],p_);class H5 extends pt{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=p_.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Fv extends H5{constructor(){super(!0,!1,{id:Fv.ID,label:Fv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:578,weight:100},menuOpts:{menuId:yS.TitleMenu,title:Fv.LABEL,icon:Or("marker-navigation-next",tt.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Fv.ID="editor.action.marker.next";Fv.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class yb extends H5{constructor(){super(!1,!1,{id:yb.ID,label:yb.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:1602,weight:100},menuOpts:{menuId:yS.TitleMenu,title:yb.LABEL,icon:Or("marker-navigation-previous",tt.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}yb.ID="editor.action.marker.prev";yb.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class QLt extends H5{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("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:K.focus,primary:66,weight:100},menuOpts:{menuId:H.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class JLt extends H5{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("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:K.focus,primary:1090,weight:100},menuOpts:{menuId:H.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Kn(p_.ID,p_,4);Ke(Fv);Ke(yb);Ke(QLt);Ke(JLt);const hEe=new ct("markersNavigationVisible",!1),eEt=zo.bindToContribution(p_.get);st(new eEt({id:"closeMarkersNavigation",precondition:hEe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:K.focus,primary:9,secondary:[1033]}}));var tEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},G7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Pu=Xe;class nEt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Ade={type:1,filter:{include:qt.QuickFix},triggerAction:Al.QuickFixHover};let tK=class{constructor(e,t,n,r){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new W(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new nEt(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return me.None;const n=new Fe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,n)));const r=t.length===1?t[0]:t.sort((o,s)=>vr.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,n),n}renderMarkerHover(e,t){const n=Pu("div.hover-row"),r=Oe(n,Pu("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=Oe(r,Pu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=Pu("span");if(o){const g=Oe(u,Pu("span"));g.innerText=o}const d=Oe(u,Pu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(xe(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Oe(d,Pu("span"));h.innerText=a.value;const f=Oe(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=Oe(r,Pu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Ms(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=Oe(r,Pu("div"));g.style.marginTop="8px";const p=Oe(g,Pu("a"));p.innerText=`${uu(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(xe(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(nn)}));const m=Oe(g,Pu("span"));m.innerText=u,this._editor.applyFontInfo(m)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity===vr.Error||t.marker.severity===vr.Warning||t.marker.severity===vr.Info){const r=p_.get(this._editor);r&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:Fv.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const r=e.statusBar.append(Pu("div"));this.recentMarkerCodeActionsInfo&&(OO.makeKey(this.recentMarkerCodeActionsInfo.marker)===OO.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?me.None:Qv(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,n);r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(Ot(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;n.add(Ot(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:kQ,run:c=>{l=!0;const u=u_.get(this._editor),d=Hr(c);e.hide(),u==null||u.showCodeActions(Ade,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},nn)}}getCodeActions(e){return No(t=>sD(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Ade,yp.None,t))}};tK=tEt([G7(1,HY),G7(2,hl),G7(3,yt)],tK);const fEe="editor.action.inlineSuggest.commit",gEe="editor.action.inlineSuggest.showPrevious",pEe="editor.action.inlineSuggest.showNext";var WQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fP;let nK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=en(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new le(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ah((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(m_,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ot(()=>e.removeContentWidget(a))),o.add(yn(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==_p.Explicit&&s.triggerExplicitly()}))}))}};nK=WQ([Xd(2,Wt)],nK);const iEt=Or("inline-suggestion-hints-next",tt.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),rEt=Or("inline-suggestion-hints-previous",tt.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let m_=fP=class extends me{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const r=new Il(e,t,n,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,n,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${fP.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=pi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[pi("div@toolBar")]),this.previousAction=this.createCommandAction(gEe,w("previous","Previous"),Vt.asClassName(rEt)),this.availableSuggestionCountAction=new Il("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(pEe,w("next","Next"),Vt.asClassName(iEt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(H.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new mi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new mi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(iK,this.nodes.toolBar,H.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof bc)return l.createInstance(sEt,h,void 0);if(h===this.availableSuggestionCountAction){const g=new oEt(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{fP._dropDownVisible=h})),this._register(yn(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(yn(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(yn(h=>{const f=this._extraCommands.read(h);if(lr(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:m=>this._commandService.executeCommand(p.id)}));for(const[p,m]of this.inlineCompletionsActionsMenus.getActions())for(const v of m)v instanceof bc&&g.push(v);g.length>0&&g.unshift(new ho),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};m_._dropDownVisible=!1;m_.id=0;m_=fP=WQ([Xd(6,cr),Xd(7,Wt),Xd(8,ci),Xd(9,Gt),Xd(10,mu)],m_);class oEt extends dS{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 sEt=class extends a_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=pi("div.keybinding").root;new ex(t,Ll,{disableTitle:!0,...GSe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},iK=class extends sk{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];n5(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){lr(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){lr(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};iK=WQ([Xd(3,mu),Xd(4,Gt),Xd(5,$l),Xd(6,ci),Xd(7,ia)],iK);var aEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rK;const lEt=!1;let ll=rK=class extends me{constructor(e,t,n,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=r,this._keybindingService=o,this._listenersStore=new Fe,this._hoverState={mouseDown:!1,contentHoverFocused:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new mi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(rK.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},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){var t;this._hoverState.mouseDown=!0;const n=e.target;if(n.type===9&&n.detail===Ov.ID){this._hoverState.contentHoverFocused=!0;return}n.type===12&&n.detail===_w.ID||(n.type!==12&&(this._hoverState.contentHoverFocused=!1),!(!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing)&&this._hideWidgets())}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){var t,n;this._cancelScheduler();const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((n=this._contentWidget)===null||n===void 0)&&n.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,n,r,o,s;const a=e.target,l=this._hoverSettings.sticky;return!!(l&&a.type===9&&a.detail===Ov.ID||l&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!l&&a.type===9&&a.detail===Ov.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||l&&a.type===12&&a.detail===_w.ID)}_onEditorMouseMove(e){var t,n,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((n=this._contentWidget)===null||n===void 0)&&n.isResizing||this._hoverState.mouseDown&&this._hoverState.contentHoverFocused)return;const s=this._hoverSettings.sticky;if(s&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&s&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,r,o;if(!e)return;const s=e.target,a=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(147),c=this._hoverSettings.enabled,u=this._hoverState.activatedByDecoratorClick;if(a&&(l==="click"&&!u||l==="hover"&&!c&&!lEt||l==="clickAndHover"&&!c&&!u)||!a&&!c&&!u){this._hideWidgets();return}if(this._getOrCreateContentWidget().showsOrWillShow(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(s.type===2&&s.position&&s.detail.glyphMarginLane){(r=this._contentWidget)===null||r===void 0||r.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,s.detail.glyphMarginLane);return}if(s.type===3&&s.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,"lineNo");return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||r||this._hideWidgets()}_hideWidgets(){var e,t,n;this._hoverState.mouseDown&&this._hoverState.contentHoverFocused&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||m_.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._hoverState.contentHoverFocused=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(dF,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=new _w(this._editor,this._languageService,this._openerService)),this._glyphWidget}showContentHover(e,t,n,r,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ll.ID="editor.contrib.hover";ll=rK=aEt([W2(1,Wt),W2(2,hl),W2(3,qi),W2(4,ci)],ll);var Nd;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Nd||(Nd={}));class cEt extends pt{constructor(){super({id:"editor.action.showHover",label:w({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:"Show or Focus Hover",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:[Nd.NoAutoFocus,Nd.FocusIfVisible,Nd.AutoFocusImmediately],enumDescriptions:[w("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),w("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),w("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Nd.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const r=ll.get(t);if(!r)return;const o=n==null?void 0:n.focus;let s=Nd.FocusIfVisible;Object.values(Nd).includes(o)?s=o:typeof o=="boolean"&&o&&(s=Nd.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new W(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?s!==Nd.NoAutoFocus?r.focus():a(l):a(l||s===Nd.AutoFocusImmediately)}}class uEt extends pt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=ll.get(t);if(!n)return;const r=t.getPosition();if(!r)return;const o=new W(r.lineNumber,r.column,r.lineNumber,r.column),s=iC.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{n.showContentHover(o,1,1,!0)})}}class dEt extends pt{constructor(){super({id:"editor.action.scrollUpHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:16,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollUp()}}class hEt extends pt{constructor(){super({id:"editor.action.scrollDownHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:18,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollDown()}}class fEt extends pt{constructor(){super({id:"editor.action.scrollLeftHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:15,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollLeft()}}class gEt extends pt{constructor(){super({id:"editor.action.scrollRightHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:17,weight:100}})}run(e,t){const n=ll.get(t);n&&n.scrollRight()}}class pEt extends pt{constructor(){super({id:"editor.action.pageUpHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=ll.get(t);n&&n.pageUp()}}class mEt extends pt{constructor(){super({id:"editor.action.pageDownHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=ll.get(t);n&&n.pageDown()}}class vEt extends pt{constructor(){super({id:"editor.action.goToTopHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=ll.get(t);n&&n.goToTop()}}class _Et extends pt{constructor(){super({id:"editor.action.goToBottomHover",label:w({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:K.hoverFocused,kbOpts:{kbExpr:K.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=ll.get(t);n&&n.goToBottom()}}Kn(ll.ID,ll,2);Ke(cEt);Ke(uEt);Ke(dEt);Ke(hEt);Ke(fEt);Ke(gEt);Ke(pEt);Ke(mEt);Ke(vEt);Ke(_Et);$_.register(gF);$_.register(tK);vu((i,e)=>{const t=i.getColor(Nye);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class oK extends me{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(147);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==HLe||!n.range)return;const r=this._editor.getContribution(ll.ID);if(r&&!r.isColorPickerVisible){const o=new W(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}oK.ID="editor.contrib.colorContribution";Kn(oK.ID,oK,2);$_.register(cF);var mEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ud=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sK,aK;let v_=sK=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=K.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=K.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new mF(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(sK.ID)}};v_.ID="editor.contrib.standaloneColorPickerController";v_=sK=mEe([Ud(1,Gt),Ud(2,or),Ud(3,ci),Ud(4,Wt),Ud(5,yt),Ud(6,Ti)],v_);Kn(v_.ID,v_,1);const Ode=8,bEt=22;let mF=aK=class extends me{constructor(e,t,n,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new ae),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(dk,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(ph(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?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(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return aK.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 CEt(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}},n=await this._standaloneColorPickerParticipant.createColorHover(t,new MQ(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null}_render(e,t){const n=document.createDocumentFragment(),r=this._register(new hF(this._keybindingService));let o;const s={fragment:n,statusBar:r,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-bEt-Ode,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+Ode+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};mF.ID="editor.contrib.standaloneColorPickerWidget";mF=aK=mEe([Ud(3,Wt),Ud(4,or),Ud(5,ci),Ud(6,yt),Ud(7,Ti)],mF);class CEt{constructor(e,t){this.value=e,this.foundInEditor=t}}class yEt extends Nh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Hn("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:H.CommandPalette}]})}runEditorCommand(e,t){var n;(n=v_.get(t))===null||n===void 0||n.showOrFocus()}}class wEt extends pt{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:K.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=v_.get(t))===null||n===void 0||n.hide()}}class SEt extends pt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({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:K.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=v_.get(t))===null||n===void 0||n.insertColor()}}Ke(wEt);Ke(SEt);ki(yEt);class cv{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const r=t.length,o=e.length;if(n+r>o)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const m=d.substring(f+t.length),v=h.substring(0,g);(m.indexOf(n)>=0||v.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=cv._createRemoveBlockCommentOperations(new W(a,f+t.length+1,c,g+1),t,n)):(p=cv._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const m of p)s.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,n){const r=[];return W.isEmpty(e)?r.push(Ji.delete(new W(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(r.push(Ji.delete(new W(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Ji.delete(new W(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),r}static _createAddBlockCommentOperations(e,t,n,r){const o=[];return W.isEmpty(e)?o.push(Ji.replace(new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(Ji.insert(new le(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Ji.insert(new le(e.endLineNumber,e.endColumn),(r?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const r=n[0],o=n[1];return new Et(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=n[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Et(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class Ag{constructor(e,t,n,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;co?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class $Q extends pt{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>W.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lK;let wS=lK=class{static get(e){return e.getContribution(lK.ID)}constructor(e,t,n,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Fe,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&&Hb(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 n=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?H.SimpleEditorContext:H.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof dI){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new jw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new ho)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Hr(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(127)&&!fh;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new dS(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new dS(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||r_t(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let n=0;const r=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new jw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=m=>()=>{this._configurationService.updateValue(d,m)},p=[];for(const m of f)p.push(r({label:m.label,checked:h===m.value,run:g(m.value)}));return o(c,p)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new ho),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!fh;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()}};wS.ID="editor.contrib.contextmenu";wS=lK=IEt([d0(1,$l),d0(2,og),d0(3,Gt),d0(4,ci),d0(5,mu),d0(6,mn),d0(7,Kb)],wS);class kEt extends pt{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=wS.get(t))===null||n===void 0||n.showContextMenu()}}Kn(wS.ID,wS,2);Ke(kEt);class q7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let r=0;r{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 n=new q7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new X7(n,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 X7(new q7(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 X7(new q7(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}}rC.ID="editor.contrib.cursorUndoRedoController";class TEt extends pt{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var r;(r=rC.get(t))===null||r===void 0||r.cursorUndo()}}class NEt extends pt{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var r;(r=rC.get(t))===null||r===void 0||r.cursorRedo()}}Kn(rC.ID,rC,0);Ke(TEt);Ke(NEt);class REt{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new W(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Et(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 Et(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.lineNumberthis._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)||(E1(e)&&(this._modifierPressed=!0),this._mouseDown&&E1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(E1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===wp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}E1(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 le(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;n=[new Et(o,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new Et(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(E1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(wp.ID,new REt(this._dragSelection,t,E1(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 W(e.lineNumber,e.column,e.lineNumber,e.column),options:wp._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()}}wp.ID="editor.contrib.dragAndDrop";wp.TRIGGER_KEY_VALUE=Dn?6:5;wp._DECORATION_OPTIONS=an.register({description:"dnd-target",className:"dnd-target"});Kn(wp.ID,wp,2);var HQ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const V5=w("builtIn","Built-in");class VQ{async provideDocumentPasteEdits(e,t,n,r,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,r){const o=await this.getEdit(n,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class vEe extends VQ{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[wr.text],this.pasteMimeTypes=[wr.text]}async getEdit(e,t){const n=e.get(wr.text);if(!n||e.has(wr.uriList))return;const r=await n.asString();return{handledMimeType:wr.text,label:w("text.label","Insert Plain Text"),detail:V5,insertText:r}}}class _Ee extends VQ{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[wr.uriList],this.pasteMimeTypes=[wr.uriList]}async getEdit(e,t){const n=await bEe(e);if(!n.length||t.isCancellationRequested)return;let r=0;const o=n.map(({uri:a,originalText:l})=>a.scheme===cn.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=n.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:wr.uriList,insertText:o,label:s,detail:V5}}}let vF=class extends VQ{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[wr.uriList],this.pasteMimeTypes=[wr.uriList]}async getEdit(e,t){const n=await bEe(e);if(!n.length||t.isCancellationRequested)return;const r=hh(n.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Xft(s.uri,o):void 0}));if(r.length)return{handledMimeType:wr.uriList,insertText:r.join(" "),label:n.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:V5}}};vF=HQ([pk(0,Kb)],vF);class MEt{constructor(){this.id="html",this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:wr.text}]}async provideDocumentPasteEdits(e,t,n,r,o){if(r.trigger!=="explicit"&&r.only!==this.id)return;const s=n.get("text/html"),a=await(s==null?void 0:s.asString());if(!(!a||o.isCancellationRequested))return{insertText:a,yieldTo:this._yieldTo,label:w("pasteHtmlLabel","Insert HTML"),detail:V5}}}async function bEe(i){const e=i.get(wr.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const r of N5.parse(t))try{n.push({uri:Ft.parse(r),originalText:r})}catch{}return n}let cK=class extends me{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new vEe)),this._register(e.documentOnDropEditProvider.register("*",new _Ee)),this._register(e.documentOnDropEditProvider.register("*",new vF(t)))}};cK=HQ([pk(0,yt),pk(1,Kb)],cK);let uK=class extends me{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new vEe)),this._register(e.documentPasteEditProvider.register("*",new _Ee)),this._register(e.documentPasteEditProvider.register("*",new vF(t))),this._register(e.documentPasteEditProvider.register("*",new MEt))}};uK=HQ([pk(0,yt),pk(1,Kb)],uK);Kn(Hp.ID,Hp,0);BT(uK);st(new class extends zo{constructor(){super({id:CLe,precondition:yLe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=Hp.get(e))===null||n===void 0?void 0:n.changePasteType()}});Ke(class extends pt{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:K.writable,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=Hp.get(e))===null||n===void 0?void 0:n.pasteAs(r)}});Ke(class extends pt{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:K.writable})}run(i,e,t){var n;return(n=Hp.get(e))===null||n===void 0?void 0:n.pasteAs("text")}});class PEt{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 Fde{constructor(e){this.identifier=e}}const CEe=Sn("treeViewsDndService");Tn(CEe,PEt,1);var AEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dK;const yEe="editor.experimental.dropIntoEditor.defaultProvider",wEe="editor.changeDropType",SEe=new ct("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let SS=dK=class extends me{static get(e){return e.getContribution(dK.ID)}constructor(e,t,n,r,o){super(),this._configService=n,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=lk.getInstance(),this._dropProgressManager=this._register(t.createInstance(oF,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(aF,"dropIntoEditor",e,SEe,{id:wEe,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,n){var r;if(!n.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=No(async s=>{const a=new c_(e,1,void 0,s);try{const l=await this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=await this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([W.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,n,r,o){const s=await gT(Promise.all(e.map(async l=>{try{const c=await l.provideDocumentOnDropEdits(t,n,r,o.token);if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),o.token),a=hh(s??[]);return _Le(a)}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(yEe,{resource:e.uri});for(const[r,o]of Object.entries(n)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&hLe(r,[a.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new dLe;const t=pLe(e.dataTransfer);if(this.treeItemsTransfer.hasData(Fde.prototype)){const n=this.treeItemsTransfer.getData(Fde.prototype);if(Array.isArray(n))for(const r of n){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t}};SS.ID="editor.contrib.dropIntoEditorController";SS=dK=AEt([$2(1,Wt),$2(2,mn),$2(3,yt),$2(4,CEe)],SS);Kn(SS.ID,SS,2);st(new class extends zo{constructor(){super({id:wEe,precondition:SEe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=SS.get(e))===null||n===void 0||n.changeDropType()}});BT(cK);ur.as(Rh.Configuration).registerConfiguration({...Y3,properties:{[yEe]:{type:"object",scope:5,description:w("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class Gs{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{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Gs._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Gs._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new W(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Gs._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let r=Gs._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Gs._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new W(d,1,h,1),options:Gs._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}o.push({range:new W(d,1,h,1),options:Gs._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Gs._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.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,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const n=[];for(let s=0;sW.compareRangesUsingStarts(s.range,a.range));const r=[];let o=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function Bde(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Wde(i,e,t){const n=e.split(t),r=i[0].split(t);let o="";return n.forEach((s,a)=>{o+=xEe([r[a]],s)+t}),o.slice(0,-1)}class $de{constructor(e){this.staticValue=e,this.kind=0}}class FEt{constructor(e){this.pieces=e,this.kind=1}}class xS{static fromStaticValue(e){return new xS([wb.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new $de(""):e.length===1&&e[0].staticValue!==null?this._state=new $de(e[0].staticValue):this._state=new FEt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?xEe(e,this._state.staticValue):this._state.staticValue;let n="";for(let r=0,o=this._state.pieces.length;r0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=r)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` +`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(n++,n>=r)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},$Et)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let n=null;typeof t<"u"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new W(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(n,!1,uv);this._decorations.set(r,n);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=pI(r.map(l=>l.range),l=>W.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===1?(n===1?n=o.getLineCount():n--,r=o.getLineMaxColumn(n)):r--,new le(n,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,r=1):r++,new le(n,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()aD._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=uv?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new C0(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(n,a.buildReplaceString(null,c));const u=new JY(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=n.length;ss.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(o=>new Et(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=n.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY),inputActiveOptionBackground:ft(q0)};this.caseSensitive=this._register(new LSe({appendTitle:this._keybindingLabelFor(Mi.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,...r})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new ESe({appendTitle:this._keybindingLabelFor(Mi.ToggleWholeWordCommand),isChecked:this._state.wholeWord,...r})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new DSe({appendTitle:this._keybindingLabelFor(Mi.ToggleRegexCommand),isChecked:this._state.isRegex,...r})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(xe(this._domNode,Je.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(xe(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 U5.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")}}U5.ID="editor.contrib.findOptionsWidget";function K2(i,e){return i===1?!0:i===2?!1:e}class HEt extends me{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return K2(this._isRegexOverride,this._isRegex)}get wholeWord(){return K2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return K2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return K2(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 ae),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,n){const r={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof n<"u"&&(W.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,n=!0){var r;const o={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!W.equalsRange(f,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=uv}}const VEt=w("defaultLabel","input"),zEt=w("label.preserveCaseToggle","Preserve Case");class UEt extends JS{constructor(e){super({icon:tt.preserveCase,title:zEt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jEt extends Lc{constructor(e,t,n,r){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new ae),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new ae),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new ae),this._onInput=this._register(new ae),this._onKeyUp=this._register(new ae),this._onPreserveCaseKeyDown=this._register(new ae),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||VEt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ISe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new UEt({appendTitle:o,isChecked:!1,...r.toggleStyles})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),gn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var LEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EEe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UQ=new ct("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),jQ="historyNavigationWidgetFocus",DEe="historyNavigationForwardsEnabled",IEe="historyNavigationBackwardsEnabled";let Sp;const G2=[];function kEe(i,e){if(G2.includes(e))throw new Error("Cannot register the same widget multiple times");G2.push(e);const t=new Fe,n=new ct(jQ,!1).bindTo(i),r=new ct(DEe,!0).bindTo(i),o=new ct(IEe,!0).bindTo(i),s=()=>{n.set(!0),Sp=e},a=()=>{n.set(!1),Sp===e&&(Sp=void 0)};return pT(e.element)&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Ot(()=>{G2.splice(G2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let hK=class extends kSe{constructor(e,t,n,r){super(e,t,n);const o=this._register(r.createScoped(this.inputBox.element));this._register(kEe(o,this.inputBox))}};hK=LEe([EEe(3,Gt)],hK);let fK=class extends jEt{constructor(e,t,n,r,o=!1){super(e,t,o,n);const s=this._register(r.createScoped(this.inputBox.element));this._register(kEe(s,this.inputBox))}};fK=LEe([EEe(3,Gt)],fK);sl.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Re.and(Re.has(jQ),Re.equals(IEe,!0),Re.not("isComposing"),UQ.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Sp==null||Sp.showPreviousValue()}});sl.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Re.and(Re.has(jQ),Re.equals(DEe,!0),Re.not("isComposing"),UQ.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Sp==null||Sp.showNextValue()}});function Hde(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const KEt=Or("find-selection",tt.selection,w("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Vde=Or("find-collapsed",tt.chevronRight,w("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),zde=Or("find-expanded",tt.chevronDown,w("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),GEt=Or("find-replace",tt.replace,w("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),qEt=Or("find-replace-all",tt.replaceAll,w("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),XEt=Or("find-previous-match",tt.arrowUp,w("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),YEt=Or("find-next-match",tt.arrowDown,w("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),ZEt=w("label.findDialog","Find / Replace"),QEt=w("label.find","Find"),JEt=w("placeholder.find","Find"),eDt=w("label.previousMatchButton","Previous Match"),tDt=w("label.nextMatchButton","Next Match"),nDt=w("label.toggleSelectionFind","Find in Selection"),iDt=w("label.closeButton","Close"),rDt=w("label.replace","Replace"),oDt=w("placeholder.replace","Replace"),sDt=w("label.replaceButton","Replace"),aDt=w("label.replaceAllButton","Replace All"),lDt=w("label.toggleReplaceButton","Toggle Replace"),cDt=w("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",uv),uDt=w("label.matchesLocation","{0} of {1}"),Ude=w("label.noResults","No results"),Kh=419,dDt=275,hDt=dDt-54;let xL=69;const fDt=33,jde="ctrlEnterReplaceAll.windows.donotask",Kde=Dn?256:2048;class Y7{constructor(e){this.afterLineNumber=e,this.heightInPx=fDt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Gde(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function qde(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(91)&&(this._codeEditor.getOption(91)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(144)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new Y7(0),this._showViewZone()),!h&&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 u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=z5.bindTo(s),this._findFocusTracker=this._register(ph(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=zQ.bindTo(s),this._replaceFocusTracker=this._register(ph(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 Y7(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return j5.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(91)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ha(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,nn)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=xL+"px",this._state.matchesCount>=uv?this._matchesCount.title=cDt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=uv&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Fb(uDt,n,t)}else e=Ude;this._matchesCount.appendChild(document.createTextNode(e)),Pl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),xL=Math.max(xL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===Ude)return n===""?w("ariaSearchNoResultEmpty","{0} found",e):w("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const r=w("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return w("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);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 n=!this._codeEditor.getOption(91);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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 n=this._codeEditor.getDomNode();if(n){const r=Hr(n),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=k1e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(r=>{n.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new Y7(0));const n=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===n.heightInPx)return;const s=o-n.heightInPx;n.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(84).top,o<=0)return;n.heightInPx=o,this._viewZoneId=r.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!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 n=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&ha(this._domNode)>Kh){this._domNode.style.maxWidth=`${n-28-r-15}px`,this._replaceInput.width=ha(this._findInput.domNode);return}if(Kh+28+r>=n&&(s=!0),Kh+28+r-xL>=n&&(a=!0),Kh+28+r-xL>=n+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${n-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ha(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 n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!W.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(Kde|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 Gde(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return qde(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Kde|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Os&&nh&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(w("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(jde,!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 Gde(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return qde(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 hK(null,this._contextViewProvider,{width:hDt,label:QEt,placeholder:JEt,appendCaseSensitiveLabel:this._keybindingLabelFor(Mi.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Mi.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Mi.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>Hde(this._keybindingService),inputBoxStyles:RO,toggleStyles:NO},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),ka&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new D1({label:eDt+this._keybindingLabelFor(Mi.PreviousMatchFindAction),icon:XEt,onTrigger:()=>{Ym(this._codeEditor.getAction(Mi.PreviousMatchFindAction)).run().then(void 0,nn)}})),this._nextBtn=this._register(new D1({label:tDt+this._keybindingLabelFor(Mi.NextMatchFindAction),icon:YEt,onTrigger:()=>{Ym(this._codeEditor.getAction(Mi.NextMatchFindAction)).run().then(void 0,nn)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new JS({icon:KEt,title:nDt+this._keybindingLabelFor(Mi.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ft(G0),inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l=l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new D1({label:iDt+this._keybindingLabelFor(Mi.CloseFindWidgetCommand),icon:txe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new fK(null,void 0,{label:rDt,placeholder:oDt,appendPreserveCaseLabel:this._keybindingLabelFor(Mi.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Hde(this._keybindingService),inputBoxStyles:RO,toggleStyles:NO},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new D1({label:sDt+this._keybindingLabelFor(Mi.ReplaceOneAction),icon:GEt,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new D1({label:aDt+this._keybindingLabelFor(Mi.ReplaceAllAction),icon:qEt,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new D1({label:lDt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ha(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=ZEt,this._domNode.role="dialog",this._domNode.style.width=`${Kh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=this._register(new Is(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let a=Kh;this._register(this._resizeSash.onDidStart(()=>{a=ha(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cu||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ha(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ha(this._domNode);if(l{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var r,o;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,n)})}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(...Vt.asClassNameArray(Vde)),this._domNode.classList.add(...Vt.asClassNameArray(zde))):(this._domNode.classList.remove(...Vt.asClassNameArray(zde)),this._domNode.classList.add(...Vt.asClassNameArray(Vde)))}}vu((i,e)=>{const t=i.getColor(tv);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${sh(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const n=i.getColor(Rct);n&&e.addRule(`.monaco-editor .findScope { border: 1px ${sh(i.type)?"dashed":"solid"} ${n}; }`);const r=i.getColor(Ln);r&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`)});var TEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gK;const gDt=524288;function pK(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const r=i.getConfiguredWordAtPosition(n.getStartPosition());if(r&&t===!1)return r.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!z5.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=vc(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const n={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const r=pK(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?n.searchString=vc(r):n.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=pK(this._editor,e.seedSearchStringFromSelection);r&&(n.searchString=r)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const r=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(n.searchString=r)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(n.searchScope=r)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new aD(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(w("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)}};Na.ID="editor.contrib.findController";Na=gK=TEe([Bd(1,Gt),Bd(2,md),Bd(3,Zp),Bd(4,zr)],Na);let mK=class extends Na{constructor(e,t,n,r,o,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const n=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=!!n&&n.startLineNumber!==n.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 j5(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new U5(this._editor,this._state,this._keybindingService))}};mK=TEe([Bd(1,og),Bd(2,Gt),Bd(3,ci),Bd(4,Mo),Bd(5,zr),Bd(6,md),Bd(7,Zp)],mK);const pDt=G1e(new K1e({id:Mi.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:Re.or(K.focus,Re.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:H.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));pDt.addImplementation(0,(i,e,t)=>{const n=Na.get(e);return n?n.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 mDt={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 vDt extends pt{constructor(){super({id:Mi.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:mDt})}async run(e,t,n){const r=Na.get(t);if(r){const o=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.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:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}}}class _Dt extends pt{constructor(){super({id:Mi.StartFindWithSelection,label:w("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 n=Na.get(t);n&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))}}class NEe extends pt{async run(e,t){const n=Na.get(t);n&&!this._run(n)&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.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(n))}}class bDt extends NEe{constructor(){super({id:Mi.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Re.and(K.focus,z5),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class CDt extends NEe{constructor(){super({id:Mi.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Re.and(K.focus,z5),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class yDt extends pt{constructor(){super({id:Mi.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Qp}),this._highlightDecorations=[]}run(e,t,n){const r=Na.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get(zr).notify({severity:U3.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Ph).createInputBox();a.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(n=>{this._highlightDecorations=n.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:pr(Gye),position:Cc.Full}}}])})}}class REe extends pt{async run(e,t){const n=Na.get(t);if(!n)return;const r=pK(t,"single",!1);r&&n.setSearchString(r),this._run(n)||(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class wDt extends REe{constructor(){super({id:Mi.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class SDt extends REe{constructor(){super({id:Mi.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const xDt=G1e(new K1e({id:Mi.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:Re.or(K.focus,Re.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:H.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));xDt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(91))return!1;const n=Na.get(e);if(!n)return!1;const r=e.getSelection(),o=n.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Kn(Na.ID,mK,0);Ke(vDt);Ke(_Dt);Ke(bDt);Ke(CDt);Ke(yDt);Ke(wDt);Ke(SDt);const Oh=zo.bindToContribution(Na.get);st(new Oh({id:Mi.CloseFindWidgetCommand,precondition:Qp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:9,secondary:[1033]}}));st(new Oh({id:Mi.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:H2.primary,mac:H2.mac,win:H2.win,linux:H2.linux}}));st(new Oh({id:Mi.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:V2.primary,mac:V2.mac,win:V2.win,linux:V2.linux}}));st(new Oh({id:Mi.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:z2.primary,mac:z2.mac,win:z2.win,linux:z2.linux}}));st(new Oh({id:Mi.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:U2.primary,mac:U2.mac,win:U2.win,linux:U2.linux}}));st(new Oh({id:Mi.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:j2.primary,mac:j2.mac,win:j2.win,linux:j2.linux}}));st(new Oh({id:Mi.ReplaceOneAction,precondition:Qp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:3094}}));st(new Oh({id:Mi.ReplaceOneAction,precondition:Qp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,zQ),primary:3}}));st(new Oh({id:Mi.ReplaceAllAction,precondition:Qp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:2563}}));st(new Oh({id:Mi.ReplaceAllAction,precondition:Qp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,zQ),primary:void 0,mac:{primary:2051}}}));st(new Oh({id:Mi.SelectAllMatchesAction,precondition:Qp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:515}}));const LDt={[0]:" ",[1]:"u",[2]:"r"},Xde=65535,Wd=16777215,Yde=4278190080;class Z7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<Xde)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Z7(e.length),this._userDefinedStates=new Z7(e.length),this._recoveredStates=new Z7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=n&&this.getEndLineNumber(o)>=r};for(let n=0,r=this._startIndexes.length;nWd||s>Wd)throw new Error("startLineNumber or endLineNumber must not exceed "+Wd);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Wd}getEndLineNumber(e){return this._endIndexes[e]&Wd}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 n=!1;if(this._types)for(let r=0;r>>24)+((this._endIndexes[e]&Yde)>>>16);return t===Xde?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===0)return-1;for(;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;tArray.isArray(p)?v=>vv=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=o(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let m=l,v=u;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=s(++m)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class EDt{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 DDt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new ae,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new oc(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,r)=>n.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let r=0,o=-1,s=-1;const a=l=>{for(;rs&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;rn&&(n=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=oc.sanitizeAndMerge(this._regions,r,o);this.updatePost(oc.fromFoldRanges(s))}_getLinesChecksum(e,t){return a3(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&n.push(s),o++,r=s.parentIndex}}return n}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 n=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=r,a=this._regions.length;s1){const a=i.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c0)for(const o of n){const s=i.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);r.push(...s)}i.toggleCollapseState(r)}function IDt(i,e,t){const n=[];for(const r of t){const o=i.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&n.push(o[0])}i.toggleCollapseState(n)}function kDt(i,e,t,n){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function AEe(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const r=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function KQ(i,e,t){const n=i.textModel,r=i.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(n.getLineContent(a))&&o.push(r.toRegion(s))}i.toggleCollapseState(o)}function GQ(i,e,t){const n=i.regions,r=[];for(let o=n.length-1;o>=0;o--)t!==n.isCollapsed(o)&&e===n.getType(o)&&r.push(n.toRegion(o));i.toggleCollapseState(r)}function TDt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const r=n.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function NDt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let r=0;for(n!==-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===n)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.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function RDt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let r=0;if(n!==-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=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)return t.startLineNumber;t.regionIndexthis.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||n_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return Zde(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let r=null;const o=s=>((!r||!PDt(s,r))&&(r=Zde(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function PDt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function Zde(i,e){const t=pI(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const ADt=5e3,ODt="indent";class qQ{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=ODt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(WDt(this.editorModel,n,r,this.foldingRangesLimit))}}let FDt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>Wd||t>Wd)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)n[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new oc(n,r)}else{this._foldingRangesLimit.update(this._length,t);let n=0,r=this._indentOccurrences.length;for(let l=0;lt){r=l;break}n+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=$3(d,o);(h{}};function WDt(i,e,t,n=BDt){const r=i.getOptions().tabSize,o=new FDt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=$3(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(i)}const $Dt=X("editor.foldBackground",{light:Mt(ev,.3),dark:Mt(ev,.3),hcDark:null,hcLight:null},w("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);X("editorGutter.foldingControlForeground",{dark:xf,light:xf,hcDark:xf,hcLight:xf},w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const K5=Or("folding-expanded",tt.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),G5=Or("folding-collapsed",tt.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),OEe=Or("folding-manual-collapsed",G5,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),FEe=Or("folding-manual-expanded",K5,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),XQ={color:pr($Dt),position:kl.Inline},lx=w("linesCollapsed","Click to expand the range."),q5=w("linesExpanded","Click to collapse the range.");class qr{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?qr.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?qr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:qr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:qr.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?qr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:qr.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?qr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:qr.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?qr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:qr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?qr.MANUALLY_EXPANDED_VISUAL_DECORATION:qr.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}qr.COLLAPSED_VISUAL_DECORATION=an.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(G5)});qr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=an.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(G5)});qr.MANUALLY_COLLAPSED_VISUAL_DECORATION=an.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(OEe)});qr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=an.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(OEe)});qr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx});qr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx});qr.EXPANDED_VISUAL_DECORATION=an.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Vt.asClassName(K5),linesDecorationsTooltip:q5});qr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=an.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Vt.asClassName(K5),linesDecorationsTooltip:q5});qr.MANUALLY_EXPANDED_VISUAL_DECORATION=an.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Vt.asClassName(FEe),linesDecorationsTooltip:q5});qr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=an.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Vt.asClassName(FEe),linesDecorationsTooltip:q5});qr.NO_CONTROLS_EXPANDED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});qr.HIDDEN_RANGE_DECORATION=an.register({description:"folding-hidden-range-decoration",stickiness:1});const HDt={},VDt="syntax";class YQ{constructor(e,t,n,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=VDt,this.disposables=new Fe,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return zDt(this.providers,this.editorModel,e).then(t=>{var n,r;return t?jDt(t,this.foldingRangesLimit):(r=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function zDt(i,e,t){let n=null;const r=i.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,HDt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},eo));return Promise.all(r).then(o=>n)}class UDt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,r){if(e>Wd||t>Wd)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=n,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),n=new Uint32Array(this._length);for(let r=0;re){n=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new UDt(e);let r;const o=[];for(const s of t)if(!r)r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}n.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return n.toIndentRanges()}var KDt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},LL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},V1;const Ws=new ct("foldingEnabled",!1);let Jf=V1=class extends me{static get(e){return e.getContribution(V1.ID)}static getFoldingRangeProviders(e,t){var n,r;const o=e.foldingRangeProvider.ordered(t);return(r=(n=V1._foldingRangeSelector)===null||n===void 0?void 0:n.call(V1,o,t))!==null&&r!==void 0?r:o}constructor(e,t,n,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Fe),this.editor=e,this._foldingLimitReporter=new BEe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new qr(e),this.foldingDecorationProvider.showFoldingControls=a.get(110),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Ws.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(110)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(110),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(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 DDt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new MDt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new ad(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new mi(()=>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,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new qQ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=V1.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new YQ(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Fs,n=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=No(o=>n.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(ya.Imports.value,!0);u&&(s=wh.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(nn(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 n=this.editor.getSelections();if(n&&n.length>0){const r=[];for(const o of n){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(n[0].getPosition()))}}}).then(void 0,nn)}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 n=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;n=!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:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==n)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Jf.ID="editor.contrib.folding";Jf=V1=KDt([LL(1,Gt),LL(2,Ti),LL(3,zr),LL(4,_u),LL(5,yt)],Jf);class BEe{constructor(e){this.editor=e,this._onDidChange=new ae,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 ra extends pt{runEditorCommand(e,t,n){const r=e.get(Ti),o=Jf.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,n,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function WEe(i){if(!xl(i)){if(!ba(i))return!1;const e=i;if(!xl(e.levels)&&!Kv(e.levels)||!xl(e.direction)&&!Ea(e.direction)||!xl(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Kv)))return!1}return!0}class GDt extends ra{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Ws,kbOpts:{kbExpr:K.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: +`),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 Gde(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return qde(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 hK(null,this._contextViewProvider,{width:hDt,label:QEt,placeholder:JEt,appendCaseSensitiveLabel:this._keybindingLabelFor(Mi.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Mi.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Mi.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>Hde(this._keybindingService),inputBoxStyles:RO,toggleStyles:NO},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),ka&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new D1({label:eDt+this._keybindingLabelFor(Mi.PreviousMatchFindAction),icon:XEt,onTrigger:()=>{Ym(this._codeEditor.getAction(Mi.PreviousMatchFindAction)).run().then(void 0,nn)}})),this._nextBtn=this._register(new D1({label:tDt+this._keybindingLabelFor(Mi.NextMatchFindAction),icon:YEt,onTrigger:()=>{Ym(this._codeEditor.getAction(Mi.NextMatchFindAction)).run().then(void 0,nn)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new JS({icon:KEt,title:nDt+this._keybindingLabelFor(Mi.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ft(q0),inputActiveOptionBorder:ft(zY),inputActiveOptionForeground:ft(UY)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l=l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new D1({label:iDt+this._keybindingLabelFor(Mi.CloseFindWidgetCommand),icon:txe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new fK(null,void 0,{label:rDt,placeholder:oDt,appendPreserveCaseLabel:this._keybindingLabelFor(Mi.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Hde(this._keybindingService),inputBoxStyles:RO,toggleStyles:NO},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new D1({label:sDt+this._keybindingLabelFor(Mi.ReplaceOneAction),icon:GEt,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new D1({label:aDt+this._keybindingLabelFor(Mi.ReplaceAllAction),icon:qEt,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new D1({label:lDt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ha(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=ZEt,this._domNode.role="dialog",this._domNode.style.width=`${Kh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=this._register(new Is(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let a=Kh;this._register(this._resizeSash.onDidStart(()=>{a=ha(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cu||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ha(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ha(this._domNode);if(l{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var r,o;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,n)})}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(...Vt.asClassNameArray(Vde)),this._domNode.classList.add(...Vt.asClassNameArray(zde))):(this._domNode.classList.remove(...Vt.asClassNameArray(zde)),this._domNode.classList.add(...Vt.asClassNameArray(Vde)))}}vu((i,e)=>{const t=i.getColor(tv);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${sh(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const n=i.getColor(Rct);n&&e.addRule(`.monaco-editor .findScope { border: 1px ${sh(i.type)?"dashed":"solid"} ${n}; }`);const r=i.getColor(Ln);r&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`)});var TEe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gK;const gDt=524288;function pK(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const r=i.getConfiguredWordAtPosition(n.getStartPosition());if(r&&t===!1)return r.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!z5.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=vc(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const n={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const r=pK(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?n.searchString=vc(r):n.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=pK(this._editor,e.seedSearchStringFromSelection);r&&(n.searchString=r)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const r=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(n.searchString=r)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(n.searchScope=r)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new aD(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(w("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)}};Na.ID="editor.contrib.findController";Na=gK=TEe([Bd(1,Gt),Bd(2,md),Bd(3,Zp),Bd(4,zr)],Na);let mK=class extends Na{constructor(e,t,n,r,o,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const n=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=!!n&&n.startLineNumber!==n.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 j5(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new U5(this._editor,this._state,this._keybindingService))}};mK=TEe([Bd(1,og),Bd(2,Gt),Bd(3,ci),Bd(4,Mo),Bd(5,zr),Bd(6,md),Bd(7,Zp)],mK);const pDt=G1e(new K1e({id:Mi.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:Re.or(K.focus,Re.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:H.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));pDt.addImplementation(0,(i,e,t)=>{const n=Na.get(e);return n?n.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 mDt={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 vDt extends pt{constructor(){super({id:Mi.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:mDt})}async run(e,t,n){const r=Na.get(t);if(r){const o=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.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:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}}}class _Dt extends pt{constructor(){super({id:Mi.StartFindWithSelection,label:w("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 n=Na.get(t);n&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))}}class NEe extends pt{async run(e,t){const n=Na.get(t);n&&!this._run(n)&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.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(n))}}class bDt extends NEe{constructor(){super({id:Mi.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Re.and(K.focus,z5),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class CDt extends NEe{constructor(){super({id:Mi.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Re.and(K.focus,z5),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class yDt extends pt{constructor(){super({id:Mi.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Qp}),this._highlightDecorations=[]}run(e,t,n){const r=Na.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get(zr).notify({severity:U3.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Ph).createInputBox();a.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(n=>{this._highlightDecorations=n.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:pr(Gye),position:Cc.Full}}}])})}}class REe extends pt{async run(e,t){const n=Na.get(t);if(!n)return;const r=pK(t,"single",!1);r&&n.setSearchString(r),this._run(n)||(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class wDt extends REe{constructor(){super({id:Mi.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class SDt extends REe{constructor(){super({id:Mi.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const xDt=G1e(new K1e({id:Mi.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:Re.or(K.focus,Re.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:H.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));xDt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(91))return!1;const n=Na.get(e);if(!n)return!1;const r=e.getSelection(),o=n.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Kn(Na.ID,mK,0);Ke(vDt);Ke(_Dt);Ke(bDt);Ke(CDt);Ke(yDt);Ke(wDt);Ke(SDt);const Oh=zo.bindToContribution(Na.get);st(new Oh({id:Mi.CloseFindWidgetCommand,precondition:Qp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:9,secondary:[1033]}}));st(new Oh({id:Mi.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:H2.primary,mac:H2.mac,win:H2.win,linux:H2.linux}}));st(new Oh({id:Mi.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:V2.primary,mac:V2.mac,win:V2.win,linux:V2.linux}}));st(new Oh({id:Mi.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:z2.primary,mac:z2.mac,win:z2.win,linux:z2.linux}}));st(new Oh({id:Mi.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:U2.primary,mac:U2.mac,win:U2.win,linux:U2.linux}}));st(new Oh({id:Mi.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:j2.primary,mac:j2.mac,win:j2.win,linux:j2.linux}}));st(new Oh({id:Mi.ReplaceOneAction,precondition:Qp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:3094}}));st(new Oh({id:Mi.ReplaceOneAction,precondition:Qp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,zQ),primary:3}}));st(new Oh({id:Mi.ReplaceAllAction,precondition:Qp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:2563}}));st(new Oh({id:Mi.ReplaceAllAction,precondition:Qp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Re.and(K.focus,zQ),primary:void 0,mac:{primary:2051}}}));st(new Oh({id:Mi.SelectAllMatchesAction,precondition:Qp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:515}}));const LDt={[0]:" ",[1]:"u",[2]:"r"},Xde=65535,Wd=16777215,Yde=4278190080;class Z7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<Xde)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Z7(e.length),this._userDefinedStates=new Z7(e.length),this._recoveredStates=new Z7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=n&&this.getEndLineNumber(o)>=r};for(let n=0,r=this._startIndexes.length;nWd||s>Wd)throw new Error("startLineNumber or endLineNumber must not exceed "+Wd);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Wd}getEndLineNumber(e){return this._endIndexes[e]&Wd}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 n=!1;if(this._types)for(let r=0;r>>24)+((this._endIndexes[e]&Yde)>>>16);return t===Xde?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===0)return-1;for(;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;tArray.isArray(p)?v=>vv=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=o(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let m=l,v=u;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=s(++m)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class EDt{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 DDt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new ae,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new oc(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,r)=>n.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let r=0,o=-1,s=-1;const a=l=>{for(;rs&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;rn&&(n=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=oc.sanitizeAndMerge(this._regions,r,o);this.updatePost(oc.fromFoldRanges(s))}_getLinesChecksum(e,t){return a3(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&n.push(s),o++,r=s.parentIndex}}return n}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 n=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=r,a=this._regions.length;s1){const a=i.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c0)for(const o of n){const s=i.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);r.push(...s)}i.toggleCollapseState(r)}function IDt(i,e,t){const n=[];for(const r of t){const o=i.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&n.push(o[0])}i.toggleCollapseState(n)}function kDt(i,e,t,n){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function AEe(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const r=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function KQ(i,e,t){const n=i.textModel,r=i.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(n.getLineContent(a))&&o.push(r.toRegion(s))}i.toggleCollapseState(o)}function GQ(i,e,t){const n=i.regions,r=[];for(let o=n.length-1;o>=0;o--)t!==n.isCollapsed(o)&&e===n.getType(o)&&r.push(n.toRegion(o));i.toggleCollapseState(r)}function TDt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const r=n.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function NDt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let r=0;for(n!==-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===n)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.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function RDt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let r=0;if(n!==-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=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)return t.startLineNumber;t.regionIndexthis.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||i_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return Zde(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let r=null;const o=s=>((!r||!PDt(s,r))&&(r=Zde(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function PDt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function Zde(i,e){const t=pI(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const ADt=5e3,ODt="indent";class qQ{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=ODt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(WDt(this.editorModel,n,r,this.foldingRangesLimit))}}let FDt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>Wd||t>Wd)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)n[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new oc(n,r)}else{this._foldingRangesLimit.update(this._length,t);let n=0,r=this._indentOccurrences.length;for(let l=0;lt){r=l;break}n+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=$3(d,o);(h{}};function WDt(i,e,t,n=BDt){const r=i.getOptions().tabSize,o=new FDt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=$3(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(i)}const $Dt=X("editor.foldBackground",{light:Mt(ev,.3),dark:Mt(ev,.3),hcDark:null,hcLight:null},w("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);X("editorGutter.foldingControlForeground",{dark:xf,light:xf,hcDark:xf,hcLight:xf},w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const K5=Or("folding-expanded",tt.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),G5=Or("folding-collapsed",tt.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),OEe=Or("folding-manual-collapsed",G5,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),FEe=Or("folding-manual-expanded",K5,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),XQ={color:pr($Dt),position:kl.Inline},lx=w("linesCollapsed","Click to expand the range."),q5=w("linesExpanded","Click to collapse the range.");class qr{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?qr.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?qr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:qr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:qr.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?qr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:qr.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?qr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:qr.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?qr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:qr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?qr.MANUALLY_EXPANDED_VISUAL_DECORATION:qr.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}qr.COLLAPSED_VISUAL_DECORATION=an.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(G5)});qr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=an.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(G5)});qr.MANUALLY_COLLAPSED_VISUAL_DECORATION=an.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(OEe)});qr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=an.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx,firstLineDecorationClassName:Vt.asClassName(OEe)});qr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:lx});qr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:XQ,isWholeLine:!0,linesDecorationsTooltip:lx});qr.EXPANDED_VISUAL_DECORATION=an.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Vt.asClassName(K5),linesDecorationsTooltip:q5});qr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=an.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Vt.asClassName(K5),linesDecorationsTooltip:q5});qr.MANUALLY_EXPANDED_VISUAL_DECORATION=an.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Vt.asClassName(FEe),linesDecorationsTooltip:q5});qr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=an.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Vt.asClassName(FEe),linesDecorationsTooltip:q5});qr.NO_CONTROLS_EXPANDED_RANGE_DECORATION=an.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});qr.HIDDEN_RANGE_DECORATION=an.register({description:"folding-hidden-range-decoration",stickiness:1});const HDt={},VDt="syntax";class YQ{constructor(e,t,n,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=VDt,this.disposables=new Fe,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return zDt(this.providers,this.editorModel,e).then(t=>{var n,r;return t?jDt(t,this.foldingRangesLimit):(r=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function zDt(i,e,t){let n=null;const r=i.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,HDt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},eo));return Promise.all(r).then(o=>n)}class UDt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,r){if(e>Wd||t>Wd)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=n,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),n=new Uint32Array(this._length);for(let r=0;re){n=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new UDt(e);let r;const o=[];for(const s of t)if(!r)r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}n.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return n.toIndentRanges()}var KDt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},LL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},V1;const Ws=new ct("foldingEnabled",!1);let Jf=V1=class extends me{static get(e){return e.getContribution(V1.ID)}static getFoldingRangeProviders(e,t){var n,r;const o=e.foldingRangeProvider.ordered(t);return(r=(n=V1._foldingRangeSelector)===null||n===void 0?void 0:n.call(V1,o,t))!==null&&r!==void 0?r:o}constructor(e,t,n,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Fe),this.editor=e,this._foldingLimitReporter=new BEe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new qr(e),this.foldingDecorationProvider.showFoldingControls=a.get(110),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Ws.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(110)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(110),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(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 DDt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new MDt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new ad(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new mi(()=>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,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new qQ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=V1.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new YQ(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Fs,n=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=No(o=>n.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(ya.Imports.value,!0);u&&(s=wh.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(nn(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 n=this.editor.getSelections();if(n&&n.length>0){const r=[];for(const o of n){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(n[0].getPosition()))}}}).then(void 0,nn)}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 n=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;n=!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:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==n)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Jf.ID="editor.contrib.folding";Jf=V1=KDt([LL(1,Gt),LL(2,Ti),LL(3,zr),LL(4,_u),LL(5,yt)],Jf);class BEe{constructor(e){this.editor=e,this._onDidChange=new ae,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 ra extends pt{runEditorCommand(e,t,n){const r=e.get(Ti),o=Jf.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,n,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function WEe(i){if(!xl(i)){if(!ba(i))return!1;const e=i;if(!xl(e.levels)&&!Gv(e.levels)||!xl(e.direction)&&!Ea(e.direction)||!xl(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Gv)))return!1}return!0}class GDt extends ra{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Ws,kbOpts:{kbExpr:K.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. @@ -1197,43 +1197,43 @@ ${e.toString()}`}}class YO{constructor(e=new IT,t=!1,n,r=ACt){var o;this._servic * '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:WEe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,r){const o=this.getLineNumbers(r,n),s=r&&r.levels,a=r&&r.direction;typeof s!="number"&&typeof a!="string"?IDt(t,!0,o):a==="up"?PEe(t,!0,s||1,o):ax(t,!0,s||1,o)}}class YDt extends ra{constructor(){super({id:"editor.toggleFold",label:w("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2090),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);MEe(t,1,r)}}class ZDt extends ra{constructor(){super({id:"editor.foldRecursively",label:w("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2140),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);ax(t,!0,Number.MAX_VALUE,r)}}class QDt extends ra{constructor(){super({id:"editor.foldAllBlockComments",label:w("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2138),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+vc(a.blockCommentStartToken));KQ(t,l,!0)}}}}class JDt extends ra{constructor(){super({id:"editor.foldAllMarkerRegions",label:w("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2077),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);KQ(t,l,!0)}}}}class eIt extends ra{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:w("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2078),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);KQ(t,l,!1)}}}}class tIt extends ra{constructor(){super({id:"editor.foldAllExcept",label:w("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2136),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);AEe(t,!0,r)}}class nIt extends ra{constructor(){super({id:"editor.unfoldAllExcept",label:w("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2134),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);AEe(t,!1,r)}}class iIt extends ra{constructor(){super({id:"editor.foldAll",label:w("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2069),weight:100}})}invoke(e,t,n){ax(t,!0)}}class rIt extends ra{constructor(){super({id:"editor.unfoldAll",label:w("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2088),weight:100}})}invoke(e,t,n){ax(t,!1)}}class rC extends ra{getFoldingLevel(){return parseInt(this.id.substr(rC.ID_PREFIX.length))}invoke(e,t,n){kDt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}rC.ID_PREFIX="editor.foldLevel";rC.ID=i=>rC.ID_PREFIX+i;class oIt extends ra{constructor(){super({id:"editor.gotoParentFold",label:w("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=TDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class sIt extends ra{constructor(){super({id:"editor.gotoPreviousFold",label:w("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=NDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class aIt extends ra{constructor(){super({id:"editor.gotoNextFold",label:w("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=RDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class lIt extends ra{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:w("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2135),weight:100}})}invoke(e,t,n){var r;const o=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=oc.sanitizeAndMerge(t.regions,o,(r=n.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(oc.fromFoldRanges(a))}}}}class cIt extends ra{constructor(){super({id:"editor.removeManualFoldingRanges",label:w("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2137),weight:100}})}invoke(e,t,n){const r=n.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Kn(Jf.ID,Jf,0);Ke(GDt);Ke(qDt);Ke(XDt);Ke(ZDt);Ke(iIt);Ke(rIt);Ke(QDt);Ke(JDt);Ke(eIt);Ke(tIt);Ke(nIt);Ke(YDt);Ke(oIt);Ke(sIt);Ke(aIt);Ke(lIt);Ke(cIt);for(let i=1;i<=7;i++)mst(new rC({id:rC.ID(i),label:w("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2048|21+i),weight:100}}));kn.registerCommand("_executeFoldingRangeProvider",async function(i,...e){const[t]=e;if(!(t instanceof Ft))throw iu();const n=i.get(yt),r=i.get(rr).getModel(t);if(!r)throw iu();const o=i.get(mn);if(!o.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new qQ(r,s,l);let u=c;if(a!=="indentation"){const f=Jf.getFoldingRangeProviders(n,r);f.length&&(u=new YQ(r,f,()=>{},l,c))}const d=await u.compute(wn.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lD=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let mk=class{constructor(e,t,n,r){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._accessibilitySignalService=r,this._disposables=new Fe,this._sessionDisposables=new Fe,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(o=>{o.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 n=new qA;for(const r of t.autoFormatTriggerCharacters)n.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);n.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=new xr,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a{r.token.isCancellationRequested||Ms(s)&&(this._accessibilitySignalService.playSignal(dn.format,{userGesture:!1}),vS.execute(this._editor,s,!0))}).finally(()=>{o.dispose()})}};mk.ID="editor.contrib.autoFormat";mk=$Ee([lD(1,yt),lD(2,vd),lD(3,F_)],mk);let vk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Fe,this._callOnModel=new Fe,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(Ixe,this.editor,e,2,yp.None,wn.None,!1).catch(nn))}};vk.ID="editor.contrib.formatOnPaste";vk=$Ee([lD(1,yt),lD(2,Wt)],vk);class fIt extends pt{constructor(){super({id:"editor.action.formatDocument",label:w("formatDocument.label","Format Document"),alias:"Format Document",precondition:Re.and(K.notInCompositeEditor,K.writable,K.hasDocumentFormattingProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const n=e.get(Wt);await e.get(P_).showWhile(n.invokeFunction(jwt,t,1,yp.None,wn.None,!0),250)}}}class gIt extends pt{constructor(){super({id:"editor.action.formatSelection",label:w("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Re.and(K.writable,K.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2084),weight:100},contextMenuOpts:{when:K.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const n=e.get(Wt),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new W(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);await e.get(P_).showWhile(n.invokeFunction(Ixe,t,o,1,yp.None,wn.None,!0),250)}}Kn(mk.ID,mk,2);Kn(vk.ID,vk,2);Ke(fIt);Ke(gIt);kn.registerCommand("editor.action.format",async i=>{const e=i.get(jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(cr);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var pIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Q7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Ty{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=n;for(let o=0;t.children.get(r)!==void 0;o++)r=`${n}_${o}`;return r}static empty(e){return e.children.size===0}}class vK extends Ty{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class HEe extends Ty{constructor(e,t,n,r){super(),this.id=e,this.parent=t,this.label=n,this.order=r,this.children=new Map}}class Hg extends Ty{static create(e,t,n){const r=new xr(n),o=new Hg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=Ty.findId(`provider_${u}`,o),f=new HEe(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const p of g||[])Hg._makeOutlineElement(p,f);return f},g=>(eo(g),f)).then(g=>{Ty.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);lr(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!n.isCancellationRequested?Hg.create(e,t,n):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const n=Ty.findId(e,t),r=new vK(n,t,e);if(e.children)for(const o of e.children)Hg._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=In.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof vK?e.push(t.symbol):e.push(...In.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>W.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Hg._flattenDocumentSymbols(t,e,""),t.sort((n,r)=>le.compare(W.getStartPosition(n.range),W.getStartPosition(r.range))||le.compare(W.getEndPosition(r.range),W.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||n,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&Hg._flattenDocumentSymbols(e,r.children,r.name)}}const ZT=Sn("IOutlineModelService");let _K=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Fe,this._cache=new N_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const n=this._languageFeaturesService.documentSymbolProvider,r=n.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!lr(o.provider,r)){const a=new xr;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:Hg.create(n,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{s.dispose()}}};_K=pIt([Q7(0,yt),Q7(1,_u),Q7(2,rr)],_K);Tn(ZT,_K,1);kn.registerCommand("_executeDocumentSymbolProvider",async function(i,...e){const[t]=e;Yn(Ft.isUri(t));const n=i.get(ZT),o=await i.get(ul).createModelReference(t);try{return(await n.getOrCreate(o.object.textEditorModel,wn.None)).getTopLevelSymbols()}finally{o.dispose()}});class Ho extends me{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Ho.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Ho.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Ho.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Ho.suppressSuggestions.bindTo(this.contextKeyService),this._register(yn(n=>{const r=this.model.read(n),o=r==null?void 0:r.state.read(n),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.primaryGhostText)!==void 0&&!(o!=null&&o.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.primaryGhostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(yn(n=>{const r=this.model.read(n);let o=!1,s=!0;const a=r==null?void 0:r.primaryGhostText.read(n);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Js(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=_o.visibleColumnFromColumn(u,f+1,g){const o=W.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});n.sort((r,o)=>o.startOffset-r.startOffset);for(const r of n)i=i.substring(0,r.startOffset)+r.text+i.substring(r.endOffset);return i}class vIt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Zi(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new W(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function zEe(i,e){const t=new Fe,n=i.createDecorationsCollection();return t.add(_5({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function X5(i,e){return new le(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function Qde(i,e){return new le(i.lineNumber-e.lineNumber+1,i.lineNumber-e.lineNumber===0?i.column-e.column+1:i.column)}function ZQ(i){let e=1,t=1;for(const n of i)n===` + `,constraint:WEe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,r){const o=this.getLineNumbers(r,n),s=r&&r.levels,a=r&&r.direction;typeof s!="number"&&typeof a!="string"?IDt(t,!0,o):a==="up"?PEe(t,!0,s||1,o):ax(t,!0,s||1,o)}}class YDt extends ra{constructor(){super({id:"editor.toggleFold",label:w("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2090),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);MEe(t,1,r)}}class ZDt extends ra{constructor(){super({id:"editor.foldRecursively",label:w("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2140),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);ax(t,!0,Number.MAX_VALUE,r)}}class QDt extends ra{constructor(){super({id:"editor.foldAllBlockComments",label:w("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2138),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+vc(a.blockCommentStartToken));KQ(t,l,!0)}}}}class JDt extends ra{constructor(){super({id:"editor.foldAllMarkerRegions",label:w("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2077),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);KQ(t,l,!0)}}}}class eIt extends ra{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:w("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2078),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())GQ(t,ya.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);KQ(t,l,!1)}}}}class tIt extends ra{constructor(){super({id:"editor.foldAllExcept",label:w("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2136),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);AEe(t,!0,r)}}class nIt extends ra{constructor(){super({id:"editor.unfoldAllExcept",label:w("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2134),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);AEe(t,!1,r)}}class iIt extends ra{constructor(){super({id:"editor.foldAll",label:w("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2069),weight:100}})}invoke(e,t,n){ax(t,!0)}}class rIt extends ra{constructor(){super({id:"editor.unfoldAll",label:w("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2088),weight:100}})}invoke(e,t,n){ax(t,!1)}}class oC extends ra{getFoldingLevel(){return parseInt(this.id.substr(oC.ID_PREFIX.length))}invoke(e,t,n){kDt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}oC.ID_PREFIX="editor.foldLevel";oC.ID=i=>oC.ID_PREFIX+i;class oIt extends ra{constructor(){super({id:"editor.gotoParentFold",label:w("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=TDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class sIt extends ra{constructor(){super({id:"editor.gotoPreviousFold",label:w("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=NDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class aIt extends ra{constructor(){super({id:"editor.gotoNextFold",label:w("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=RDt(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class lIt extends ra{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:w("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2135),weight:100}})}invoke(e,t,n){var r;const o=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=oc.sanitizeAndMerge(t.regions,o,(r=n.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(oc.fromFoldRanges(a))}}}}class cIt extends ra{constructor(){super({id:"editor.removeManualFoldingRanges",label:w("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2137),weight:100}})}invoke(e,t,n){const r=n.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Kn(Jf.ID,Jf,0);Ke(GDt);Ke(qDt);Ke(XDt);Ke(ZDt);Ke(iIt);Ke(rIt);Ke(QDt);Ke(JDt);Ke(eIt);Ke(tIt);Ke(nIt);Ke(YDt);Ke(oIt);Ke(sIt);Ke(aIt);Ke(lIt);Ke(cIt);for(let i=1;i<=7;i++)mst(new oC({id:oC.ID(i),label:w("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Ws,kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2048|21+i),weight:100}}));kn.registerCommand("_executeFoldingRangeProvider",async function(i,...e){const[t]=e;if(!(t instanceof Ft))throw iu();const n=i.get(yt),r=i.get(or).getModel(t);if(!r)throw iu();const o=i.get(mn);if(!o.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new qQ(r,s,l);let u=c;if(a!=="indentation"){const f=Jf.getFoldingRangeProviders(n,r);f.length&&(u=new YQ(r,f,()=>{},l,c))}const d=await u.compute(wn.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lD=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let mk=class{constructor(e,t,n,r){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._accessibilitySignalService=r,this._disposables=new Fe,this._sessionDisposables=new Fe,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(o=>{o.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 n=new qA;for(const r of t.autoFormatTriggerCharacters)n.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);n.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=new xr,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a{r.token.isCancellationRequested||Ms(s)&&(this._accessibilitySignalService.playSignal(dn.format,{userGesture:!1}),vS.execute(this._editor,s,!0))}).finally(()=>{o.dispose()})}};mk.ID="editor.contrib.autoFormat";mk=$Ee([lD(1,yt),lD(2,vd),lD(3,B_)],mk);let vk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Fe,this._callOnModel=new Fe,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(Ixe,this.editor,e,2,yp.None,wn.None,!1).catch(nn))}};vk.ID="editor.contrib.formatOnPaste";vk=$Ee([lD(1,yt),lD(2,Wt)],vk);class fIt extends pt{constructor(){super({id:"editor.action.formatDocument",label:w("formatDocument.label","Format Document"),alias:"Format Document",precondition:Re.and(K.notInCompositeEditor,K.writable,K.hasDocumentFormattingProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const n=e.get(Wt);await e.get(A_).showWhile(n.invokeFunction(jwt,t,1,yp.None,wn.None,!0),250)}}}class gIt extends pt{constructor(){super({id:"editor.action.formatSelection",label:w("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Re.and(K.writable,K.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:fo(2089,2084),weight:100},contextMenuOpts:{when:K.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const n=e.get(Wt),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new W(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);await e.get(A_).showWhile(n.invokeFunction(Ixe,t,o,1,yp.None,wn.None,!0),250)}}Kn(mk.ID,mk,2);Kn(vk.ID,vk,2);Ke(fIt);Ke(gIt);kn.registerCommand("editor.action.format",async i=>{const e=i.get(jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(cr);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var pIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Q7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Ty{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=n;for(let o=0;t.children.get(r)!==void 0;o++)r=`${n}_${o}`;return r}static empty(e){return e.children.size===0}}class vK extends Ty{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class HEe extends Ty{constructor(e,t,n,r){super(),this.id=e,this.parent=t,this.label=n,this.order=r,this.children=new Map}}class Hg extends Ty{static create(e,t,n){const r=new xr(n),o=new Hg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=Ty.findId(`provider_${u}`,o),f=new HEe(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const p of g||[])Hg._makeOutlineElement(p,f);return f},g=>(eo(g),f)).then(g=>{Ty.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);lr(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!n.isCancellationRequested?Hg.create(e,t,n):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const n=Ty.findId(e,t),r=new vK(n,t,e);if(e.children)for(const o of e.children)Hg._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=In.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof vK?e.push(t.symbol):e.push(...In.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>W.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Hg._flattenDocumentSymbols(t,e,""),t.sort((n,r)=>le.compare(W.getStartPosition(n.range),W.getStartPosition(r.range))||le.compare(W.getEndPosition(r.range),W.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||n,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&Hg._flattenDocumentSymbols(e,r.children,r.name)}}const ZT=Sn("IOutlineModelService");let _K=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Fe,this._cache=new R_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const n=this._languageFeaturesService.documentSymbolProvider,r=n.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!lr(o.provider,r)){const a=new xr;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:Hg.create(n,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{s.dispose()}}};_K=pIt([Q7(0,yt),Q7(1,_u),Q7(2,or)],_K);Tn(ZT,_K,1);kn.registerCommand("_executeDocumentSymbolProvider",async function(i,...e){const[t]=e;Yn(Ft.isUri(t));const n=i.get(ZT),o=await i.get(ul).createModelReference(t);try{return(await n.getOrCreate(o.object.textEditorModel,wn.None)).getTopLevelSymbols()}finally{o.dispose()}});class Ho extends me{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Ho.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Ho.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Ho.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Ho.suppressSuggestions.bindTo(this.contextKeyService),this._register(yn(n=>{const r=this.model.read(n),o=r==null?void 0:r.state.read(n),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.primaryGhostText)!==void 0&&!(o!=null&&o.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.primaryGhostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(yn(n=>{const r=this.model.read(n);let o=!1,s=!0;const a=r==null?void 0:r.primaryGhostText.read(n);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Js(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=_o.visibleColumnFromColumn(u,f+1,g){const o=W.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});n.sort((r,o)=>o.startOffset-r.startOffset);for(const r of n)i=i.substring(0,r.startOffset)+r.text+i.substring(r.endOffset);return i}class vIt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Qi(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new W(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function zEe(i,e){const t=new Fe,n=i.createDecorationsCollection();return t.add(_5({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function X5(i,e){return new le(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function Qde(i,e){return new le(i.lineNumber-e.lineNumber+1,i.lineNumber-e.lineNumber===0?i.column-e.column+1:i.column)}function ZQ(i){let e=1,t=1;for(const n of i)n===` `?(e++,t=1):t++;return new le(e,t)}function CIt(i){var e;const t=[];let n=0,r=0,o=0;for(const s of i){const a=(e=s.text)!==null&&e!==void 0?e:"",l=ZQ(a),c=le.lift({lineNumber:s.range.startLineNumber+r,column:s.range.startColumn+(s.range.startLineNumber===n?o:0)}),u=X5(c,l);t.push(W.fromPositions(c,u)),r+=l.lineNumber-s.range.endLineNumber+s.range.startLineNumber-1,o=u.column-s.range.endColumn,n=s.range.endLineNumber}return t}class _F{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const n=Array.from(e.keys()).sort((r,o)=>t(e[r],e[o]));return new _F(n)}apply(e){return e.map((t,n)=>e[this._indexMap[n]])}inverse(){const e=this._indexMap.slice();for(let t=0;tt.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return mIt(n,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(` `)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class bF{constructor(e,t,n){this.column=e,this.text=t,this.preview=n,this.lines=ng(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class bK{constructor(e,t,n,r=0){this.lineNumber=e,this.columnRange=t,this.text=n,this.additionalReservedLineCount=r,this.parts=[new bF(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=ng(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,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function Jde(i,e){return lr(i,e,UEe)}function UEe(i,e){return i===e?!0:!i||!e?!1:i instanceof _k&&e instanceof _k||i instanceof bK&&e instanceof bK?i.equals(e):!1}var yIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ehe="ghost-text";let CK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Vn(this,!1),this.currentTextModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=en(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof bK?s.columnRange:void 0,l=[],c=[];function u(p,m){if(c.length>0){const v=c[c.length-1];m&&v.decorations.push(new wa(v.content.length+1,v.content.length+1+p[0].length,m,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)c.push({content:v,decorations:m?[new wa(1,v.length+1,m,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let m=p.lines;h===void 0?(l.push({column:p.column,text:m[0],preview:p.preview}),m=m.slice(1)):u([d.substring(f,p.column-1)],void 0),m.length>0&&(u(m,ehe),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new VEe(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=en(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:W.fromPositions(new le(o.lineNumber,a.column)),options:{description:ehe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:qu.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new jEe(this.editor,this.languageService.languageIdCodec,en(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ot(()=>{this.isDisposed.set(!0,void 0)})),this._register(zEe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};CK=yIt([wIt(2,qi)],CK);class jEe extends me{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=_a("editorOptionChanged",ot.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(117)||r.hasChanged(99)||r.hasChanged(94)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(67))),this._register(yn(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,n){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");SIt(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function SIt(i,e,t,n,r){const o=n.get(33),s=n.get(117),a="none",l=n.get(94),c=n.get(51),u=n.get(50),d=n.get(67),h=new KS(1e4);h.appendString('

');for(let p=0,m=t.length;p');const y=hT(_),S=Uw(_),L=Io.createEmpty(_,r);bT(new R_(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,_,!1,y,S,0,L,v.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==ac.OFF,null),h),h.appendString("
")}h.appendString(""),vs(i,u);const f=h.build(),g=the?the.createHTML(f):f;i.innerHTML=g}const the=Gp("editorGhostText",{createHTML:i=>i});function xIt(i,e){const t=new gwe,n=new mwe(t,c=>e.getLanguageConfiguration(c)),r=new pwe(new LIt([i]),n),o=Bz(r,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=mr(u,c.openingBracket.length),c.child&&(l(c.child,u),u=mr(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=mr(u,c.closingBracket.length);else{const h=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,mr(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=mr(u,d.length)}}return l(o,Sa),s}class LIt{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 EIt(i,e,t,n,r=wn.None,o){const s=kIt(e,t),a=i.all(t),l=new MY;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const _=[];for(const y of v.yieldsToGroupIds||[]){const S=l.get(y);for(const L of S)_.push(L)}return _}const u=new Map,d=new Set;function h(v,_){if(_=[..._,v],d.has(v))return _;d.add(v);try{const y=c(v);for(const S of y){const L=h(S,_);if(L)return L}}finally{d.delete(v)}}function f(v){const _=u.get(v);if(_)return _;const y=h(v,[]);y&&eo(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const S=new s3;return u.set(v,S.p),(async()=>{if(!y){const L=c(v);for(const E of L){const D=await f(E);if(D&&D.items.length>0)return}}try{return await v.provideInlineCompletions(t,e,n,r)}catch(L){eo(L);return}})().then(L=>S.complete(L),L=>S.error(L)),S.p}const g=await Promise.all(a.map(async v=>({provider:v,completions:await f(v)}))),p=new Map,m=[];for(const v of g){const _=v.completions;if(!_)continue;const y=new IIt(_,v.provider);m.push(y);for(const S of _.items){const L=CF.from(S,y,s,t,o);p.set(L.hash(),L)}}return new DIt(Array.from(p.values()),new Set(p.keys()),m)}class DIt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class IIt{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 CF{static from(e,t,n,r,o){let s,a,l=e.range?W.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=nhe(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=nhe(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new Zb().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof va?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else y3(e.insertText);return new CF(s,e.command,l,s,a,e.additionalTextEdits||bIt(),e,t)}constructor(e,t,n,r,o,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` +`)}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,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function Jde(i,e){return lr(i,e,UEe)}function UEe(i,e){return i===e?!0:!i||!e?!1:i instanceof _k&&e instanceof _k||i instanceof bK&&e instanceof bK?i.equals(e):!1}var yIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ehe="ghost-text";let CK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Vn(this,!1),this.currentTextModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=en(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof bK?s.columnRange:void 0,l=[],c=[];function u(p,m){if(c.length>0){const v=c[c.length-1];m&&v.decorations.push(new wa(v.content.length+1,v.content.length+1+p[0].length,m,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)c.push({content:v,decorations:m?[new wa(1,v.length+1,m,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let m=p.lines;h===void 0?(l.push({column:p.column,text:m[0],preview:p.preview}),m=m.slice(1)):u([d.substring(f,p.column-1)],void 0),m.length>0&&(u(m,ehe),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new VEe(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=en(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:W.fromPositions(new le(o.lineNumber,a.column)),options:{description:ehe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:qu.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new jEe(this.editor,this.languageService.languageIdCodec,en(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ot(()=>{this.isDisposed.set(!0,void 0)})),this._register(zEe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};CK=yIt([wIt(2,qi)],CK);class jEe extends me{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=_a("editorOptionChanged",ot.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(117)||r.hasChanged(99)||r.hasChanged(94)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(67))),this._register(yn(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,n){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");SIt(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function SIt(i,e,t,n,r){const o=n.get(33),s=n.get(117),a="none",l=n.get(94),c=n.get(51),u=n.get(50),d=n.get(67),h=new KS(1e4);h.appendString('
');for(let p=0,m=t.length;p');const y=hT(_),S=Uw(_),L=Io.createEmpty(_,r);bT(new M_(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,_,!1,y,S,0,L,v.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==ac.OFF,null),h),h.appendString("
")}h.appendString(""),vs(i,u);const f=h.build(),g=the?the.createHTML(f):f;i.innerHTML=g}const the=Gp("editorGhostText",{createHTML:i=>i});function xIt(i,e){const t=new gwe,n=new mwe(t,c=>e.getLanguageConfiguration(c)),r=new pwe(new LIt([i]),n),o=Bz(r,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=mr(u,c.openingBracket.length),c.child&&(l(c.child,u),u=mr(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=mr(u,c.closingBracket.length);else{const h=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,mr(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=mr(u,d.length)}}return l(o,Sa),s}class LIt{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 EIt(i,e,t,n,r=wn.None,o){const s=kIt(e,t),a=i.all(t),l=new MY;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const _=[];for(const y of v.yieldsToGroupIds||[]){const S=l.get(y);for(const L of S)_.push(L)}return _}const u=new Map,d=new Set;function h(v,_){if(_=[..._,v],d.has(v))return _;d.add(v);try{const y=c(v);for(const S of y){const L=h(S,_);if(L)return L}}finally{d.delete(v)}}function f(v){const _=u.get(v);if(_)return _;const y=h(v,[]);y&&eo(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const S=new s3;return u.set(v,S.p),(async()=>{if(!y){const L=c(v);for(const E of L){const D=await f(E);if(D&&D.items.length>0)return}}try{return await v.provideInlineCompletions(t,e,n,r)}catch(L){eo(L);return}})().then(L=>S.complete(L),L=>S.error(L)),S.p}const g=await Promise.all(a.map(async v=>({provider:v,completions:await f(v)}))),p=new Map,m=[];for(const v of g){const _=v.completions;if(!_)continue;const y=new IIt(_,v.provider);m.push(y);for(const S of _.items){const L=CF.from(S,y,s,t,o);p.set(L.hash(),L)}}return new DIt(Array.from(p.values()),new Set(p.keys()),m)}class DIt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class IIt{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 CF{static from(e,t,n,r,o){let s,a,l=e.range?W.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=nhe(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=nhe(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new Qb().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof va?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else y3(e.insertText);return new CF(s,e.command,l,s,a,e.additionalTextEdits||bIt(),e,t)}constructor(e,t,n,r,o,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),r=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new CF(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function kIt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new W(i.lineNumber,t.startColumn,i.lineNumber,n):W.fromPositions(i,i.with(void 0,n))}function nhe(i,e,t,n){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?xIt(a,n):i}class v_{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const r=e.getValueInRange(n,1),o=qv(r,this.text),s=X5(this.range.getStartPosition(),ZQ(r.substring(0,o))),a=this.text.substring(o),l=W.fromPositions(s,this.range.getEndPosition());return new v_(l,a)}augments(e){return this.text.startsWith(e.text)&&TIt(this.range,e.range)}computeGhostText(e,t,n,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=yi(s).length;if(o.range.startColumn-1<=a){const g=yi(o.text).length,p=s.substring(o.range.startColumn-1,a),[m,v]=[o.range.getStartPosition(),o.range.getEndPosition()],_=m.column+p.length<=v.column?m.delta(0,p.length):v,y=W.fromPositions(_,v),S=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new v_(y,S)}const c=e.getValueInRange(o.range),u=NIt(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const m=g.modifiedStart+g.modifiedLength,v=Math.max(g.modifiedStart,Math.min(m,f)),_=o.text.substring(g.modifiedStart,v),y=o.text.substring(v,Math.max(g.modifiedStart,m));_.length>0&&h.push(new bF(p,_,!1)),y.length>0&&h.push(new bF(p,y,!0))}return new _k(d,h)}}function TIt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let Gh;function NIt(i,e){if((Gh==null?void 0:Gh.originalValue)===i&&(Gh==null?void 0:Gh.newValue)===e)return Gh==null?void 0:Gh.changes;{let t=rhe(i,e,!0);if(t){const n=ihe(t);if(n>0){const r=rhe(i,e,!1);r&&ihe(r)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const r=Math.max(n(i),n(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var RIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ohe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let yK=class extends me{constructor(e,t,n,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Vo),this.inlineCompletions=nk("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=nk("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var r,o;const s=new PIt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new xr,u=(async()=>{if((l||t.triggerKind===_p.Automatic)&&await MIt(this._debounceValue.get(this.textModel),c.token),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=await EIt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const m=new FIt(g,s,this.textModel,this.versionId);if(n){const v=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(v)&&m.prepend(n.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),Pi(v=>{a.set(m,v)}),!0})(),d=new OIt(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};yK=RIt([ohe(3,yt),ohe(4,Ti)],yK);function MIt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class PIt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&AIt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===_p.Automatic||this.context.triggerKind===_p.Explicit)&&this.versionId===e.versionId}}function AIt(i,e,t){return!i||!e?i===e:t(i,e)}class OIt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class FIt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=en(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new she(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,n){n&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new she(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class she{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new v_(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const r=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1),s=r.text,a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!Qwe(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new v_(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return ahe(this._getUpdatedRange(e)).isBefore(ahe(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function ahe(i){return i.startLineNumber===i.endLineNumber?new le(1,1+i.endColumn-i.startColumn):new le(1+i.endLineNumber-i.startLineNumber,i.endColumn)}const un={Visible:UQ,HasFocusedSuggestion:new ct("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new ct("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new ct("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new ct("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new ct("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new ct("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new ct("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new ct("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Bv=new H("suggestWidgetStatusBar");class BIt{constructor(e,t,n,r){var o;this.position=e,this.completion=t,this.container=n,this.provider=r,this.isInvalid=!1,this.score=ah.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,W.isIRange(t.range)?(this.editStart=new le(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new le(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new le(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new le(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new le(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new le(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range.insert)||W.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}),n=new Fs(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=n.elapsed()},r=>{Th(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class bk{constructor(e=2,t=new Set,n=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=r,this.showDeprecated=o}}bk.default=new bk;let WIt;function $It(){return WIt}class HIt{constructor(e,t,n,r){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=r}}async function QQ(i,e,t,n=bk.default,r={triggerKind:0},o=wn.None){const s=new Fs;t=t.clone();const a=e.getWordAtPosition(t),l=a?new W(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):W.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Fe,h=[];let f=!1;const g=(m,v,_)=>{var y,S,L;let E=!1;if(!v)return E;for(const D of v.suggestions)if(!n.kindFilter.has(D.kind)){if(!n.showDeprecated&&(!((y=D==null?void 0:D.tags)===null||y===void 0)&&y.includes(1)))continue;D.range||(D.range=c),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=Zb.guessNeedsClipboard(D.insertText)),u.push(new BIt(t,D,v,m)),E=!0}return tY(v)&&d.add(v),h.push({providerName:(S=m._debugDisplayName)!==null&&S!==void 0?S:"unknown_provider",elapsedProvider:(L=v.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),E},p=(async()=>{})();for(const m of i.orderedGroups(e)){let v=!1;if(await Promise.all(m.map(async _=>{if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(S=>u.push(S)),v=v||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Fs,S=await _.provideCompletionItems(e,t,r,o);v=g(_,S,y)||v}catch(y){eo(y)}})),v||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(d.dispose(),Promise.reject(new k_)):new HIt(u.sort(UIt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)}function JQ(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function VIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return JQ(i,e)}function zIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return JQ(i,e)}const Y5=new Map;Y5.set(0,VIt);Y5.set(2,zIt);Y5.set(1,JQ);function UIt(i){return Y5.get(i)}kn.registerCommand("_executeCompletionItemProvider",async(i,...e)=>{const[t,n,r,o]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string"||!r),Yn(typeof o=="number"||!o);const{completionProvider:s}=i.get(yt),a=await i.get(ul).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=await QQ(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(wn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}});function jIt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Ny{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 lhe(i,e=Os){return zft(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var KIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},GIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class che{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class uhe{constructor(e,t,n,r){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(n=o.value,r=o.multiline)}if(n&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=yi(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof va&&(a=yi(ng(c.value).pop())),!0));const l=qv(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 dhe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Lv(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=Lv(this._model.uri.fsPath),r=n.lastIndexOf(".");return r<=0?n:n.slice(0,r)}else{if(t==="TM_DIRECTORY")return QCe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(V3(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 hhe{constructor(e,t,n,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(r=>!o1e(r));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let yF=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(n).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}}};yF=KIt([GIt(2,Ti)],yF);class Qd{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 Qd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Qd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Qd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Qd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),r=n>0?"-":"+",o=Math.trunc(Math.abs(n/60)),s=o<10?"0"+o:o,a=Math.abs(n)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}Qd.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")];Qd.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")];Qd.monthNames=[w("January","January"),w("February","February"),w("March","March"),w("April","April"),w("May","May"),w("June","June"),w("July","July"),w("August","August"),w("September","September"),w("October","October"),w("November","November"),w("December","December")];Qd.monthNamesShort=[w("JanuaryShort","Jan"),w("FebruaryShort","Feb"),w("MarchShort","Mar"),w("AprilShort","Apr"),w("MayShort","May"),w("JuneShort","Jun"),w("JulyShort","Jul"),w("AugustShort","Aug"),w("SeptemberShort","Sep"),w("OctoberShort","Oct"),w("NovemberShort","Nov"),w("DecemberShort","Dec")];class fhe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=t_t(this._workspaceService.getWorkspace());if(!Qvt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(vU(e))return Lv(e.uri.path);let t=Lv(e.configPath.path);return t.endsWith(_U)&&(t=t.substr(0,t.length-_U.length-1)),t}_resoveWorkspacePath(e){if(vU(e))return lhe(e.uri.fsPath);const t=Lv(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?lhe(n):"/"}}class ghe{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 T5()}}var qIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kd;class Vc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Ise(t.placeholders,jc.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 n of this._snippet.placeholders){const r=this._snippet.offset(n),o=this._snippet.fullLen(n),s=W.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=n.isFinalTabstop?Vc._decor.inactiveFinal:Vc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new Et(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Vc._decor.activeFinal:Vc._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Vc._decor.activeFinal:Vc._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Vc._decor.inactiveFinal:Vc._decor.inactive);return s});return t?this.move(e):n??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof jc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const r of t){if(r.isFinalTabstop)break;n||(n=[],e.set(r.index,n));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof sx,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);n.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=W.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=n.addDecoration(d,Vc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=Ise(this._snippet.placeholders,jc.compareByIndex)})}}Vc._decor={active:an.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:an.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:an.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:an.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const phe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let wF=kd=class{static adjustWhitespace(e,t,n,r,o){const s=e.getLineContent(t.lineNumber),a=yi(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof va)||c.parent instanceof sx||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fS.get(jb)),g=e.invokeWithinContext(S=>new dhe(S.get(lS),h)),p=()=>a,m=h.getValueInRange(kd.adjustSelection(h,e.getSelection(),n,0)),v=h.getValueInRange(kd.adjustSelection(h,e.getSelection(),0,r)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((S,L)=>({selection:S,idx:L})).sort((S,L)=>W.compareRangesUsingStarts(S.selection,L.selection));for(const{selection:S,idx:L}of y){let E=kd.adjustSelection(h,S,n,0),D=kd.adjustSelection(h,S,0,r);m!==h.getValueInRange(E)&&(E=S),v!==h.getValueInRange(D)&&(D=S);const k=S.setStartPosition(E.startLineNumber,E.startColumn).setEndPosition(D.endLineNumber,D.endColumn),T=new Zb().parse(t,!0,o),M=k.getStartPosition(),P=kd.adjustWhitespace(h,M,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(S.positionLineNumber),T);T.resolveVariables(new che([g,new hhe(p,L,y.length,e.getOption(79)==="spread"),new uhe(h,S,L,l),new yF(h,S,c),new Qd,new fhe(f),new ghe])),u[L]=Qi.replace(k,T.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new Vc(e,T,P)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new Zb,d=new UT,h=new che([e.invokeWithinContext(g=>new dhe(g.get(lS),c)),new hhe(()=>o,0,e.getSelections().length,e.getOption(79)==="spread"),new uhe(c,e.getSelection(),0,s),new yF(c,e.getSelection(),a),new Qd,new fhe(e.invokeWithinContext(g=>g.get(jb))),new ghe]);t=t.sort((g,p)=>W.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,E=W.fromPositions(L.getEndPosition(),p.getStartPosition()),D=new va(c.getValueInRange(E));d.appendChild(D),f+=D.value.length}const v=u.parseFragment(m,d);kd.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(v)),d.resolveVariables(h);const _=d.toString(),y=_.slice(f);f=_.length;const S=Qi.replace(p,y);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new Vc(e,d,"")]}}constructor(e,t,n=phe,r){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){si(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"?kd.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):kd.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,n=>{const r=n.filter(o=>!!o.identifier);for(let o=0;oEt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=phe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:r}=kd.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;lEt.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 n of this._snippets){const r=n.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{o.push(...r.get(s))})}e.sort(W.compareRangesUsingStarts);for(const[n,r]of t){if(r.length!==e.length){t.delete(n);continue}r.sort(W.compareRangesUsingStarts);for(let o=0;o0}};wF=kd=qIt([XIt(3,Ti)],wF);var YIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},q2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},z1;const mhe={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let is=z1=class{static get(e){return e.getContribution(z1.ID)}constructor(e,t,n,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=o,this._snippetListener=new Fe,this._modelVersionId=-1,this._inSnippet=z1.InSnippetMode.bindTo(r),this._hasNextTabstop=z1.HasNextTabstop.bindTo(r),this._hasPrevTabstop=z1.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?mhe:{...mhe,...t})}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Yn(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new wF(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!le.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(m=>m.value===f),p=[];for(let m=0;m{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{jIt(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};is.ID="snippetController2";is.InSnippetMode=new ct("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode"));is.HasNextTabstop=new ct("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));is.HasPrevTabstop=new ct("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));is=z1=YIt([q2(1,Ra),q2(2,yt),q2(3,Gt),q2(4,Ti)],is);Kn(is.ID,is,4);const Z5=zo.bindToContribution(is.get);st(new Z5({id:"jumpToNextSnippetPlaceholder",precondition:Re.and(is.InSnippetMode,is.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:2}}));st(new Z5({id:"jumpToPrevSnippetPlaceholder",precondition:Re.and(is.InSnippetMode,is.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:1026}}));st(new Z5({id:"leaveSnippet",precondition:is.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:9,secondary:[1033]}}));st(new Z5({id:"acceptSnippet",precondition:is.InSnippetMode,handler:i=>i.finish()}));var ZIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ql;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Ql||(Ql={}));let wK=class extends me{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=n,this._positions=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(yK,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Vn(this,!1),this._forceUpdateSignal=cQ("forceUpdate"),this._selectedInlineCompletionId=Vn(this,void 0),this._primaryPosition=en(this,g=>{var p;return(p=this._positions.read(g)[0])!==null&&p!==void 0?p:new le(1,1)}),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Ql.Redo,Ql.Undo,Ql.AcceptWord]),this._fetchInlineCompletions=c1t({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:_p.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdateSignal)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdateSignal.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.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||v!=null&&v.forwardStable?v:void 0,y=this._source.suggestWidgetInlineCompletions.get(),S=this.selectedSuggestItem.read(g);if(y&&!S){const D=this._source.inlineCompletions.get();Pi(k=>{(!D||y.request.versionId>D.request.versionId)&&this._source.inlineCompletions.set(y.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const L=this._primaryPosition.read(g),E={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:S==null?void 0:S.toSelectedSuggestionInfo()};return this._source.fetch(L,E,_)}),this._filteredInlineCompletionItems=en(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const m=this._primaryPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,m,g))}),this.selectedInlineCompletionIndex=en(this,g=>{const p=this._selectedInlineCompletionId.read(g),m=this._filteredInlineCompletionItems.read(g),v=this._selectedInlineCompletionId===void 0?-1:m.findIndex(_=>_.semanticId===p);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=en(this,g=>{const p=this._filteredInlineCompletionItems.read(g),m=this.selectedInlineCompletionIndex.read(g);return p[m]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=en(this,g=>{if(this.lastTriggerKind.read(g)===_p.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=mw({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:Jde(g.ghostTexts,p.ghostTexts)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p,m;const v=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const y=_.toSingleTextEdit().removeCommonPrefix(v),S=this._computeAugmentation(y,g);if(!this._suggestPreviewEnabled.read(g)&&!S)return;const E=(p=S==null?void 0:S.edit)!==null&&p!==void 0?p:y,D=S?S.edit.text.length-y.text.length:0,k=this._suggestPreviewMode.read(g),T=this._positions.read(g),M=[E,...eW(this.textModel,T,E)],P=M.map((R,O)=>R.computeGhostText(v,k,T[O],D)).filter(Pf),N=(m=P[0])!==null&&m!==void 0?m:new _k(E.range.endLineNumber,[]);return{edits:M,primaryGhostText:N,ghostTexts:P,inlineCompletion:S==null?void 0:S.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const y=this.selectedInlineCompletion.read(g);if(!y)return;const S=y.toSingleTextEdit(g),L=this._inlineSuggestMode.read(g),E=this._positions.read(g),D=[S,...eW(this.textModel,E,S)],k=D.map((T,M)=>T.computeGhostText(v,L,E[M],0)).filter(Pf);return k[0]?{edits:D,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:y,suggestItem:void 0}:void 0}}),this.ghostTexts=mw({owner:this,equalityComparer:Jde},g=>{const p=this.state.read(g);if(p)return p.ghostTexts}),this.primaryGhostText=mw({owner:this,equalityComparer:UEe},g=>{const p=this.state.read(g);if(p)return p==null?void 0:p.primaryGhostText}),this._register(HT(this._fetchInlineCompletions));let f;this._register(yn(g=>{var p,m;const v=this.state.read(g),_=v==null?void 0:v.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,S=y.source;(m=(p=S.provider).handleItemDidShow)===null||m===void 0||m.call(p,S.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletions.get()}async triggerExplicitly(e){tk(e,t=>{this._isActive.set(!0,t),this._forceUpdateSignal.trigger(t,_p.Explicit)}),await this._fetchInlineCompletions.get()}stop(e){tk(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const n=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Pf);return Oat(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,W.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].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 t;if(e.getModel()!==this.textModel)throw new Zi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),r.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Qi.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(t=is.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1});else{const o=n.edits,s=vhe(o).map(a=>Et.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...o.map(a=>Qi.replaceMove(a.range,a.text)),...r.additionalTextEdits]),e.setSelections(s,"inlineCompletionAccept")}r.command&&r.source.addRef(),Pi(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(await this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,eo),r.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,n)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const r=n.match(/\n/);return r&&r.index!==void 0?r.index+1:n.length})}async _acceptNext(e,t){if(e.getModel()!==this.textModel)throw new Zi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const s=r.parts[0],a=new le(r.lineNumber,s.column),l=s.text,c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c),d=this._positions.get(),h=d[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const f=W.fromPositions(h,a),g=e.getModel().getValueInRange(f)+u,p=new v_(f,g),m=[p,...eW(this.textModel,d,p)],v=vhe(m).map(_=>Et.fromPositions(_));e.executeEdits("inlineSuggestion.accept",m.map(_=>Qi.replaceMove(_.range,_.text))),e.setSelections(v,"inlineCompletionPartialAccept")}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const f=W.fromPositions(o.range.getStartPosition(),X5(a,ZQ(u))),g=e.getModel().getValueInRange(f,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,g.length)}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var t,n;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentation(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};wK=ZIt([J7(9,Wt),J7(10,cr),J7(11,Ti)],wK);function eW(i,e,t){if(e.length===1)return[];const n=e[0],r=e.slice(1),o=t.range.getStartPosition(),s=t.range.getEndPosition(),a=i.getValueInRange(W.fromPositions(n,s)),l=Qde(n,o);if(l.lineNumber<1)return nn(new Zi(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${n.toString()} and ${o.toString()}`)),[];const c=QIt(t.text,l);return r.map(u=>{const d=X5(Qde(u,o),s),h=i.getValueInRange(W.fromPositions(u,d)),f=qv(a,h),g=W.fromPositions(u,u.delta(0,f));return new v_(g,c)})}function QIt(i,e){let t="";const n=frt(i);for(let r=e.lineNumber-1;rW.compareRangesUsingStarts(r.range,o.range)),t=CIt(e.apply(i));return e.inverse().apply(t).map(r=>r.getEndPosition())}var JIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_he=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lE;class eJ{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const r=n[0].score[0];for(let o=0;ol&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:rI.fromString(r.type),this._cache.set(n,r);this._seq=this._cache.size}}class tkt extends eJ{constructor(){super("recentlyUsedByPrefix"),this._trie=dw.forStrings(),this._seq=0}memorize(e,t,n){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,n);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:rI.fromString(n.type),this._trie.set(t,n)}}}let Ck=lE=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Fe,this._persistSoon=new mi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===UI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==r){this._saveState();const o=lE._strategyCtors.get(r)||KEe;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${lE._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${lE._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Ck._strategyCtors=new Map([["recentlyUsedByPrefix",tkt],["recentlyUsed",ekt],["first",KEe]]);Ck._storagePrefix="suggest/memories";Ck=lE=JIt([_he(0,md),_he(1,mn)],Ck);const Q5=Sn("ISuggestMemories");Tn(Q5,Ck,1);var nkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ikt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SK;let yk=SK=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=SK.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(123)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(123)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),r=this._editor.getSelection(),o=n.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};yk.AtEnd=new ct("atEndOfWord",!1);yk=SK=nkt([ikt(1,Gt)],yk);var rkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},okt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cE;let oC=cE=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=cE.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(cE._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let r=n;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===n||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=cE._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};oC.OtherSuggestions=new ct("hasOtherSuggestions",!1);oC=cE=rkt([okt(1,Gt)],oC);class skt{constructor(e,t,n,r){this._disposables=new Fe,this._disposables.add(n.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Ms(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new qA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Jl{async provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o);const s=new Map;await new Promise(a=>Jl._bracketsRightYield(a,0,e,r,s)),await new Promise(a=>Jl._bracketsLeftYield(a,0,e,r,s,o))}return n}static _bracketsRightYield(e,t,n,r,o){const s=new Map,a=Date.now();for(;;){if(t>=Jl._maxRounds){e();break}if(!r){e();break}const l=n.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Jl._maxDuration){setTimeout(()=>Jl._bracketsRightYield(e,t+1,n,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new Ca,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=Jl._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=n.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Jl._maxDuration){setTimeout(()=>Jl._bracketsLeftYield(e,t+1,n,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const p=W.fromPositions(c.range.getEndPosition(),g.getStartPosition()),m=W.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:m}),Jl._addBracketLeading(n,m,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(n.push({range:W.fromPositions(new le(r,o),t.getEndPosition())}),n.push({range:W.fromPositions(new le(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:W.fromPositions(new le(s,a),t.getEndPosition())}),n.push({range:W.fromPositions(new le(s,1),t.getEndPosition())}))}}}Jl._maxDuration=30;Jl._maxRounds=2;class jd{static async create(e,t){if(!t.getOption(118).localityBonus||!t.hasModel())return jd.None;const n=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(n.uri))return jd.None;const[o]=await new Jl().provideSelectionRanges(n,[r]);if(o.length===0)return jd.None;const s=await e.computeWordRanges(n.uri,o[0].range);if(!s)return jd.None;const a=n.getWordUntilPosition(r);return delete s[a.word],new class extends jd{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(DCe(d))return 2<<20;const h=JD(d,W.fromPositions(l),W.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!W.containsRange(p.range,f))break;g-=1}return g}}}}jd.None=new class extends jd{distance(){return 0}};let bhe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Um{constructor(e,t,n,r,o,s,a=q3.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Um._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=Um._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=Um._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[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:n}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?Ub:Gmt;for(let c=0;c=f)u.score=ah.Default;else if(typeof u.completion.filterText=="string"){const p=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;YV(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=zmt(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(r,o,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}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?ZH(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.distance?1:e.idxt.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 Um._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 Um._compareCompletionItems(e,t)}}var akt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xK;class d0{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.getWordAtPosition(n);return!(!r||r.endColumn!==n.column&&r.startColumn+1!==n.column||!isNaN(Number(r.word)))}constructor(e,t,n){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=n}}function lkt(i,e,t){if(!e.getContextKeyValue(Ho.inlineSuggestionVisible.key))return!0;const n=e.getContextKeyValue(Ho.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function ckt(i,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const n=e.getContextKeyValue(Ho.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let SF=xK=class{constructor(e,t,n,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Fe,this._triggerCharacterListener=new Fe,this._triggerQuickSuggest=new gd,this._triggerState=void 0,this._completionDisposables=new Fe,this._onDidCancel=new ae,this._onDidTrigger=new ae,this._onDidSuggest=new ae,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Et(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(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(91)||!this._editor.hasModel()||!this._editor.getOption(121))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of n.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add($It()),e.set(r,o)),o.add(n)}const t=n=>{var r;if(!ckt(this._editor,this._contextKeyService,this._configurationService)||d0.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Fb(n.charCodeAt(n.length-1))?Do(n.charCodeAt(n.length-2))&&(o=n.substr(n.length-2)):o=n.charAt(n.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Ny.isAllOff(this._editor.getOption(89))||this._editor.getOption(118).snippetsPreventQuickSuggestions&&(!((e=is.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!d0.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=this._editor.getOption(89);if(!Ny.isAllOff(r)){if(!Ny.isAllOn(r)){t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.tokenization.getLineTokens(n.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(Ny.valueFor(r,s)!=="on")return}lkt(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(90)))}_refilterCompletionItems(){Yn(this._editor.hasModel()),Yn(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new d0(e,t,{...this._triggerState,refilter:!0});this._onNewContext(n)}trigger(e){var t,n,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new d0(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new xr;const d=this._editor.getOption(112);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=xK.createSuggestFilter(this._editor),p=new bk(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),m=jd.create(this._editorWorkerService,this._editor),v=QQ(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([v,m]).then(async([_,y])=>{var S;if((S=this._requestToken)===null||S===void 0||S.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=await this._clipboardService.readText()),this._triggerState===void 0)return;const E=this._editor.getModel(),D=new d0(E,this._editor.getPosition(),e),k={...q3.default,firstMatchCanBeWeak:!this._editor.getOption(118).matchOnWordStartOnly};if(this._completionModel=new Um(_.items,this._context.column,{leadingLineContent:D.leadingLineContent,characterCountDelta:D.column-this._context.column},y,this._editor.getOption(118),this._editor.getOption(112),k,L),this._completionDisposables.add(_.disposable),this._onNewContext(D),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const T of _.items)T.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${T.provider._debugDisplayName}`,T.completion)}).catch(nn)}_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(112)==="none"&&t.add(27);const r=e.getOption(118);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(yi(e.leadingLineContent)!==yi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(d0.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?n.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=d0.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};SF=xK=akt([pm(1,vd),pm(2,Zp),pm(3,ia),pm(4,Ra),pm(5,Gt),pm(6,mn),pm(7,yt),pm(8,CZ)],SF);class J5{constructor(e,t){this._disposables=new Fe,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),r=n.length;let o=!1;for(let a=0;aJ5._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let dkt=class GEe extends s_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,GEe.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}},LK=class{constructor(e,t,n,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new Fe,this.element=Oe(e,Xe(".suggest-status-bar"));const s=a=>a instanceof bc?n.createInstance(dkt,a,void 0):void 0;this._leftActions=new du(this.element,{actionViewItemProvider:s}),this._rightActions=new du(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const n=[],r=[];for(const[o,s]of e.getActions())o==="left"?n.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};LK=ukt([tW(2,Wt),tW(3,mu),tW(4,Gt)],LK);var hkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function tJ(i){return!!i&&!!(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let EK=class{constructor(e,t){this._editor=e,this._onDidClose=new ae,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new ae,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Fe,this._renderDisposeable=new Fe,this._borderWidth=1,this._size=new Gn(330,0),this.domNode=Xe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(qf,{editor:e}),this._body=Xe(".body"),this._scrollbar=new ST(this._body,{alwaysConsumeMouseWheel:!0}),Oe(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Oe(this._body,Xe(".header")),this._close=Oe(this._header,Xe("span"+Vt.asCSSSelector(tt.close))),this._close.title=w("details.close","Close"),this._type=Oe(this._header,Xe("p.type")),this._docs=Oe(this._body,Xe("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),r=e.get(119)||t.fontSize,o=e.get(120)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(120)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=w("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 n,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} +`)}withRange(e){return new CF(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function kIt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new W(i.lineNumber,t.startColumn,i.lineNumber,n):W.fromPositions(i,i.with(void 0,n))}function nhe(i,e,t,n){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?xIt(a,n):i}class __{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const r=e.getValueInRange(n,1),o=Xv(r,this.text),s=X5(this.range.getStartPosition(),ZQ(r.substring(0,o))),a=this.text.substring(o),l=W.fromPositions(s,this.range.getEndPosition());return new __(l,a)}augments(e){return this.text.startsWith(e.text)&&TIt(this.range,e.range)}computeGhostText(e,t,n,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=yi(s).length;if(o.range.startColumn-1<=a){const g=yi(o.text).length,p=s.substring(o.range.startColumn-1,a),[m,v]=[o.range.getStartPosition(),o.range.getEndPosition()],_=m.column+p.length<=v.column?m.delta(0,p.length):v,y=W.fromPositions(_,v),S=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new __(y,S)}const c=e.getValueInRange(o.range),u=NIt(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const m=g.modifiedStart+g.modifiedLength,v=Math.max(g.modifiedStart,Math.min(m,f)),_=o.text.substring(g.modifiedStart,v),y=o.text.substring(v,Math.max(g.modifiedStart,m));_.length>0&&h.push(new bF(p,_,!1)),y.length>0&&h.push(new bF(p,y,!0))}return new _k(d,h)}}function TIt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let Gh;function NIt(i,e){if((Gh==null?void 0:Gh.originalValue)===i&&(Gh==null?void 0:Gh.newValue)===e)return Gh==null?void 0:Gh.changes;{let t=rhe(i,e,!0);if(t){const n=ihe(t);if(n>0){const r=rhe(i,e,!1);r&&ihe(r)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const r=Math.max(n(i),n(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var RIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ohe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let yK=class extends me{constructor(e,t,n,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Vo),this.inlineCompletions=nk("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=nk("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var r,o;const s=new PIt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new xr,u=(async()=>{if((l||t.triggerKind===_p.Automatic)&&await MIt(this._debounceValue.get(this.textModel),c.token),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=await EIt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const m=new FIt(g,s,this.textModel,this.versionId);if(n){const v=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(v)&&m.prepend(n.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),Pi(v=>{a.set(m,v)}),!0})(),d=new OIt(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};yK=RIt([ohe(3,yt),ohe(4,Ti)],yK);function MIt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class PIt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&AIt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===_p.Automatic||this.context.triggerKind===_p.Explicit)&&this.versionId===e.versionId}}function AIt(i,e,t){return!i||!e?i===e:t(i,e)}class OIt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class FIt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=en(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new she(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,n){n&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new she(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class she{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new __(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const r=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1),s=r.text,a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!Qwe(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new __(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return ahe(this._getUpdatedRange(e)).isBefore(ahe(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function ahe(i){return i.startLineNumber===i.endLineNumber?new le(1,1+i.endColumn-i.startColumn):new le(1+i.endLineNumber-i.startLineNumber,i.endColumn)}const un={Visible:UQ,HasFocusedSuggestion:new ct("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new ct("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new ct("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new ct("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new ct("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new ct("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new ct("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new ct("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Bv=new H("suggestWidgetStatusBar");class BIt{constructor(e,t,n,r){var o;this.position=e,this.completion=t,this.container=n,this.provider=r,this.isInvalid=!1,this.score=ah.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,W.isIRange(t.range)?(this.editStart=new le(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new le(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new le(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new le(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new le(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new le(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range.insert)||W.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}),n=new Fs(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=n.elapsed()},r=>{Th(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class bk{constructor(e=2,t=new Set,n=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=r,this.showDeprecated=o}}bk.default=new bk;let WIt;function $It(){return WIt}class HIt{constructor(e,t,n,r){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=r}}async function QQ(i,e,t,n=bk.default,r={triggerKind:0},o=wn.None){const s=new Fs;t=t.clone();const a=e.getWordAtPosition(t),l=a?new W(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):W.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Fe,h=[];let f=!1;const g=(m,v,_)=>{var y,S,L;let E=!1;if(!v)return E;for(const D of v.suggestions)if(!n.kindFilter.has(D.kind)){if(!n.showDeprecated&&(!((y=D==null?void 0:D.tags)===null||y===void 0)&&y.includes(1)))continue;D.range||(D.range=c),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=Qb.guessNeedsClipboard(D.insertText)),u.push(new BIt(t,D,v,m)),E=!0}return tY(v)&&d.add(v),h.push({providerName:(S=m._debugDisplayName)!==null&&S!==void 0?S:"unknown_provider",elapsedProvider:(L=v.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),E},p=(async()=>{})();for(const m of i.orderedGroups(e)){let v=!1;if(await Promise.all(m.map(async _=>{if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(S=>u.push(S)),v=v||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Fs,S=await _.provideCompletionItems(e,t,r,o);v=g(_,S,y)||v}catch(y){eo(y)}})),v||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(d.dispose(),Promise.reject(new T_)):new HIt(u.sort(UIt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)}function JQ(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function VIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return JQ(i,e)}function zIt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return JQ(i,e)}const Y5=new Map;Y5.set(0,VIt);Y5.set(2,zIt);Y5.set(1,JQ);function UIt(i){return Y5.get(i)}kn.registerCommand("_executeCompletionItemProvider",async(i,...e)=>{const[t,n,r,o]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string"||!r),Yn(typeof o=="number"||!o);const{completionProvider:s}=i.get(yt),a=await i.get(ul).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=await QQ(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(wn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}});function jIt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Ny{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 lhe(i,e=Os){return zft(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var KIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},GIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class che{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class uhe{constructor(e,t,n,r){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(n=o.value,r=o.multiline)}if(n&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=yi(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof va&&(a=yi(ng(c.value).pop())),!0));const l=Xv(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 dhe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Lv(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=Lv(this._model.uri.fsPath),r=n.lastIndexOf(".");return r<=0?n:n.slice(0,r)}else{if(t==="TM_DIRECTORY")return QCe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(V3(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 hhe{constructor(e,t,n,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(r=>!o1e(r));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let yF=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(n).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}}};yF=KIt([GIt(2,Ti)],yF);class Qd{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 Qd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Qd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Qd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Qd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),r=n>0?"-":"+",o=Math.trunc(Math.abs(n/60)),s=o<10?"0"+o:o,a=Math.abs(n)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}Qd.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")];Qd.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")];Qd.monthNames=[w("January","January"),w("February","February"),w("March","March"),w("April","April"),w("May","May"),w("June","June"),w("July","July"),w("August","August"),w("September","September"),w("October","October"),w("November","November"),w("December","December")];Qd.monthNamesShort=[w("JanuaryShort","Jan"),w("FebruaryShort","Feb"),w("MarchShort","Mar"),w("AprilShort","Apr"),w("MayShort","May"),w("JuneShort","Jun"),w("JulyShort","Jul"),w("AugustShort","Aug"),w("SeptemberShort","Sep"),w("OctoberShort","Oct"),w("NovemberShort","Nov"),w("DecemberShort","Dec")];class fhe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=t_t(this._workspaceService.getWorkspace());if(!Qvt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(vU(e))return Lv(e.uri.path);let t=Lv(e.configPath.path);return t.endsWith(_U)&&(t=t.substr(0,t.length-_U.length-1)),t}_resoveWorkspacePath(e){if(vU(e))return lhe(e.uri.fsPath);const t=Lv(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?lhe(n):"/"}}class ghe{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 T5()}}var qIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XIt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kd;class Vc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Ise(t.placeholders,jc.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 n of this._snippet.placeholders){const r=this._snippet.offset(n),o=this._snippet.fullLen(n),s=W.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=n.isFinalTabstop?Vc._decor.inactiveFinal:Vc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new Et(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Vc._decor.activeFinal:Vc._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Vc._decor.activeFinal:Vc._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Vc._decor.inactiveFinal:Vc._decor.inactive);return s});return t?this.move(e):n??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof jc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const r of t){if(r.isFinalTabstop)break;n||(n=[],e.set(r.index,n));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof sx,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);n.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=W.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=n.addDecoration(d,Vc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=Ise(this._snippet.placeholders,jc.compareByIndex)})}}Vc._decor={active:an.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:an.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:an.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:an.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const phe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let wF=kd=class{static adjustWhitespace(e,t,n,r,o){const s=e.getLineContent(t.lineNumber),a=yi(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof va)||c.parent instanceof sx||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fS.get(Kb)),g=e.invokeWithinContext(S=>new dhe(S.get(lS),h)),p=()=>a,m=h.getValueInRange(kd.adjustSelection(h,e.getSelection(),n,0)),v=h.getValueInRange(kd.adjustSelection(h,e.getSelection(),0,r)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((S,L)=>({selection:S,idx:L})).sort((S,L)=>W.compareRangesUsingStarts(S.selection,L.selection));for(const{selection:S,idx:L}of y){let E=kd.adjustSelection(h,S,n,0),D=kd.adjustSelection(h,S,0,r);m!==h.getValueInRange(E)&&(E=S),v!==h.getValueInRange(D)&&(D=S);const k=S.setStartPosition(E.startLineNumber,E.startColumn).setEndPosition(D.endLineNumber,D.endColumn),T=new Qb().parse(t,!0,o),M=k.getStartPosition(),P=kd.adjustWhitespace(h,M,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(S.positionLineNumber),T);T.resolveVariables(new che([g,new hhe(p,L,y.length,e.getOption(79)==="spread"),new uhe(h,S,L,l),new yF(h,S,c),new Qd,new fhe(f),new ghe])),u[L]=Ji.replace(k,T.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new Vc(e,T,P)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new Qb,d=new UT,h=new che([e.invokeWithinContext(g=>new dhe(g.get(lS),c)),new hhe(()=>o,0,e.getSelections().length,e.getOption(79)==="spread"),new uhe(c,e.getSelection(),0,s),new yF(c,e.getSelection(),a),new Qd,new fhe(e.invokeWithinContext(g=>g.get(Kb))),new ghe]);t=t.sort((g,p)=>W.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,E=W.fromPositions(L.getEndPosition(),p.getStartPosition()),D=new va(c.getValueInRange(E));d.appendChild(D),f+=D.value.length}const v=u.parseFragment(m,d);kd.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(v)),d.resolveVariables(h);const _=d.toString(),y=_.slice(f);f=_.length;const S=Ji.replace(p,y);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new Vc(e,d,"")]}}constructor(e,t,n=phe,r){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){si(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"?kd.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):kd.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,n=>{const r=n.filter(o=>!!o.identifier);for(let o=0;oEt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=phe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:r}=kd.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;lEt.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 n of this._snippets){const r=n.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{o.push(...r.get(s))})}e.sort(W.compareRangesUsingStarts);for(const[n,r]of t){if(r.length!==e.length){t.delete(n);continue}r.sort(W.compareRangesUsingStarts);for(let o=0;o0}};wF=kd=qIt([XIt(3,Ti)],wF);var YIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},q2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},z1;const mhe={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let is=z1=class{static get(e){return e.getContribution(z1.ID)}constructor(e,t,n,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=o,this._snippetListener=new Fe,this._modelVersionId=-1,this._inSnippet=z1.InSnippetMode.bindTo(r),this._hasNextTabstop=z1.HasNextTabstop.bindTo(r),this._hasPrevTabstop=z1.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?mhe:{...mhe,...t})}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Yn(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new wF(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!le.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(m=>m.value===f),p=[];for(let m=0;m{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{jIt(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};is.ID="snippetController2";is.InSnippetMode=new ct("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode"));is.HasNextTabstop=new ct("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));is.HasPrevTabstop=new ct("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));is=z1=YIt([q2(1,Ra),q2(2,yt),q2(3,Gt),q2(4,Ti)],is);Kn(is.ID,is,4);const Z5=zo.bindToContribution(is.get);st(new Z5({id:"jumpToNextSnippetPlaceholder",precondition:Re.and(is.InSnippetMode,is.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:2}}));st(new Z5({id:"jumpToPrevSnippetPlaceholder",precondition:Re.and(is.InSnippetMode,is.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:1026}}));st(new Z5({id:"leaveSnippet",precondition:is.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:K.editorTextFocus,primary:9,secondary:[1033]}}));st(new Z5({id:"acceptSnippet",precondition:is.InSnippetMode,handler:i=>i.finish()}));var ZIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ql;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Ql||(Ql={}));let wK=class extends me{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=n,this._positions=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(yK,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Vn(this,!1),this._forceUpdateSignal=cQ("forceUpdate"),this._selectedInlineCompletionId=Vn(this,void 0),this._primaryPosition=en(this,g=>{var p;return(p=this._positions.read(g)[0])!==null&&p!==void 0?p:new le(1,1)}),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Ql.Redo,Ql.Undo,Ql.AcceptWord]),this._fetchInlineCompletions=c1t({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:_p.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdateSignal)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdateSignal.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.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||v!=null&&v.forwardStable?v:void 0,y=this._source.suggestWidgetInlineCompletions.get(),S=this.selectedSuggestItem.read(g);if(y&&!S){const D=this._source.inlineCompletions.get();Pi(k=>{(!D||y.request.versionId>D.request.versionId)&&this._source.inlineCompletions.set(y.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const L=this._primaryPosition.read(g),E={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:S==null?void 0:S.toSelectedSuggestionInfo()};return this._source.fetch(L,E,_)}),this._filteredInlineCompletionItems=en(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const m=this._primaryPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,m,g))}),this.selectedInlineCompletionIndex=en(this,g=>{const p=this._selectedInlineCompletionId.read(g),m=this._filteredInlineCompletionItems.read(g),v=this._selectedInlineCompletionId===void 0?-1:m.findIndex(_=>_.semanticId===p);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=en(this,g=>{const p=this._filteredInlineCompletionItems.read(g),m=this.selectedInlineCompletionIndex.read(g);return p[m]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=en(this,g=>{if(this.lastTriggerKind.read(g)===_p.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=mw({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:Jde(g.ghostTexts,p.ghostTexts)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p,m;const v=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const y=_.toSingleTextEdit().removeCommonPrefix(v),S=this._computeAugmentation(y,g);if(!this._suggestPreviewEnabled.read(g)&&!S)return;const E=(p=S==null?void 0:S.edit)!==null&&p!==void 0?p:y,D=S?S.edit.text.length-y.text.length:0,k=this._suggestPreviewMode.read(g),T=this._positions.read(g),M=[E,...eW(this.textModel,T,E)],P=M.map((R,O)=>R.computeGhostText(v,k,T[O],D)).filter(Pf),N=(m=P[0])!==null&&m!==void 0?m:new _k(E.range.endLineNumber,[]);return{edits:M,primaryGhostText:N,ghostTexts:P,inlineCompletion:S==null?void 0:S.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const y=this.selectedInlineCompletion.read(g);if(!y)return;const S=y.toSingleTextEdit(g),L=this._inlineSuggestMode.read(g),E=this._positions.read(g),D=[S,...eW(this.textModel,E,S)],k=D.map((T,M)=>T.computeGhostText(v,L,E[M],0)).filter(Pf);return k[0]?{edits:D,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:y,suggestItem:void 0}:void 0}}),this.ghostTexts=mw({owner:this,equalityComparer:Jde},g=>{const p=this.state.read(g);if(p)return p.ghostTexts}),this.primaryGhostText=mw({owner:this,equalityComparer:UEe},g=>{const p=this.state.read(g);if(p)return p==null?void 0:p.primaryGhostText}),this._register(HT(this._fetchInlineCompletions));let f;this._register(yn(g=>{var p,m;const v=this.state.read(g),_=v==null?void 0:v.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,S=y.source;(m=(p=S.provider).handleItemDidShow)===null||m===void 0||m.call(p,S.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletions.get()}async triggerExplicitly(e){tk(e,t=>{this._isActive.set(!0,t),this._forceUpdateSignal.trigger(t,_p.Explicit)}),await this._fetchInlineCompletions.get()}stop(e){tk(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const n=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Pf);return Oat(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,W.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].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 t;if(e.getModel()!==this.textModel)throw new Qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),r.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Ji.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(t=is.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1});else{const o=n.edits,s=vhe(o).map(a=>Et.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...o.map(a=>Ji.replaceMove(a.range,a.text)),...r.additionalTextEdits]),e.setSelections(s,"inlineCompletionAccept")}r.command&&r.source.addRef(),Pi(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(await this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,eo),r.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,n)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const r=n.match(/\n/);return r&&r.index!==void 0?r.index+1:n.length})}async _acceptNext(e,t){if(e.getModel()!==this.textModel)throw new Qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const s=r.parts[0],a=new le(r.lineNumber,s.column),l=s.text,c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c),d=this._positions.get(),h=d[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const f=W.fromPositions(h,a),g=e.getModel().getValueInRange(f)+u,p=new __(f,g),m=[p,...eW(this.textModel,d,p)],v=vhe(m).map(_=>Et.fromPositions(_));e.executeEdits("inlineSuggestion.accept",m.map(_=>Ji.replaceMove(_.range,_.text))),e.setSelections(v,"inlineCompletionPartialAccept")}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const f=W.fromPositions(o.range.getStartPosition(),X5(a,ZQ(u))),g=e.getModel().getValueInRange(f,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,g.length)}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var t,n;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentation(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};wK=ZIt([J7(9,Wt),J7(10,cr),J7(11,Ti)],wK);function eW(i,e,t){if(e.length===1)return[];const n=e[0],r=e.slice(1),o=t.range.getStartPosition(),s=t.range.getEndPosition(),a=i.getValueInRange(W.fromPositions(n,s)),l=Qde(n,o);if(l.lineNumber<1)return nn(new Qi(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${n.toString()} and ${o.toString()}`)),[];const c=QIt(t.text,l);return r.map(u=>{const d=X5(Qde(u,o),s),h=i.getValueInRange(W.fromPositions(u,d)),f=Xv(a,h),g=W.fromPositions(u,u.delta(0,f));return new __(g,c)})}function QIt(i,e){let t="";const n=frt(i);for(let r=e.lineNumber-1;rW.compareRangesUsingStarts(r.range,o.range)),t=CIt(e.apply(i));return e.inverse().apply(t).map(r=>r.getEndPosition())}var JIt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_he=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lE;class eJ{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const r=n[0].score[0];for(let o=0;ol&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:rI.fromString(r.type),this._cache.set(n,r);this._seq=this._cache.size}}class tkt extends eJ{constructor(){super("recentlyUsedByPrefix"),this._trie=dw.forStrings(),this._seq=0}memorize(e,t,n){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,n);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:rI.fromString(n.type),this._trie.set(t,n)}}}let Ck=lE=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Fe,this._persistSoon=new mi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===UI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==r){this._saveState();const o=lE._strategyCtors.get(r)||KEe;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${lE._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${lE._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Ck._strategyCtors=new Map([["recentlyUsedByPrefix",tkt],["recentlyUsed",ekt],["first",KEe]]);Ck._storagePrefix="suggest/memories";Ck=lE=JIt([_he(0,md),_he(1,mn)],Ck);const Q5=Sn("ISuggestMemories");Tn(Q5,Ck,1);var nkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ikt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SK;let yk=SK=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=SK.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(123)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(123)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),r=this._editor.getSelection(),o=n.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};yk.AtEnd=new ct("atEndOfWord",!1);yk=SK=nkt([ikt(1,Gt)],yk);var rkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},okt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cE;let sC=cE=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=cE.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(cE._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let r=n;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===n||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=cE._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};sC.OtherSuggestions=new ct("hasOtherSuggestions",!1);sC=cE=rkt([okt(1,Gt)],sC);class skt{constructor(e,t,n,r){this._disposables=new Fe,this._disposables.add(n.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Ms(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new qA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Jl{async provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o);const s=new Map;await new Promise(a=>Jl._bracketsRightYield(a,0,e,r,s)),await new Promise(a=>Jl._bracketsLeftYield(a,0,e,r,s,o))}return n}static _bracketsRightYield(e,t,n,r,o){const s=new Map,a=Date.now();for(;;){if(t>=Jl._maxRounds){e();break}if(!r){e();break}const l=n.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Jl._maxDuration){setTimeout(()=>Jl._bracketsRightYield(e,t+1,n,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new Ca,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=Jl._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=n.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Jl._maxDuration){setTimeout(()=>Jl._bracketsLeftYield(e,t+1,n,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const p=W.fromPositions(c.range.getEndPosition(),g.getStartPosition()),m=W.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:m}),Jl._addBracketLeading(n,m,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(n.push({range:W.fromPositions(new le(r,o),t.getEndPosition())}),n.push({range:W.fromPositions(new le(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:W.fromPositions(new le(s,a),t.getEndPosition())}),n.push({range:W.fromPositions(new le(s,1),t.getEndPosition())}))}}}Jl._maxDuration=30;Jl._maxRounds=2;class jd{static async create(e,t){if(!t.getOption(118).localityBonus||!t.hasModel())return jd.None;const n=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(n.uri))return jd.None;const[o]=await new Jl().provideSelectionRanges(n,[r]);if(o.length===0)return jd.None;const s=await e.computeWordRanges(n.uri,o[0].range);if(!s)return jd.None;const a=n.getWordUntilPosition(r);return delete s[a.word],new class extends jd{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(DCe(d))return 2<<20;const h=JD(d,W.fromPositions(l),W.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!W.containsRange(p.range,f))break;g-=1}return g}}}}jd.None=new class extends jd{distance(){return 0}};let bhe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Um{constructor(e,t,n,r,o,s,a=q3.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Um._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=Um._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=Um._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[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:n}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?jb:Gmt;for(let c=0;c=f)u.score=ah.Default;else if(typeof u.completion.filterText=="string"){const p=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;YV(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=zmt(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(r,o,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}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?ZH(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.distance?1:e.idxt.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 Um._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 Um._compareCompletionItems(e,t)}}var akt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xK;class h0{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.getWordAtPosition(n);return!(!r||r.endColumn!==n.column&&r.startColumn+1!==n.column||!isNaN(Number(r.word)))}constructor(e,t,n){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=n}}function lkt(i,e,t){if(!e.getContextKeyValue(Ho.inlineSuggestionVisible.key))return!0;const n=e.getContextKeyValue(Ho.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function ckt(i,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const n=e.getContextKeyValue(Ho.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let SF=xK=class{constructor(e,t,n,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Fe,this._triggerCharacterListener=new Fe,this._triggerQuickSuggest=new gd,this._triggerState=void 0,this._completionDisposables=new Fe,this._onDidCancel=new ae,this._onDidTrigger=new ae,this._onDidSuggest=new ae,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Et(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(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(91)||!this._editor.hasModel()||!this._editor.getOption(121))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of n.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add($It()),e.set(r,o)),o.add(n)}const t=n=>{var r;if(!ckt(this._editor,this._contextKeyService,this._configurationService)||h0.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Bb(n.charCodeAt(n.length-1))?Do(n.charCodeAt(n.length-2))&&(o=n.substr(n.length-2)):o=n.charAt(n.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Ny.isAllOff(this._editor.getOption(89))||this._editor.getOption(118).snippetsPreventQuickSuggestions&&(!((e=is.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!h0.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=this._editor.getOption(89);if(!Ny.isAllOff(r)){if(!Ny.isAllOn(r)){t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.tokenization.getLineTokens(n.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(Ny.valueFor(r,s)!=="on")return}lkt(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(90)))}_refilterCompletionItems(){Yn(this._editor.hasModel()),Yn(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new h0(e,t,{...this._triggerState,refilter:!0});this._onNewContext(n)}trigger(e){var t,n,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new h0(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new xr;const d=this._editor.getOption(112);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=xK.createSuggestFilter(this._editor),p=new bk(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),m=jd.create(this._editorWorkerService,this._editor),v=QQ(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([v,m]).then(async([_,y])=>{var S;if((S=this._requestToken)===null||S===void 0||S.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=await this._clipboardService.readText()),this._triggerState===void 0)return;const E=this._editor.getModel(),D=new h0(E,this._editor.getPosition(),e),k={...q3.default,firstMatchCanBeWeak:!this._editor.getOption(118).matchOnWordStartOnly};if(this._completionModel=new Um(_.items,this._context.column,{leadingLineContent:D.leadingLineContent,characterCountDelta:D.column-this._context.column},y,this._editor.getOption(118),this._editor.getOption(112),k,L),this._completionDisposables.add(_.disposable),this._onNewContext(D),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const T of _.items)T.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${T.provider._debugDisplayName}`,T.completion)}).catch(nn)}_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(112)==="none"&&t.add(27);const r=e.getOption(118);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(yi(e.leadingLineContent)!==yi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(h0.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?n.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=h0.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};SF=xK=akt([pm(1,vd),pm(2,Zp),pm(3,ia),pm(4,Ra),pm(5,Gt),pm(6,mn),pm(7,yt),pm(8,CZ)],SF);class J5{constructor(e,t){this._disposables=new Fe,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),r=n.length;let o=!1;for(let a=0;aJ5._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let dkt=class GEe extends a_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,GEe.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}},LK=class{constructor(e,t,n,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new Fe,this.element=Oe(e,Xe(".suggest-status-bar"));const s=a=>a instanceof bc?n.createInstance(dkt,a,void 0):void 0;this._leftActions=new du(this.element,{actionViewItemProvider:s}),this._rightActions=new du(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const n=[],r=[];for(const[o,s]of e.getActions())o==="left"?n.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};LK=ukt([tW(2,Wt),tW(3,mu),tW(4,Gt)],LK);var hkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function tJ(i){return!!i&&!!(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let EK=class{constructor(e,t){this._editor=e,this._onDidClose=new ae,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new ae,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Fe,this._renderDisposeable=new Fe,this._borderWidth=1,this._size=new Gn(330,0),this.domNode=Xe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(qf,{editor:e}),this._body=Xe(".body"),this._scrollbar=new ST(this._body,{alwaysConsumeMouseWheel:!0}),Oe(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Oe(this._body,Xe(".header")),this._close=Oe(this._header,Xe("span"+Vt.asCSSSelector(tt.close))),this._close.title=w("details.close","Close"),this._type=Oe(this._header,Xe("p.type")),this._docs=Oe(this._body,Xe("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),r=e.get(119)||t.fontSize,o=e.get(120)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(120)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=w("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 n,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(n=e.word)!==null&&n!==void 0?n:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(r=e.completion.commitCharacters)===null||r===void 0?void 0:r.join("")} -`,s=new Ns().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!tJ(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,Sl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ps(this._type),this._type.title="",pa(this._type),this.domNode.classList.add("no-type");if(Ps(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ps(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const n=new Gn(e,t);Gn.equals(n,this._size)||(this._size=n,yot(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}};EK=hkt([fkt(1,Wt)],EK);class gkt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Fe,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new OQ,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+o,left:n.left+s})}a.done&&(n=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return 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){var n;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var r;const o=Wp(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Gn(220,2*s.lineHeight),l=e.top,c=function(){const E=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),D=-s.borderWidth+e.left+e.width,k=new Gn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),u=function(){const E=e.left-s.borderWidth-s.horizontalPadding,D=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),k=new Gn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),d=function(){const E=e.left,D=-s.borderWidth+e.top+e.height,k=new Gn(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:D,left:E,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:a.with(k.width)}}(),h=[c,u,d],f=(r=h.find(E=>E.fit>=0))!==null&&r!==void 0?r:h.sort((E,D)=>D.fit-E.fit)[0],g=e.top+e.height-s.borderHeight;let p,m=t.height;const v=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);m>v&&(m=v);let _;n?m<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):m<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop);let{top:y,left:S}=f;!p&&m>e.height&&(y=g-m);const L=this._editor.getDomNode();if(L){const E=L.getBoundingClientRect();y-=E.top,S-=E.left}this._applyTopLeft({left:S,top:y}),this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(m,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var If;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(If||(If={}));const pkt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function X2(i,e,t,n,r){if(r)return[`codicon-${r.id}`,"predefined-file-icon"];const o=n===If.ROOT_FOLDER?["rootfolder-icon"]:n===If.FOLDER?["folder-icon"]:["file-icon"];if(t){let s;if(t.scheme===cn.data)s=i_.parseMetaData(t).get(i_.META_DATA_LABEL);else{const a=t.path.match(pkt);a?(s=Y2(a[2].toLowerCase()),a[1]&&o.push(`${Y2(a[1].toLowerCase())}-name-dir-icon`)):s=Y2(t.authority.toLowerCase())}if(n===If.ROOT_FOLDER)o.push(`${s}-root-name-folder-icon`);else if(n===If.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),o.push("name-file-icon"),s.length<=255){const l=s.split(".");for(let c=1;c=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mm;function qEe(i){return`suggest-aria-id:${i}`}const _kt=Or("suggest-more-info",tt.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),bkt=new(mm=class{extract(e,t){if(e.textLabel.match(mm._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(mm._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const n=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,r=mm._regexRelaxed.exec(n);if(r&&(r.index===0||r.index+r[0].length===n.length))return t[0]=r[0],!0}return!1}},mm._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*\))/,mm._regexStrict=new RegExp(`^${mm._regexRelaxed.source}$`,"i"),mm);let DK=class{constructor(e,t,n,r){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=r,this._onDidToggleDetails=new ae,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Fe,n=e;n.classList.add("show-file-icons");const r=Oe(e,Xe(".icon")),o=Oe(r,Xe("span.colorspan")),s=Oe(e,Xe(".contents")),a=Oe(s,Xe(".main")),l=Oe(a,Xe(".icon-label.codicon")),c=Oe(a,Xe("span.left")),u=Oe(a,Xe("span.right")),d=new KO(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=Oe(c,Xe("span.signature-label")),f=Oe(c,Xe("span.qualifier-label")),g=Oe(u,Xe("span.details-label")),p=Oe(u,Xe("span.readMore"+Vt.asCSSSelector(_kt)));return p.title=w("readMore","Read More"),{root:n,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const v=this._editor.getOptions(),_=v.get(50),y=_.getMassagedFontFamily(),S=_.fontFeatureSettings,L=v.get(119)||_.fontSize,E=v.get(120)||_.lineHeight,D=_.fontWeight,k=_.letterSpacing,T=`${L}px`,M=`${E}px`,P=`${k}px`;n.style.fontSize=T,n.style.fontWeight=D,n.style.letterSpacing=P,a.style.fontFamily=y,a.style.fontFeatureSettings=S,a.style.lineHeight=M,r.style.height=M,r.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,n){n.configureFont();const{completion:r}=e;n.root.id=qEe(t),n.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:TT(e.score)},s=[];if(r.kind===19&&bkt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:e.textLabel}),If.FILE),l=X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:r.detail}),If.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",o.extraClasses=[X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:e.textLabel}),If.FOLDER),X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:r.detail}),If.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Vt.asClassNameArray(rI.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=iW(r.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=iW(r.label.detail||""),n.detailsLabel.textContent=iW(r.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(118).showInlineDetails?Sl(n.detailsLabel):pa(n.detailsLabel),tJ(e)?(n.right.classList.add("can-expand-details"),Sl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),pa(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};DK=vkt([nW(1,rr),nW(2,qi),nW(3,Mo)],DK);function iW(i){return i.replace(/\r\n|\r|\n/g,"")}var Ckt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Z2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},U1;X("editorSuggestWidget.background",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("editorSuggestWidgetBackground","Background color of the suggest widget."));X("editorSuggestWidget.border",{dark:op,light:op,hcDark:op,hcLight:op},w("editorSuggestWidgetBorder","Border color of the suggest widget."));const Q2=X("editorSuggestWidget.foreground",{dark:Xu,light:Xu,hcDark:Xu,hcLight:Xu},w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));X("editorSuggestWidget.selectedForeground",{dark:q0,light:q0,hcDark:q0,hcLight:q0},w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));X("editorSuggestWidget.selectedIconForeground",{dark:vy,light:vy,hcDark:vy,hcLight:vy},w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const ykt=X("editorSuggestWidget.selectedBackground",{dark:X0,light:X0,hcDark:X0,hcLight:X0},w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));X("editorSuggestWidget.highlightForeground",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));X("editorSuggestWidget.focusHighlightForeground",{dark:qR,light:qR,hcDark:qR,hcLight:qR},w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));X("editorSuggestWidgetStatus.foreground",{dark:Mt(Q2,.5),light:Mt(Q2,.5),hcDark:Mt(Q2,.5),hcLight:Mt(Q2,.5)},w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class wkt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof d_}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Gn.is(n))return Gn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let wk=U1=class{constructor(e,t,n,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Vo,this._pendingShowDetails=new Vo,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new gd,this._disposables=new Fe,this._onDidSelect=new Ab,this._onDidFocus=new Ab,this._onDidHide=new ae,this._onDidShow=new ae,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new ae,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new OQ,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Skt(this,e),this._persistedSize=new wkt(t,e);class s{constructor(f,g,p=!1,m=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=m}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,m;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:_}=this.getLayoutInfo(),y=Math.round(v/2);let{width:S,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-S)<=y)&&(S=(m=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&m!==void 0?m:_.width),this._persistedSize.store(new Gn(S,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Oe(this.element.domNode,Xe(".message")),this._listElement=Oe(this.element.domNode,Xe(".tree"));const l=this._disposables.add(o.createInstance(EK,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new gkt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(118).showIcons);c();const u=o.createInstance(DK,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Ec("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:_}=h.completion.label;v&&_?f=w("label.full","{0} {1}, {2}",f,v,_):v?f=w("label.detail","{0} {1}",f,v):_&&(f=w("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,m=Ob("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,m)}}}),this._list.style(ZS({listInactiveFocusBackground:ykt,listInactiveFocusOutline:Ki})),this._status=o.createInstance(LK,this.element.domNode,Bv);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(118).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(118)&&(d(),c()),this._completionModel&&(h.hasChanged(50)||h.hasChanged(119)||h.hasChanged(120))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=un.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=un.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=un.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=un.HasFocusedSuggestion.bindTo(n),this._disposables.add(Lr(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=sh(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const n=e.elements[0],r=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(r),this._currentSuggestionDetails=No(async o=>{const s=Zv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return await n.resolve(o)}finally{s.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{r>=this._list.length||n!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[n]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:qEe(r)}))}).catch(nn)),this._onDidFocus.fire({item:n,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:pa(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=U1.LOADING_MESSAGE,pa(this._listElement,this._status.element),Sl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,jf(U1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=U1.NO_SUGGESTIONS_MESSAGE,pa(this._listElement,this._status.element),Sl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,jf(U1.NO_SUGGESTIONS_MESSAGE);break;case 3:pa(this._messageElement),Sl(this._listElement,this._status.element),this._show();break;case 4:pa(this._messageElement),Sl(this._listElement,this._status.element),this._show();break;case 5:pa(this._messageElement),Sl(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=Zv(()=>this._setState(1),t)))}showSuggestions(e,t,n,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(n?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=HA(Bt(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")):(tJ(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=HA(Bt(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 e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Hr(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,m=Math.min(o.height-p-s.verticalPadding,d),v=f.top+g.top-s.verticalPadding,_=Math.min(v,d);let y=Math.min(Math.max(_,m)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const S=150;a>m||this._forceRenderingAbove&&v>S?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=m),this.element.preferredSize=new Gn(u,s.defaultSize.height),this.element.maxSize=new Gn(c,y),this.element.minSize=new Gn(220,h),this._cappedHeight=a===d?{wanted:(r=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:r}=this.element.maxSize;e=Math.min(n,e),t=Math.min(r,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=fa(this.editor.getOption(120)||e.lineHeight,8,1e3),n=!this.editor.getOption(118).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:n,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Gn(430,n+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};wk.LOADING_MESSAGE=w("suggestWidget.loading","Loading...");wk.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions.");wk=U1=Ckt([Z2(1,md),Z2(2,Gt),Z2(3,Mo),Z2(4,Wt)],wk);class Skt{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:n,horizontalPadding:r}=this._widget.getLayoutInfo();return new Gn(t+2*n+r,e+2*n)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var xkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},I1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},IK;class Lkt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=an.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);e.changeDecorations(s=>{this._marker&&s.removeDecoration(this._marker),this._marker=s.addDecoration(W.fromPositions(t,o),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}}let Qu=IK=class{static get(e){return e.getContribution(IK.ID)}constructor(e,t,n,r,o,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Vo,this._toDispose=new Fe,this._selectors=new Ekt(d=>d.priority),this._onWillInsertSuggestItem=new ae,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(SF,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=un.InsertMode.bindTo(r);l.set(e.getOption(118).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(118).insertMode))),this.widget=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>{const d=this._instantiationService.createInstance(wk,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(m=>this._insertSuggestion(m,0),this));const h=new skt(this.editor,d,this.model,m=>this._insertSuggestion(m,2));this._toDispose.add(h);const f=un.MakesTextEdit.bindTo(this._contextKeyService),g=un.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=un.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ot(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:m})=>{const v=this.editor.getPosition(),_=m.editStart.column,y=v.column;let S=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&y-_===m.completion.insertText.length&&(S=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:_,endLineNumber:v.lineNumber,endColumn:y})!==m.completion.insertText),f.set(S),g.set(!le.equals(m.editInsertEnd,m.editReplaceEnd)),p.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(m=>{if(m.toKeyCodeChord().equals(new Bp(!0,!1,!1,!1,33))||Dn&&m.toKeyCodeChord().equals(new Bp(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>this._toDispose.add(new J5(this.editor,this.model)))),this._alternatives=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>this._toDispose.add(new oC(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(yk,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new Lkt(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;if(h===-1&&(h=0),this.model.state===0)return;let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(118);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=un.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 n=is.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new xr;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=wh.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>{let m=W.lift(p.range);if(m.startLineNumber===s.position.lineNumber&&m.startColumn>s.position.column){const v=this.editor.getPosition().column-s.position.column,_=v,y=W.spansMultipleLines(m)?0:v;m=new W(m.startLineNumber,m.startColumn+_,m.endLineNumber,m.endColumn+y)}return Qi.replaceMove(m,p.text)})),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Fs;let p;const m=r.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),m.dispose();return}for(const L of S.changes){const E=W.getEndPosition(L.range);(!p||le.isBefore(E,p))&&(p=E)}}),v=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,v&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>le.isBefore(p,W.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const S=wh.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Qi.replaceMove(W.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(v&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),S),h=S===!0?1:S===!1?0:-2}).finally(()=>{m.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Zb.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===QT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Fs;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?eo(p):nn(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:a3(uu(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Kft(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){Yn(this.editor.hasModel());let n=this.editor.getOption(118).insertMode==="replace";t&&(n=!n);const r=e.position.column-e.editStart.column,o=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Ms(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Pl(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:n?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(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};ot.once(this.model.onDidTrigger)(o=>{const s=[];ot.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(n,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)}};Qu.ID="editor.contrib.suggestController";Qu=IK=xkt([I1(1,Q5),I1(2,cr),I1(3,Gt),I1(4,Wt),I1(5,Ra),I1(6,ia)],Qu);class Ekt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class QT extends pt{constructor(){super({id:QT.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Re.and(K.writable,K.hasCompletionItemProvider,un.Visible.toNegated()),kbOpts:{kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const r=Qu.get(t);if(!r)return;let o;n&&typeof n=="object"&&n.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}QT.id="editor.action.triggerSuggest";Kn(Qu.ID,Qu,2);Ke(QT);const wc=100+90,Aa=zo.bindToContribution(Qu.get);st(new Aa({id:"acceptSelectedSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Re.and(un.Visible,K.textInputFocus),weight:wc},{primary:3,kbExpr:Re.and(un.Visible,K.textInputFocus,un.AcceptSuggestionsOnEnter,un.MakesTextEdit),weight:wc}],menuOpts:[{menuId:Bv,title:w("accept.insert","Insert"),group:"left",order:1,when:un.HasInsertAndReplaceRange.toNegated()},{menuId:Bv,title:w("accept.insert","Insert"),group:"left",order:1,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("insert"))},{menuId:Bv,title:w("accept.replace","Replace"),group:"left",order:1,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("replace"))}]}));st(new Aa({id:"acceptAlternativeSelectedSuggestion",precondition:Re.and(un.Visible,K.textInputFocus,un.HasFocusedSuggestion),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Bv,group:"left",order:2,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Bv,group:"left",order:2,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));kn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");st(new Aa({id:"hideSuggestWidget",precondition:un.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:9,secondary:[1033]}}));st(new Aa({id:"selectNextSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));st(new Aa({id:"selectNextPageSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:12,secondary:[2060]}}));st(new Aa({id:"selectLastSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));st(new Aa({id:"selectPrevSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));st(new Aa({id:"selectPrevPageSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:11,secondary:[2059]}}));st(new Aa({id:"selectFirstSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));st(new Aa({id:"focusSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));st(new Aa({id:"focusAndAcceptSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));st(new Aa({id:"toggleSuggestionDetails",precondition:Re.and(un.Visible,un.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Bv,group:"right",order:1,when:Re.and(un.DetailsVisible,un.CanResolve),title:w("detail.more","show less")},{menuId:Bv,group:"right",order:1,when:Re.and(un.DetailsVisible.toNegated(),un.CanResolve),title:w("detail.less","show more")}]}));st(new Aa({id:"toggleExplainMode",precondition:un.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));st(new Aa({id:"toggleSuggestionFocus",precondition:un.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2570,mac:{primary:778}}}));st(new Aa({id:"insertBestCompletion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),yk.AtEnd,un.Visible.toNegated(),oC.OtherSuggestions.toNegated(),is.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(ba(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:wc,primary:2}}));st(new Aa({id:"insertNextSuggestion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),oC.OtherSuggestions,un.Visible.toNegated(),is.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2}}));st(new Aa({id:"insertPrevSuggestion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),oC.OtherSuggestions,un.Visible.toNegated(),is.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:1026}}));Ke(class extends pt{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Qu.get(e))===null||t===void 0||t.resetWidgetSize()}});class Dkt extends me{get selectedItem(){return this._selectedItem}constructor(e,t,n,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Vn(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=Qu.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;Pi(v=>this.checkModelVersion(v));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=le.lift(c),p=u.map((v,_)=>{const S=cD.fromSuggestion(o,h,g,v,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(S);return{index:_,valid:L,prefixLength:S.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=RY(p,nu(v=>v.prefixLength,mp));return m?m.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(ot.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=cD.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Ikt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Pi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Qu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!n||!r))return cD.fromSuggestion(e,r,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Qu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Qu.get(this.editor);e==null||e.forceRenderingAbove()}}class cD{static fromSuggestion(e,t,n,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new Zb().parse(s);c.children.length<100&&wF.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new cD(W.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,n,r){this.range=e,this.insertText=t,this.completionItemKind=n,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 i1e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new v_(this.range,this.insertText)}}function Ikt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var kkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kK;let Sc=kK=class extends me{static get(e){return e.getContribution(kK.ID)}constructor(e,t,n,r,o,s,a,l,c){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=n,this._configurationService=r,this._commandService=o,this._debounceService=s,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this.model=this._register(nk("inlineCompletionModel",void 0)),this._textModelVersionId=Vn(this,-1),this._positions=Vn(this,[new le(1,1)]),this._suggestWidgetAdaptor=this._register(new Dkt(this.editor,()=>{var f,g;return(g=(f=this.model.get())===null||f===void 0?void 0:f.selectedInlineCompletion.get())===null||g===void 0?void 0:g.toSingleTextEdit(void 0)},f=>this.updateObservables(f,Ql.Other),f=>{Pi(g=>{var p;this.updateObservables(g,Ql.Other),(p=this.model.get())===null||p===void 0||p.handleSuggestAccepted(f)})})),this._enabled=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._fontFamily=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._ghostTexts=en(this,f=>{var g;const p=this.model.read(f);return(g=p==null?void 0:p.ghostTexts.read(f))!==null&&g!==void 0?g:[]}),this._stablizedGhostTexts=Tkt(this._ghostTexts,this._store),this._ghostTextWidgets=g1t(this,this._stablizedGhostTexts,(f,g)=>g.add(this._instantiationService.createInstance(CK,this.editor,{ghostText:f,minReservedLineCount:fp(0),targetTextModel:this.model.map(p=>p==null?void 0:p.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=cQ(this),this._isReadonly=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(91)),this._textModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=en(f=>this._isReadonly.read(f)?void 0:this._textModel.read(f)),this._register(new Ho(this._contextKeyService,this.model)),this._register(yn(f=>{const g=this._textModelIfWritable.read(f);Pi(p=>{if(this.model.set(void 0,p),this.updateObservables(p,Ql.Other),g){const m=t.createInstance(wK,g,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,ji(e.onDidChangeConfiguration,()=>e.getOption(118).preview),ji(e.onDidChangeConfiguration,()=>e.getOption(118).previewMode),ji(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(m,p)}})}));const u=this._register(M1e());this._register(yn(f=>{const g=this._fontFamily.read(f);u.setStyle(g===""||g==="default"?"":` +`,s=new Ns().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!tJ(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,Sl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ps(this._type),this._type.title="",pa(this._type),this.domNode.classList.add("no-type");if(Ps(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ps(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const n=new Gn(e,t);Gn.equals(n,this._size)||(this._size=n,yot(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}};EK=hkt([fkt(1,Wt)],EK);class gkt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Fe,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new OQ,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+o,left:n.left+s})}a.done&&(n=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return 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){var n;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var r;const o=Wp(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Gn(220,2*s.lineHeight),l=e.top,c=function(){const E=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),D=-s.borderWidth+e.left+e.width,k=new Gn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),u=function(){const E=e.left-s.borderWidth-s.horizontalPadding,D=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),k=new Gn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),d=function(){const E=e.left,D=-s.borderWidth+e.top+e.height,k=new Gn(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:D,left:E,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:a.with(k.width)}}(),h=[c,u,d],f=(r=h.find(E=>E.fit>=0))!==null&&r!==void 0?r:h.sort((E,D)=>D.fit-E.fit)[0],g=e.top+e.height-s.borderHeight;let p,m=t.height;const v=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);m>v&&(m=v);let _;n?m<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):m<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop);let{top:y,left:S}=f;!p&&m>e.height&&(y=g-m);const L=this._editor.getDomNode();if(L){const E=L.getBoundingClientRect();y-=E.top,S-=E.left}this._applyTopLeft({left:S,top:y}),this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(m,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var If;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(If||(If={}));const pkt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function X2(i,e,t,n,r){if(r)return[`codicon-${r.id}`,"predefined-file-icon"];const o=n===If.ROOT_FOLDER?["rootfolder-icon"]:n===If.FOLDER?["folder-icon"]:["file-icon"];if(t){let s;if(t.scheme===cn.data)s=r_.parseMetaData(t).get(r_.META_DATA_LABEL);else{const a=t.path.match(pkt);a?(s=Y2(a[2].toLowerCase()),a[1]&&o.push(`${Y2(a[1].toLowerCase())}-name-dir-icon`)):s=Y2(t.authority.toLowerCase())}if(n===If.ROOT_FOLDER)o.push(`${s}-root-name-folder-icon`);else if(n===If.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),o.push("name-file-icon"),s.length<=255){const l=s.split(".");for(let c=1;c=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mm;function qEe(i){return`suggest-aria-id:${i}`}const _kt=Or("suggest-more-info",tt.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),bkt=new(mm=class{extract(e,t){if(e.textLabel.match(mm._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(mm._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const n=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,r=mm._regexRelaxed.exec(n);if(r&&(r.index===0||r.index+r[0].length===n.length))return t[0]=r[0],!0}return!1}},mm._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*\))/,mm._regexStrict=new RegExp(`^${mm._regexRelaxed.source}$`,"i"),mm);let DK=class{constructor(e,t,n,r){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=r,this._onDidToggleDetails=new ae,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Fe,n=e;n.classList.add("show-file-icons");const r=Oe(e,Xe(".icon")),o=Oe(r,Xe("span.colorspan")),s=Oe(e,Xe(".contents")),a=Oe(s,Xe(".main")),l=Oe(a,Xe(".icon-label.codicon")),c=Oe(a,Xe("span.left")),u=Oe(a,Xe("span.right")),d=new KO(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=Oe(c,Xe("span.signature-label")),f=Oe(c,Xe("span.qualifier-label")),g=Oe(u,Xe("span.details-label")),p=Oe(u,Xe("span.readMore"+Vt.asCSSSelector(_kt)));return p.title=w("readMore","Read More"),{root:n,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const v=this._editor.getOptions(),_=v.get(50),y=_.getMassagedFontFamily(),S=_.fontFeatureSettings,L=v.get(119)||_.fontSize,E=v.get(120)||_.lineHeight,D=_.fontWeight,k=_.letterSpacing,T=`${L}px`,M=`${E}px`,P=`${k}px`;n.style.fontSize=T,n.style.fontWeight=D,n.style.letterSpacing=P,a.style.fontFamily=y,a.style.fontFeatureSettings=S,a.style.lineHeight=M,r.style.height=M,r.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,n){n.configureFont();const{completion:r}=e;n.root.id=qEe(t),n.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:TT(e.score)},s=[];if(r.kind===19&&bkt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:e.textLabel}),If.FILE),l=X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:r.detail}),If.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",o.extraClasses=[X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:e.textLabel}),If.FOLDER),X2(this._modelService,this._languageService,Ft.from({scheme:"fake",path:r.detail}),If.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Vt.asClassNameArray(rI.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=iW(r.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=iW(r.label.detail||""),n.detailsLabel.textContent=iW(r.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(118).showInlineDetails?Sl(n.detailsLabel):pa(n.detailsLabel),tJ(e)?(n.right.classList.add("can-expand-details"),Sl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),pa(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};DK=vkt([nW(1,or),nW(2,qi),nW(3,Mo)],DK);function iW(i){return i.replace(/\r\n|\r|\n/g,"")}var Ckt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Z2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},U1;X("editorSuggestWidget.background",{dark:Pr,light:Pr,hcDark:Pr,hcLight:Pr},w("editorSuggestWidgetBackground","Background color of the suggest widget."));X("editorSuggestWidget.border",{dark:op,light:op,hcDark:op,hcLight:op},w("editorSuggestWidgetBorder","Border color of the suggest widget."));const Q2=X("editorSuggestWidget.foreground",{dark:Xu,light:Xu,hcDark:Xu,hcLight:Xu},w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));X("editorSuggestWidget.selectedForeground",{dark:X0,light:X0,hcDark:X0,hcLight:X0},w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));X("editorSuggestWidget.selectedIconForeground",{dark:vy,light:vy,hcDark:vy,hcLight:vy},w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const ykt=X("editorSuggestWidget.selectedBackground",{dark:Y0,light:Y0,hcDark:Y0,hcLight:Y0},w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));X("editorSuggestWidget.highlightForeground",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));X("editorSuggestWidget.focusHighlightForeground",{dark:qR,light:qR,hcDark:qR,hcLight:qR},w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));X("editorSuggestWidgetStatus.foreground",{dark:Mt(Q2,.5),light:Mt(Q2,.5),hcDark:Mt(Q2,.5),hcLight:Mt(Q2,.5)},w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class wkt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof h_}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Gn.is(n))return Gn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let wk=U1=class{constructor(e,t,n,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Vo,this._pendingShowDetails=new Vo,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new gd,this._disposables=new Fe,this._onDidSelect=new Ob,this._onDidFocus=new Ob,this._onDidHide=new ae,this._onDidShow=new ae,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new ae,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new OQ,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Skt(this,e),this._persistedSize=new wkt(t,e);class s{constructor(f,g,p=!1,m=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=m}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,m;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:_}=this.getLayoutInfo(),y=Math.round(v/2);let{width:S,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-S)<=y)&&(S=(m=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&m!==void 0?m:_.width),this._persistedSize.store(new Gn(S,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Oe(this.element.domNode,Xe(".message")),this._listElement=Oe(this.element.domNode,Xe(".tree"));const l=this._disposables.add(o.createInstance(EK,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new gkt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(118).showIcons);c();const u=o.createInstance(DK,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Ec("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:_}=h.completion.label;v&&_?f=w("label.full","{0} {1}, {2}",f,v,_):v?f=w("label.detail","{0} {1}",f,v):_&&(f=w("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,m=Fb("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,m)}}}),this._list.style(ZS({listInactiveFocusBackground:ykt,listInactiveFocusOutline:Ki})),this._status=o.createInstance(LK,this.element.domNode,Bv);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(118).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(118)&&(d(),c()),this._completionModel&&(h.hasChanged(50)||h.hasChanged(119)||h.hasChanged(120))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=un.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=un.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=un.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=un.HasFocusedSuggestion.bindTo(n),this._disposables.add(Lr(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=sh(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const n=e.elements[0],r=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(r),this._currentSuggestionDetails=No(async o=>{const s=Qv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return await n.resolve(o)}finally{s.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{r>=this._list.length||n!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[n]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:qEe(r)}))}).catch(nn)),this._onDidFocus.fire({item:n,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:pa(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=U1.LOADING_MESSAGE,pa(this._listElement,this._status.element),Sl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,jf(U1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=U1.NO_SUGGESTIONS_MESSAGE,pa(this._listElement,this._status.element),Sl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,jf(U1.NO_SUGGESTIONS_MESSAGE);break;case 3:pa(this._messageElement),Sl(this._listElement,this._status.element),this._show();break;case 4:pa(this._messageElement),Sl(this._listElement,this._status.element),this._show();break;case 5:pa(this._messageElement),Sl(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=Qv(()=>this._setState(1),t)))}showSuggestions(e,t,n,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(n?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=HA(Bt(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")):(tJ(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=HA(Bt(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 e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Hr(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,m=Math.min(o.height-p-s.verticalPadding,d),v=f.top+g.top-s.verticalPadding,_=Math.min(v,d);let y=Math.min(Math.max(_,m)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const S=150;a>m||this._forceRenderingAbove&&v>S?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=m),this.element.preferredSize=new Gn(u,s.defaultSize.height),this.element.maxSize=new Gn(c,y),this.element.minSize=new Gn(220,h),this._cappedHeight=a===d?{wanted:(r=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:r}=this.element.maxSize;e=Math.min(n,e),t=Math.min(r,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=fa(this.editor.getOption(120)||e.lineHeight,8,1e3),n=!this.editor.getOption(118).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:n,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Gn(430,n+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};wk.LOADING_MESSAGE=w("suggestWidget.loading","Loading...");wk.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions.");wk=U1=Ckt([Z2(1,md),Z2(2,Gt),Z2(3,Mo),Z2(4,Wt)],wk);class Skt{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:n,horizontalPadding:r}=this._widget.getLayoutInfo();return new Gn(t+2*n+r,e+2*n)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var xkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},I1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},IK;class Lkt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=an.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);e.changeDecorations(s=>{this._marker&&s.removeDecoration(this._marker),this._marker=s.addDecoration(W.fromPositions(t,o),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}}let Qu=IK=class{static get(e){return e.getContribution(IK.ID)}constructor(e,t,n,r,o,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Vo,this._toDispose=new Fe,this._selectors=new Ekt(d=>d.priority),this._onWillInsertSuggestItem=new ae,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(SF,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=un.InsertMode.bindTo(r);l.set(e.getOption(118).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(118).insertMode))),this.widget=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>{const d=this._instantiationService.createInstance(wk,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(m=>this._insertSuggestion(m,0),this));const h=new skt(this.editor,d,this.model,m=>this._insertSuggestion(m,2));this._toDispose.add(h);const f=un.MakesTextEdit.bindTo(this._contextKeyService),g=un.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=un.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ot(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:m})=>{const v=this.editor.getPosition(),_=m.editStart.column,y=v.column;let S=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&y-_===m.completion.insertText.length&&(S=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:_,endLineNumber:v.lineNumber,endColumn:y})!==m.completion.insertText),f.set(S),g.set(!le.equals(m.editInsertEnd,m.editReplaceEnd)),p.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(m=>{if(m.toKeyCodeChord().equals(new Bp(!0,!1,!1,!1,33))||Dn&&m.toKeyCodeChord().equals(new Bp(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>this._toDispose.add(new J5(this.editor,this.model)))),this._alternatives=this._toDispose.add(new y9(Bt(e.getDomNode()),()=>this._toDispose.add(new sC(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(yk,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new Lkt(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;if(h===-1&&(h=0),this.model.state===0)return;let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(118);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=un.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 n=is.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new xr;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=wh.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>{let m=W.lift(p.range);if(m.startLineNumber===s.position.lineNumber&&m.startColumn>s.position.column){const v=this.editor.getPosition().column-s.position.column,_=v,y=W.spansMultipleLines(m)?0:v;m=new W(m.startLineNumber,m.startColumn+_,m.endLineNumber,m.endColumn+y)}return Ji.replaceMove(m,p.text)})),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Fs;let p;const m=r.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),m.dispose();return}for(const L of S.changes){const E=W.getEndPosition(L.range);(!p||le.isBefore(E,p))&&(p=E)}}),v=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,v&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>le.isBefore(p,W.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const S=wh.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Ji.replaceMove(W.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(v&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),S),h=S===!0?1:S===!1?0:-2}).finally(()=>{m.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Qb.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===QT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Fs;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?eo(p):nn(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:a3(uu(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Kft(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){Yn(this.editor.hasModel());let n=this.editor.getOption(118).insertMode==="replace";t&&(n=!n);const r=e.position.column-e.editStart.column,o=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Ms(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Pl(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:n?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(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};ot.once(this.model.onDidTrigger)(o=>{const s=[];ot.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(n,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)}};Qu.ID="editor.contrib.suggestController";Qu=IK=xkt([I1(1,Q5),I1(2,cr),I1(3,Gt),I1(4,Wt),I1(5,Ra),I1(6,ia)],Qu);class Ekt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class QT extends pt{constructor(){super({id:QT.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Re.and(K.writable,K.hasCompletionItemProvider,un.Visible.toNegated()),kbOpts:{kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const r=Qu.get(t);if(!r)return;let o;n&&typeof n=="object"&&n.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}QT.id="editor.action.triggerSuggest";Kn(Qu.ID,Qu,2);Ke(QT);const wc=100+90,Aa=zo.bindToContribution(Qu.get);st(new Aa({id:"acceptSelectedSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Re.and(un.Visible,K.textInputFocus),weight:wc},{primary:3,kbExpr:Re.and(un.Visible,K.textInputFocus,un.AcceptSuggestionsOnEnter,un.MakesTextEdit),weight:wc}],menuOpts:[{menuId:Bv,title:w("accept.insert","Insert"),group:"left",order:1,when:un.HasInsertAndReplaceRange.toNegated()},{menuId:Bv,title:w("accept.insert","Insert"),group:"left",order:1,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("insert"))},{menuId:Bv,title:w("accept.replace","Replace"),group:"left",order:1,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("replace"))}]}));st(new Aa({id:"acceptAlternativeSelectedSuggestion",precondition:Re.and(un.Visible,K.textInputFocus,un.HasFocusedSuggestion),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Bv,group:"left",order:2,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Bv,group:"left",order:2,when:Re.and(un.HasInsertAndReplaceRange,un.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));kn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");st(new Aa({id:"hideSuggestWidget",precondition:un.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:9,secondary:[1033]}}));st(new Aa({id:"selectNextSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));st(new Aa({id:"selectNextPageSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:12,secondary:[2060]}}));st(new Aa({id:"selectLastSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));st(new Aa({id:"selectPrevSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));st(new Aa({id:"selectPrevPageSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:11,secondary:[2059]}}));st(new Aa({id:"selectFirstSuggestion",precondition:Re.and(un.Visible,Re.or(un.MultipleSuggestions,un.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));st(new Aa({id:"focusSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));st(new Aa({id:"focusAndAcceptSuggestion",precondition:Re.and(un.Visible,un.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));st(new Aa({id:"toggleSuggestionDetails",precondition:Re.and(un.Visible,un.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Bv,group:"right",order:1,when:Re.and(un.DetailsVisible,un.CanResolve),title:w("detail.more","show less")},{menuId:Bv,group:"right",order:1,when:Re.and(un.DetailsVisible.toNegated(),un.CanResolve),title:w("detail.less","show more")}]}));st(new Aa({id:"toggleExplainMode",precondition:un.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));st(new Aa({id:"toggleSuggestionFocus",precondition:un.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2570,mac:{primary:778}}}));st(new Aa({id:"insertBestCompletion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),yk.AtEnd,un.Visible.toNegated(),sC.OtherSuggestions.toNegated(),is.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(ba(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:wc,primary:2}}));st(new Aa({id:"insertNextSuggestion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),sC.OtherSuggestions,un.Visible.toNegated(),is.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:2}}));st(new Aa({id:"insertPrevSuggestion",precondition:Re.and(K.textInputFocus,Re.equals("config.editor.tabCompletion","on"),sC.OtherSuggestions,un.Visible.toNegated(),is.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:wc,kbExpr:K.textInputFocus,primary:1026}}));Ke(class extends pt{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Qu.get(e))===null||t===void 0||t.resetWidgetSize()}});class Dkt extends me{get selectedItem(){return this._selectedItem}constructor(e,t,n,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Vn(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=Qu.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;Pi(v=>this.checkModelVersion(v));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=le.lift(c),p=u.map((v,_)=>{const S=cD.fromSuggestion(o,h,g,v,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(S);return{index:_,valid:L,prefixLength:S.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=RY(p,nu(v=>v.prefixLength,mp));return m?m.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(ot.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=cD.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Ikt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Pi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Qu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!n||!r))return cD.fromSuggestion(e,r,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Qu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Qu.get(this.editor);e==null||e.forceRenderingAbove()}}class cD{static fromSuggestion(e,t,n,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new Qb().parse(s);c.children.length<100&&wF.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new cD(W.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,n,r){this.range=e,this.insertText=t,this.completionItemKind=n,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 i1e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new __(this.range,this.insertText)}}function Ikt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var kkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kK;let Sc=kK=class extends me{static get(e){return e.getContribution(kK.ID)}constructor(e,t,n,r,o,s,a,l,c){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=n,this._configurationService=r,this._commandService=o,this._debounceService=s,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this.model=this._register(nk("inlineCompletionModel",void 0)),this._textModelVersionId=Vn(this,-1),this._positions=Vn(this,[new le(1,1)]),this._suggestWidgetAdaptor=this._register(new Dkt(this.editor,()=>{var f,g;return(g=(f=this.model.get())===null||f===void 0?void 0:f.selectedInlineCompletion.get())===null||g===void 0?void 0:g.toSingleTextEdit(void 0)},f=>this.updateObservables(f,Ql.Other),f=>{Pi(g=>{var p;this.updateObservables(g,Ql.Other),(p=this.model.get())===null||p===void 0||p.handleSuggestAccepted(f)})})),this._enabled=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._fontFamily=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._ghostTexts=en(this,f=>{var g;const p=this.model.read(f);return(g=p==null?void 0:p.ghostTexts.read(f))!==null&&g!==void 0?g:[]}),this._stablizedGhostTexts=Tkt(this._ghostTexts,this._store),this._ghostTextWidgets=g1t(this,this._stablizedGhostTexts,(f,g)=>g.add(this._instantiationService.createInstance(CK,this.editor,{ghostText:f,minReservedLineCount:fp(0),targetTextModel:this.model.map(p=>p==null?void 0:p.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=cQ(this),this._isReadonly=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(91)),this._textModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=en(f=>this._isReadonly.read(f)?void 0:this._textModel.read(f)),this._register(new Ho(this._contextKeyService,this.model)),this._register(yn(f=>{const g=this._textModelIfWritable.read(f);Pi(p=>{if(this.model.set(void 0,p),this.updateObservables(p,Ql.Other),g){const m=t.createInstance(wK,g,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,ji(e.onDidChangeConfiguration,()=>e.getOption(118).preview),ji(e.onDidChangeConfiguration,()=>e.getOption(118).previewMode),ji(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(m,p)}})}));const u=this._register(M1e());this._register(yn(f=>{const g=this._fontFamily.read(f);u.setStyle(g===""||g==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${g}; -}`)}));const d=f=>{var g;return f.isUndoing?Ql.Undo:f.isRedoing?Ql.Redo:!((g=this.model.get())===null||g===void 0)&&g.isAcceptingPartially?Ql.AcceptWord:Ql.Other};this._register(e.onDidChangeModelContent(f=>Pi(g=>this.updateObservables(g,d(f))))),this._register(e.onDidChangeCursorPosition(f=>Pi(g=>{var p;this.updateObservables(g,Ql.Other),(f.reason===3||f.source==="api")&&((p=this.model.get())===null||p===void 0||p.stop(g))}))),this._register(e.onDidType(()=>Pi(f=>{var g;this.updateObservables(f,Ql.Other),this._enabled.get()&&((g=this.model.get())===null||g===void 0||g.trigger(f))}))),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([ow.Tab.id,ow.DeleteLeft.id,ow.DeleteRight.id,fEe,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Pi(p=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(p)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||p_.dropDownVisible||Pi(f=>{var g;(g=this.model.get())===null||g===void 0||g.stop(f)})})),this._register(yn(f=>{var g;const p=(g=this.model.read(f))===null||g===void 0?void 0:g.state.read(f);p!=null&&p.suggestItem?p.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ot(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));let h;this._register($T({handleChange:(f,g)=>(f.didChange(this._playAccessibilitySignal)&&(h=void 0),!0)},async f=>{this._playAccessibilitySignal.read(f);const g=this.model.read(f),p=g==null?void 0:g.state.read(f);if(!g||!p||!p.inlineCompletion){h=void 0;return}if(p.inlineCompletion.semanticId!==h){h=p.inlineCompletion.semanticId;const m=g.textModel.getLineContent(p.primaryGhostText.lineNumber);this._accessibilitySignalService.playSignal(dn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(p.primaryGhostText.renderForScreenReader(m))})}})),this._register(new nK(this.editor,this.model,this._instantiationService)),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"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&n&&this.editor.getOption(148)&&(r=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),Pl(r?e+", "+r:e)}updateObservables(e,t){var n,r,o;const s=this.editor.getModel();this._textModelVersionId.set((n=s==null?void 0:s.getVersionId())!==null&&n!==void 0?n:-1,e,t),this._positions.set((o=(r=this.editor.getSelections())===null||r===void 0?void 0:r.map(a=>a.getPosition()))!==null&&o!==void 0?o:[new le(1,1)],e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return n?n.parts.some(r=>e.containsPosition(new le(n.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&n!==void 0?n:!1}};Sc.ID="editor.contrib.inlineCompletionsController";Sc=kK=kkt([vm(1,Wt),vm(2,Gt),vm(3,mn),vm(4,cr),vm(5,_u),vm(6,yt),vm(7,F_),vm(8,ci)],Sc);function Tkt(i,e){const t=Vn("result",[]),n=[];return e.add(yn(r=>{const o=i.read(r);Pi(s=>{if(o.length!==n.length){n.length=o.length;for(let a=0;aa.set(o[l],s))})})),t}class eB extends pt{constructor(){super({id:eB.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const r=Sc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.next()}}eB.ID=pEe;class tB extends pt{constructor(){super({id:tB.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const r=Sc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.previous()}}tB.ID=gEe;class Nkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:K.writable})}async run(e,t){const n=Sc.get(t);await l1t(async r=>{var o;await((o=n==null?void 0:n.model.get())===null||o===void 0?void 0:o.triggerExplicitly(r)),n==null||n.playAccessibilitySignal(r)})}}class Rkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:w("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Re.and(K.writable,Ho.inlineSuggestionVisible)},menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const r=Sc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextWord(r.editor))}}class Mkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:w("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const r=Sc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextLine(r.editor))}}class Pkt extends pt{constructor(){super({id:fEe,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Ho.inlineSuggestionVisible,menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Re.and(Ho.inlineSuggestionVisible,K.tabMovesFocus.toNegated(),Ho.inlineSuggestionHasIndentationLessThanTabSize,un.Visible.toNegated(),K.hoverFocused.toNegated())}})}async run(e,t){var n;const r=Sc.get(t);r&&((n=r.model.get())===null||n===void 0||n.accept(r.editor),r.editor.focus())}}class nB extends pt{constructor(){super({id:nB.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Ho.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const n=Sc.get(t);Pi(r=>{var o;(o=n==null?void 0:n.model.get())===null||o===void 0||o.stop(r)})}}nB.ID="editor.action.inlineSuggest.hide";class iB extends dl{constructor(){super({id:iB.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:H.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Re.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const n=e.get(mn),o=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",o)}}iB.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Akt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Okt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let TK=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Sc.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new bb(1e3,this,W.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new bb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new bb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const n=Sc.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Okt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Fe,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,n);const o=r.controller.model.get(),s=this._instantiationService.createInstance(p_,this._editor,!1,fp(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const r=Xe,o=r("div.hover-row.markdown-hover"),s=Oe(o,r("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new qf({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=w("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new Ns().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(yn(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.primaryGhostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else ms(s)})),e.fragment.appendChild(o)}};TK=Akt([EL(1,qi),EL(2,hl),EL(3,pd),EL(4,Wt),EL(5,ia)],TK);Kn(Sc.ID,Sc,3);Ke(Nkt);Ke(eB);Ke(tB);Ke(Rkt);Ke(Mkt);Ke(Pkt);Ke(nB);ki(iB);W_.register(TK);function yl(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function XEe(i,e,t,n,r){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,i.getLineCount());t<=n&&o.unIndentedLinePattern;){const m=i.getLineContent(t);if(!o.unIndentedLinePattern.test(m))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(m,v)=>(v=v||1,qc.shiftIndent(m,m.length+v,s,a,l)),u=(m,v)=>(v=v||1,qc.unshiftIndent(m,m.length+v,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(r!=null){h=r;const m=yi(f);g=h+f.substring(m.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(m.length)),f!==g&&d.push(Qi.replaceMove(new Et(t,1,t,m.length+1),rO(h,a,l)))}else h=yi(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let m=t;m<=n;m++){const v=i.getLineContent(m),_=yi(v),y=p+v.substring(_.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(p=u(p),h=u(h)),_!==p&&d.push(Qi.replaceMove(new Et(m,1,m,_.length+1),rO(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?p=c(p):p=h)}return d}class rB extends pt{constructor(){super({id:rB.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:K.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new Vkt(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}rB.ID="editor.action.indentationToSpaces";class oB extends pt{constructor(){super({id:oB.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:K.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new zkt(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}oB.ID="editor.action.indentationToTabs";class nJ extends pt{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(Ph),r=e.get(rr),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?w("configuredTabSize","Configured Tab Size"):u===s.tabSize?w("defaultTabSize","Default Tab Size"):u===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class sB extends nJ{constructor(){super(!1,!1,{id:sB.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}sB.ID="editor.action.indentUsingTabs";class aB extends nJ{constructor(){super(!0,!1,{id:aB.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}aB.ID="editor.action.indentUsingSpaces";class lB extends nJ{constructor(){super(!0,!0,{id:lB.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}lB.ID="editor.action.changeTabDisplaySize";class cB extends pt{constructor(){super({id:cB.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(rr),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}cB.ID="editor.action.detectIndentation";class Wkt extends pt{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:K.writable})}run(e,t){const n=e.get(Ti),r=t.getModel();if(!r)return;const o=XEe(r,n,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class $kt extends pt{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:K.writable})}run(e,t){const n=e.get(Ti),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=XEe(r,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Hkt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(W.lift(r.range),r.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let Sk=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Fe,this.callOnModel=new Fe,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 n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>qc.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>qc.unshiftIndent(f,f.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=HE(r,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=yi(d),p=yl(f,o),m=yl(g,o);if(p!==m){const v=uD(p,o,a);l.push({range:new W(u,1,u,g.length+1),text:v}),d=v+d.substr(g.length)}else{const v=twe(n,u,this._languageConfigurationService);if(v===0||v===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,m)=>n.getLanguageIdAtPosition(p,m)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=yl(g,o),m=yl(yi(n.getLineContent(u+1)),o);if(p!==m){const v=p-m;for(let _=u+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),S=yi(y),E=yl(S,o)+v,D=uD(E,o,a);D!==S&&l.push({range:new W(_,1,_,S.length+1),text:D})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Hkt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(n);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};Sk.ID="editor.contrib.autoIndentOnPaste";Sk=Fkt([Bkt(1,Ti)],Sk);function YEe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let r="";for(let s=0;sthis._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){var t,n,r;try{const o=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this.hint.textEdits=(r=o==null?void 0:o.textEdits)!==null&&r!==void 0?r:this.hint.textEdits,this._isResolved=!0}catch(o){eo(o),this._isResolved=!1}}}class wb{static async create(e,t,n,r){const o=[],s=e.ordered(t).reverse().map(a=>n.map(async l=>{try{const c=await a.provideInlayHints(t,l,r);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??wb._emptyInlayHintList,a])}catch(c){eo(c)}}));if(await Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new k_;return new wb(n,o,t)}constructor(e,t,n){this._disposables=new Fe,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=n.validatePosition(a.position);let c="before";const u=wb._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=W.fromPositions(u.getStartPosition(),l),c="after"):(d=W.fromPositions(l,u.getEndPosition()),c="before"),r.push(new iJ(a,new ZEe(d,c),s))}}this.items=r.sort((o,s)=>le.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new W(n,r.startColumn,n,r.endColumn);e.tokenization.tokenizeIfCheap(n);const o=e.tokenization.getLineTokens(n),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&ahy(g)?g.command.id:T5()));for(const g of Ys.all())h.has(g.desc.id)&&d.push(new Il(g.desc.id,bc.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await o.createModelReference(u.uri);try{const m=new CS(p.object.textEditorModel,W.getStartPosition(u.range)),v=n.item.anchor.range;await l.invokeFunction(g.runEditorCommand.bind(g),e,m,v)}finally{p.dispose()}}));if(n.part.command){const{command:g}=n.part;d.push(new ho),d.push(new Il(g.id,g.title,void 0,!0,async()=>{var p;try{await a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(m){c.notify({severity:U3.Error,source:n.item.provider.displayName,message:m})}}))}const f=e.getOption(127);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=Hr(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function QEe(i,e,t,n){const o=await i.get(ul).createModelReference(n.uri);await t.invokeWithinContext(async s=>{const a=e.hasSideBySideModifier,l=s.get(Gt),c=al.inPeekEditor.getValue(l),u=!a&&t.getOption(88)&&!c;return new YT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new CS(o.object.textEditorModel,W.getStartPosition(n.range)),W.lift(n.range))}),o.dispose()}var Kkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},j1;class xF{constructor(){this._entries=new N_(50)}get(e){const t=xF._key(e);return this._entries.get(t)}set(e,t){const n=xF._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const JEe=Sn("IInlayHintsCache");Tn(JEe,xF,1);class NK{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 Gkt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let __=j1=class{static get(e){var t;return(t=e.getContribution(j1.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new Fe,this._sessionDisposables=new Fe,this._decorationsMetadata=new Map,this._ruleFactory=new yT(this._editor),this._activeRenderMode=0,this._debounceInfo=n.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(140)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(140);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(tp.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(Ot(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new mi(async()=>{const a=Date.now();r==null||r.dispose(!0),r=new xr;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=await wb.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){nn(c)}finally{r.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(s),this._sessionDisposables.add(Ot(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{r==null||r.cancel();const l=Math.max(s.delay,1250);s.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Fe,t=e.add(new M5(this._editor)),n=new Fe;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new xr;n.add(Ot(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Gkt(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new W(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(Ot(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(async r=>{const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(QEe,r,this._editor,s.location):aV.is(s.command)&&await this._invokeCommand(s.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(n&&(t.event.preventDefault(),await n.item.resolve(wn.None),Ms(n.item.hint.textEdits))){const r=n.item.hint.textEdits.map(o=>Qi.replace(W.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(jkt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof o_&&(n==null?void 0:n.attachedData)instanceof NK)return n.attachedData}async _invokeCommand(e,t){var n;try{await this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(r){this._notificationService.notify({severity:U3.Error,source:t.provider.displayName,message:r})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(n);if(o){const s=new ZEe(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of n.sort(W.compareRangesUsingStarts)){const s=t.validateRange(new W(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!W.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=W.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var n,r;const o=[],s=(m,v,_,y,S)=>{const L={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:y,attachedData:S};o.push({item:m,classNameRef:v,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?L:void 0}}})},a=(m,v)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,_," ",v?qu.Right:qu.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);let f={line:0,totalLen:0};for(const m of t){if(f.line!==m.anchor.range.startLineNumber&&(f={line:m.anchor.range.startLineNumber,totalLen:0}),f.totalLen>j1._MAX_LABEL_LEN)continue;m.hint.paddingLeft&&a(m,!1);const v=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let _=0;_0&&(D=D.slice(0,-T)+"…",k=!0),s(m,this._ruleFactory.createClassNameRef(E),qkt(D),L&&!m.hint.paddingRight?qu.Right:qu.None,new NK(m,_)),k)break}if(m.hint.paddingRight&&a(m,!0),o.length>j1._MAX_DECORATORS)break}const g=[];for(const[m,v]of this._decorationsMetadata){const _=(r=this._editor.getModel())===null||r===void 0?void 0:r.getDecorationRange(m);_&&e.some(y=>y.containsRange(_))&&(g.push(m),v.classNameRef.dispose(),this._decorationsMetadata.delete(m))}const p=wh.capture(this._editor);this._editor.changeDecorations(m=>{const v=m.deltaDecorations(g,o.map(_=>_.decoration));for(let _=0;_n)&&(o=n);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};__.ID="editor.contrib.InlayHints";__._MAX_DECORATORS=1500;__._MAX_LABEL_LEN=43;__=j1=Kkt([k1(1,yt),k1(2,_u),k1(3,JEe),k1(4,cr),k1(5,zr),k1(6,Wt)],__);function qkt(i){const e=" ";return i.replace(/[ \t]/g,e)}kn.registerCommand("_executeInlayHintProvider",async(i,...e)=>{const[t,n]=e;Yn(Ft.isUri(t)),Yn(W.isIRange(n));const{inlayHintsProvider:r}=i.get(yt),o=await i.get(ul).createModelReference(t);try{const s=await wb.create(r,o.object.textEditorModel,[W.lift(n)],wn.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}});var Xkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Che extends bb{constructor(e,t,n,r){super(10,t,e.item.anchor.range,n,r,!0),this.part=e}}let RK=class extends gF{constructor(e,t,n,r,o,s){super(e,t,n,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!__.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof o_&&r.attachedData instanceof NK?new Che(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof Che?new Xr(async r=>{const{part:o}=e;if(await o.item.resolve(n),n.isCancellationRequested)return;let s;typeof o.item.hint.tooltip=="string"?s=new Ns().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(s=o.item.hint.tooltip),s&&r.emitOne(new qd(this,e.range,[s],!1,0)),Ms(o.item.hint.textEdits)&&r.emitOne(new qd(this,e.range,[new Ns().appendText(w("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Ns().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&r.emitOne(new qd(this,e.range,[a],!1,1)),o.part.location||o.part.command){let c;const d=this._editor.getOption(78)==="altKey"?Dn?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Dn?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");o.part.location&&o.part.command?c=new Ns().appendText(w("hint.defAndCommand","Go to Definition ({0}), right click for more",d)):o.part.location?c=new Ns().appendText(w("hint.def","Go to Definition ({0})",d)):o.part.command&&(c=new Ns(`[${w("hint.cmd","Execute Command")}](${Ukt(o.part.command)} "${o.part.command.title}") (${d})`,{isTrusted:!0})),c&&r.emitOne(new qd(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(o,n);for await(const c of l)r.emitOne(c)}):Xr.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Xr.EMPTY;const{uri:n,range:r}=e.part.location,o=await this._resolverService.createModelReference(n);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?BQ(this._languageFeaturesService.hoverProvider,s,new le(r.startLineNumber,r.startColumn),t).filter(a=>!aS(a.hover.contents)).map(a=>new qd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Xr.EMPTY}finally{o.dispose()}}};RK=Xkt([DL(1,qi),DL(2,hl),DL(3,mn),DL(4,ul),DL(5,yt)],RK);Kn(__.ID,__,1);W_.register(RK);class Ykt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Et(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new Et(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var Zkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gP;let b_=gP=class{static get(e){return e.getContribution(gP.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new Lxe(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=No(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=W.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new Et(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new Ykt(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:gP.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=Yv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(nn)}).catch(nn)):Promise.resolve(void 0)}};b_.ID="editor.contrib.inPlaceReplaceController";b_.DECORATION=an.register({description:"in-place-replace",className:"valueSetReplacement"});b_=gP=Zkt([Qkt(1,vd)],b_);class Jkt extends pt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=b_.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class eTt extends pt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=b_.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}Kn(b_.ID,b_,4);Ke(Jkt);Ke(eTt);class tTt extends pt{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:K.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(n.source,3,qo.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(n.source,!0)}}Ke(tTt);class nTt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=iTt(e,this._cursors);for(let r=0,o=n.length;rs.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,r=0;const o=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(r{var g;return f.isUndoing?Ql.Undo:f.isRedoing?Ql.Redo:!((g=this.model.get())===null||g===void 0)&&g.isAcceptingPartially?Ql.AcceptWord:Ql.Other};this._register(e.onDidChangeModelContent(f=>Pi(g=>this.updateObservables(g,d(f))))),this._register(e.onDidChangeCursorPosition(f=>Pi(g=>{var p;this.updateObservables(g,Ql.Other),(f.reason===3||f.source==="api")&&((p=this.model.get())===null||p===void 0||p.stop(g))}))),this._register(e.onDidType(()=>Pi(f=>{var g;this.updateObservables(f,Ql.Other),this._enabled.get()&&((g=this.model.get())===null||g===void 0||g.trigger(f))}))),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([ow.Tab.id,ow.DeleteLeft.id,ow.DeleteRight.id,fEe,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Pi(p=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(p)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||m_.dropDownVisible||Pi(f=>{var g;(g=this.model.get())===null||g===void 0||g.stop(f)})})),this._register(yn(f=>{var g;const p=(g=this.model.read(f))===null||g===void 0?void 0:g.state.read(f);p!=null&&p.suggestItem?p.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ot(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));let h;this._register($T({handleChange:(f,g)=>(f.didChange(this._playAccessibilitySignal)&&(h=void 0),!0)},async f=>{this._playAccessibilitySignal.read(f);const g=this.model.read(f),p=g==null?void 0:g.state.read(f);if(!g||!p||!p.inlineCompletion){h=void 0;return}if(p.inlineCompletion.semanticId!==h){h=p.inlineCompletion.semanticId;const m=g.textModel.getLineContent(p.primaryGhostText.lineNumber);this._accessibilitySignalService.playSignal(dn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(p.primaryGhostText.renderForScreenReader(m))})}})),this._register(new nK(this.editor,this.model,this._instantiationService)),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"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&n&&this.editor.getOption(148)&&(r=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),Pl(r?e+", "+r:e)}updateObservables(e,t){var n,r,o;const s=this.editor.getModel();this._textModelVersionId.set((n=s==null?void 0:s.getVersionId())!==null&&n!==void 0?n:-1,e,t),this._positions.set((o=(r=this.editor.getSelections())===null||r===void 0?void 0:r.map(a=>a.getPosition()))!==null&&o!==void 0?o:[new le(1,1)],e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return n?n.parts.some(r=>e.containsPosition(new le(n.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&n!==void 0?n:!1}};Sc.ID="editor.contrib.inlineCompletionsController";Sc=kK=kkt([vm(1,Wt),vm(2,Gt),vm(3,mn),vm(4,cr),vm(5,_u),vm(6,yt),vm(7,B_),vm(8,ci)],Sc);function Tkt(i,e){const t=Vn("result",[]),n=[];return e.add(yn(r=>{const o=i.read(r);Pi(s=>{if(o.length!==n.length){n.length=o.length;for(let a=0;aa.set(o[l],s))})})),t}class eB extends pt{constructor(){super({id:eB.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const r=Sc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.next()}}eB.ID=pEe;class tB extends pt{constructor(){super({id:tB.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const r=Sc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.previous()}}tB.ID=gEe;class Nkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:K.writable})}async run(e,t){const n=Sc.get(t);await l1t(async r=>{var o;await((o=n==null?void 0:n.model.get())===null||o===void 0?void 0:o.triggerExplicitly(r)),n==null||n.playAccessibilitySignal(r)})}}class Rkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:w("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Re.and(K.writable,Ho.inlineSuggestionVisible)},menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const r=Sc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextWord(r.editor))}}class Mkt extends pt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:w("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Re.and(K.writable,Ho.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const r=Sc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextLine(r.editor))}}class Pkt extends pt{constructor(){super({id:fEe,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Ho.inlineSuggestionVisible,menuOpts:[{menuId:H.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Re.and(Ho.inlineSuggestionVisible,K.tabMovesFocus.toNegated(),Ho.inlineSuggestionHasIndentationLessThanTabSize,un.Visible.toNegated(),K.hoverFocused.toNegated())}})}async run(e,t){var n;const r=Sc.get(t);r&&((n=r.model.get())===null||n===void 0||n.accept(r.editor),r.editor.focus())}}class nB extends pt{constructor(){super({id:nB.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Ho.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const n=Sc.get(t);Pi(r=>{var o;(o=n==null?void 0:n.model.get())===null||o===void 0||o.stop(r)})}}nB.ID="editor.action.inlineSuggest.hide";class iB extends dl{constructor(){super({id:iB.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:H.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Re.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const n=e.get(mn),o=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",o)}}iB.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Akt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Okt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let TK=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Sc.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new Cb(1e3,this,W.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new Cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new Cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const n=Sc.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Okt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Fe,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,n);const o=r.controller.model.get(),s=this._instantiationService.createInstance(m_,this._editor,!1,fp(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const r=Xe,o=r("div.hover-row.markdown-hover"),s=Oe(o,r("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new qf({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=w("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new Ns().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(yn(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.primaryGhostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else ms(s)})),e.fragment.appendChild(o)}};TK=Akt([EL(1,qi),EL(2,hl),EL(3,pd),EL(4,Wt),EL(5,ia)],TK);Kn(Sc.ID,Sc,3);Ke(Nkt);Ke(eB);Ke(tB);Ke(Rkt);Ke(Mkt);Ke(Pkt);Ke(nB);ki(iB);$_.register(TK);function yl(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function XEe(i,e,t,n,r){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,i.getLineCount());t<=n&&o.unIndentedLinePattern;){const m=i.getLineContent(t);if(!o.unIndentedLinePattern.test(m))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(m,v)=>(v=v||1,qc.shiftIndent(m,m.length+v,s,a,l)),u=(m,v)=>(v=v||1,qc.unshiftIndent(m,m.length+v,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(r!=null){h=r;const m=yi(f);g=h+f.substring(m.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(m.length)),f!==g&&d.push(Ji.replaceMove(new Et(t,1,t,m.length+1),rO(h,a,l)))}else h=yi(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let m=t;m<=n;m++){const v=i.getLineContent(m),_=yi(v),y=p+v.substring(_.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(p=u(p),h=u(h)),_!==p&&d.push(Ji.replaceMove(new Et(m,1,m,_.length+1),rO(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?p=c(p):p=h)}return d}class rB extends pt{constructor(){super({id:rB.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:K.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new Vkt(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}rB.ID="editor.action.indentationToSpaces";class oB extends pt{constructor(){super({id:oB.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:K.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new zkt(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}oB.ID="editor.action.indentationToTabs";class nJ extends pt{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(Ph),r=e.get(or),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?w("configuredTabSize","Configured Tab Size"):u===s.tabSize?w("defaultTabSize","Default Tab Size"):u===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class sB extends nJ{constructor(){super(!1,!1,{id:sB.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}sB.ID="editor.action.indentUsingTabs";class aB extends nJ{constructor(){super(!0,!1,{id:aB.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}aB.ID="editor.action.indentUsingSpaces";class lB extends nJ{constructor(){super(!0,!0,{id:lB.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}lB.ID="editor.action.changeTabDisplaySize";class cB extends pt{constructor(){super({id:cB.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(or),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}cB.ID="editor.action.detectIndentation";class Wkt extends pt{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:K.writable})}run(e,t){const n=e.get(Ti),r=t.getModel();if(!r)return;const o=XEe(r,n,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class $kt extends pt{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:K.writable})}run(e,t){const n=e.get(Ti),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=XEe(r,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Hkt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(W.lift(r.range),r.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let Sk=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Fe,this.callOnModel=new Fe,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 n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>qc.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>qc.unshiftIndent(f,f.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=HE(r,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=yi(d),p=yl(f,o),m=yl(g,o);if(p!==m){const v=uD(p,o,a);l.push({range:new W(u,1,u,g.length+1),text:v}),d=v+d.substr(g.length)}else{const v=twe(n,u,this._languageConfigurationService);if(v===0||v===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,m)=>n.getLanguageIdAtPosition(p,m)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=yl(g,o),m=yl(yi(n.getLineContent(u+1)),o);if(p!==m){const v=p-m;for(let _=u+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),S=yi(y),E=yl(S,o)+v,D=uD(E,o,a);D!==S&&l.push({range:new W(_,1,_,S.length+1),text:D})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Hkt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(n);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};Sk.ID="editor.contrib.autoIndentOnPaste";Sk=Fkt([Bkt(1,Ti)],Sk);function YEe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let r="";for(let s=0;sthis._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){var t,n,r;try{const o=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this.hint.textEdits=(r=o==null?void 0:o.textEdits)!==null&&r!==void 0?r:this.hint.textEdits,this._isResolved=!0}catch(o){eo(o),this._isResolved=!1}}}class Sb{static async create(e,t,n,r){const o=[],s=e.ordered(t).reverse().map(a=>n.map(async l=>{try{const c=await a.provideInlayHints(t,l,r);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??Sb._emptyInlayHintList,a])}catch(c){eo(c)}}));if(await Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new T_;return new Sb(n,o,t)}constructor(e,t,n){this._disposables=new Fe,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=n.validatePosition(a.position);let c="before";const u=Sb._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=W.fromPositions(u.getStartPosition(),l),c="after"):(d=W.fromPositions(l,u.getEndPosition()),c="before"),r.push(new iJ(a,new ZEe(d,c),s))}}this.items=r.sort((o,s)=>le.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new W(n,r.startColumn,n,r.endColumn);e.tokenization.tokenizeIfCheap(n);const o=e.tokenization.getLineTokens(n),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&ahy(g)?g.command.id:T5()));for(const g of Ys.all())h.has(g.desc.id)&&d.push(new Il(g.desc.id,bc.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await o.createModelReference(u.uri);try{const m=new CS(p.object.textEditorModel,W.getStartPosition(u.range)),v=n.item.anchor.range;await l.invokeFunction(g.runEditorCommand.bind(g),e,m,v)}finally{p.dispose()}}));if(n.part.command){const{command:g}=n.part;d.push(new ho),d.push(new Il(g.id,g.title,void 0,!0,async()=>{var p;try{await a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(m){c.notify({severity:U3.Error,source:n.item.provider.displayName,message:m})}}))}const f=e.getOption(127);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=Hr(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function QEe(i,e,t,n){const o=await i.get(ul).createModelReference(n.uri);await t.invokeWithinContext(async s=>{const a=e.hasSideBySideModifier,l=s.get(Gt),c=al.inPeekEditor.getValue(l),u=!a&&t.getOption(88)&&!c;return new YT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new CS(o.object.textEditorModel,W.getStartPosition(n.range)),W.lift(n.range))}),o.dispose()}var Kkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},j1;class xF{constructor(){this._entries=new R_(50)}get(e){const t=xF._key(e);return this._entries.get(t)}set(e,t){const n=xF._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const JEe=Sn("IInlayHintsCache");Tn(JEe,xF,1);class NK{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 Gkt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let b_=j1=class{static get(e){var t;return(t=e.getContribution(j1.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new Fe,this._sessionDisposables=new Fe,this._decorationsMetadata=new Map,this._ruleFactory=new yT(this._editor),this._activeRenderMode=0,this._debounceInfo=n.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(140)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(140);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(tp.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(Ot(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new mi(async()=>{const a=Date.now();r==null||r.dispose(!0),r=new xr;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=await Sb.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){nn(c)}finally{r.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(s),this._sessionDisposables.add(Ot(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{r==null||r.cancel();const l=Math.max(s.delay,1250);s.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Fe,t=e.add(new M5(this._editor)),n=new Fe;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new xr;n.add(Ot(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Gkt(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new W(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(Ot(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(async r=>{const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(QEe,r,this._editor,s.location):aV.is(s.command)&&await this._invokeCommand(s.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(n&&(t.event.preventDefault(),await n.item.resolve(wn.None),Ms(n.item.hint.textEdits))){const r=n.item.hint.textEdits.map(o=>Ji.replace(W.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(jkt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof s_&&(n==null?void 0:n.attachedData)instanceof NK)return n.attachedData}async _invokeCommand(e,t){var n;try{await this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(r){this._notificationService.notify({severity:U3.Error,source:t.provider.displayName,message:r})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(n);if(o){const s=new ZEe(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of n.sort(W.compareRangesUsingStarts)){const s=t.validateRange(new W(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!W.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=W.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var n,r;const o=[],s=(m,v,_,y,S)=>{const L={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:y,attachedData:S};o.push({item:m,classNameRef:v,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?L:void 0}}})},a=(m,v)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,_," ",v?qu.Right:qu.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);let f={line:0,totalLen:0};for(const m of t){if(f.line!==m.anchor.range.startLineNumber&&(f={line:m.anchor.range.startLineNumber,totalLen:0}),f.totalLen>j1._MAX_LABEL_LEN)continue;m.hint.paddingLeft&&a(m,!1);const v=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let _=0;_0&&(D=D.slice(0,-T)+"…",k=!0),s(m,this._ruleFactory.createClassNameRef(E),qkt(D),L&&!m.hint.paddingRight?qu.Right:qu.None,new NK(m,_)),k)break}if(m.hint.paddingRight&&a(m,!0),o.length>j1._MAX_DECORATORS)break}const g=[];for(const[m,v]of this._decorationsMetadata){const _=(r=this._editor.getModel())===null||r===void 0?void 0:r.getDecorationRange(m);_&&e.some(y=>y.containsRange(_))&&(g.push(m),v.classNameRef.dispose(),this._decorationsMetadata.delete(m))}const p=wh.capture(this._editor);this._editor.changeDecorations(m=>{const v=m.deltaDecorations(g,o.map(_=>_.decoration));for(let _=0;_n)&&(o=n);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};b_.ID="editor.contrib.InlayHints";b_._MAX_DECORATORS=1500;b_._MAX_LABEL_LEN=43;b_=j1=Kkt([k1(1,yt),k1(2,_u),k1(3,JEe),k1(4,cr),k1(5,zr),k1(6,Wt)],b_);function qkt(i){const e=" ";return i.replace(/[ \t]/g,e)}kn.registerCommand("_executeInlayHintProvider",async(i,...e)=>{const[t,n]=e;Yn(Ft.isUri(t)),Yn(W.isIRange(n));const{inlayHintsProvider:r}=i.get(yt),o=await i.get(ul).createModelReference(t);try{const s=await Sb.create(r,o.object.textEditorModel,[W.lift(n)],wn.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}});var Xkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Che extends Cb{constructor(e,t,n,r){super(10,t,e.item.anchor.range,n,r,!0),this.part=e}}let RK=class extends gF{constructor(e,t,n,r,o,s){super(e,t,n,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!b_.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof s_&&r.attachedData instanceof NK?new Che(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof Che?new Xr(async r=>{const{part:o}=e;if(await o.item.resolve(n),n.isCancellationRequested)return;let s;typeof o.item.hint.tooltip=="string"?s=new Ns().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(s=o.item.hint.tooltip),s&&r.emitOne(new qd(this,e.range,[s],!1,0)),Ms(o.item.hint.textEdits)&&r.emitOne(new qd(this,e.range,[new Ns().appendText(w("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Ns().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&r.emitOne(new qd(this,e.range,[a],!1,1)),o.part.location||o.part.command){let c;const d=this._editor.getOption(78)==="altKey"?Dn?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Dn?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");o.part.location&&o.part.command?c=new Ns().appendText(w("hint.defAndCommand","Go to Definition ({0}), right click for more",d)):o.part.location?c=new Ns().appendText(w("hint.def","Go to Definition ({0})",d)):o.part.command&&(c=new Ns(`[${w("hint.cmd","Execute Command")}](${Ukt(o.part.command)} "${o.part.command.title}") (${d})`,{isTrusted:!0})),c&&r.emitOne(new qd(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(o,n);for await(const c of l)r.emitOne(c)}):Xr.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Xr.EMPTY;const{uri:n,range:r}=e.part.location,o=await this._resolverService.createModelReference(n);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?BQ(this._languageFeaturesService.hoverProvider,s,new le(r.startLineNumber,r.startColumn),t).filter(a=>!aS(a.hover.contents)).map(a=>new qd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Xr.EMPTY}finally{o.dispose()}}};RK=Xkt([DL(1,qi),DL(2,hl),DL(3,mn),DL(4,ul),DL(5,yt)],RK);Kn(b_.ID,b_,1);$_.register(RK);class Ykt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Et(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new Et(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var Zkt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qkt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gP;let C_=gP=class{static get(e){return e.getContribution(gP.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new Lxe(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=No(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=W.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new Et(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new Ykt(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:gP.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=Zv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(nn)}).catch(nn)):Promise.resolve(void 0)}};C_.ID="editor.contrib.inPlaceReplaceController";C_.DECORATION=an.register({description:"in-place-replace",className:"valueSetReplacement"});C_=gP=Zkt([Qkt(1,vd)],C_);class Jkt extends pt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=C_.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class eTt extends pt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=C_.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}Kn(C_.ID,C_,4);Ke(Jkt);Ke(eTt);class tTt extends pt{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:K.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(n.source,3,qo.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(n.source,!0)}}Ke(tTt);class nTt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=iTt(e,this._cursors);for(let r=0,o=n.length;rs.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,r=0;const o=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oTt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let MK=class{constructor(e,t,n,r){this._languageConfigurationService=r,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumbere.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const u=r.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new W(1,1,1,1),null):(t.addEditOperation(new W(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new W(d,1,d,e.getLineMaxColumn(d)),null)),r=new Et(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=r.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new W(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,l,o,u,r.startLineNumber-1);if(f!==null){const p=yi(e.getLineContent(u)),m=f+yl(p,o);h=uD(m,o,a)+this.trimStart(d)}else{c.getLineContent=m=>m===r.startLineNumber?e.getLineContent(u):e.getLineContent(m);const p=HE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber,l,this._languageConfigurationService);if(p!==null){const m=yi(e.getLineContent(u)),v=yl(p,o),_=yl(m,o);v!==_&&(h=uD(v,o,a)+this.trimStart(d))}}t.addEditOperation(new W(r.startLineNumber,1,r.startLineNumber,1),h+` `);const g=this.matchEnterRuleMovingDown(e,l,o,r.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,g);else{c.getLineContent=m=>m===r.startLineNumber?h:m>=r.startLineNumber+1&&m<=r.endLineNumber+1?e.getLineContent(m-1):e.getLineContent(m);const p=HE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const m=yi(e.getLineContent(r.startLineNumber)),v=yl(p,o),_=yl(m,o);if(v!==_){const y=v-_;this.getIndentEditsOfMovingBlock(e,t,r,o,a,y)}}}}else t.addEditOperation(new W(r.startLineNumber,1,r.startLineNumber,1),h+` `)}else if(u=r.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new W(u,1,u+1,1),null),t.addEditOperation(new W(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` -`+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const f=HE(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=yi(e.getLineContent(r.startLineNumber)),p=yl(f,o),m=yl(g,o);if(p!==m){const v=p-m;this.getIndentEditsOfMovingBlock(e,t,r,o,a,v)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,n){return{shiftIndent:r=>qc.shiftIndent(r,r.length+1,e,t,n),unshiftIndent:r=>qc.unshiftIndent(r,r.length+1,e,t,n)}}parseEnterResult(e,t,n,r,o){if(o){let s=o.indentation;o.indentAction===Zr.None||o.indentAction===Zr.Indent?s=o.indentation+o.appendText:o.indentAction===Zr.IndentOutdent?s=o.indentation:o.indentAction===Zr.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=yi(e.getLineContent(r));let c=yi(s);const u=twe(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=yl(c,n),h=yl(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,r,o,s){if(rh(s)>=0){const a=e.getLineMaxColumn(o),l=rw(this._autoIndent,e,new W(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(rh(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=rw(this._autoIndent,e,new W(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}}matchEnterRule(e,t,n,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),rh(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=rw(this._autoIndent,e,new W(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==r||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,r,o,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=yi(l),d=yl(c,r)+s,h=uD(d,r,o);h!==c&&(t.addEditOperation(new W(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=r)return null;const o=[];for(let a=n;a<=r;a++)o.push(i.getLineContent(a));let s=o.slice(0);return s.sort(Wv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:r,before:o,after:s}}function sTt(i,e,t){const n=tDe(i,e,t);return n?Qi.replace(new W(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` -`)):null}class nDe extends pt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>W.compareRangesUsingStarts(s.selection,a.selection));let r=n[0];for(let s=1;snew le(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new nTt(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}uB.ID="editor.action.trimTrailingWhitespace";class pTt extends pt{constructor(){super({id:"editor.action.deleteLines",label:w("lines.delete","Delete Line"),alias:"Delete Line",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Qi.replace(new Et(d,f,h,g),"")),a.push(new Et(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumbero.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const n=[];let r=t[0];for(let o=1;o=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(n.push(r),r=t[o]);return n.push(r),n}}class mTt extends pt{constructor(){super({id:"editor.action.indentLines",label:w("lines.indent","Indent Line"),alias:"Indent Line",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,sr.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class vTt extends pt{constructor(){super({id:"editor.action.outdentLines",label:w("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2140,weight:100}})}run(e,t){ow.Outdent.runEditorCommand(e,t,null)}}class _Tt extends pt{constructor(){super({id:"editor.action.insertLineBefore",label:w("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,sr.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class bTt extends pt{constructor(){super({id:"editor.action.insertLineAfter",label:w("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,sr.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class oDe extends pt{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;lQi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class CTt extends oDe{constructor(){super({id:"deleteAllLeft",label:w("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new Et(l,s.startColumn,l,s.startColumn)}else a=new Et(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:r.push(a)}),n&&r.unshift(n),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const r=e.getModel();return r===null?[]:(n.sort(W.compareRangesUsingStarts),n=n.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new W(s,a,o.startLineNumber,1)}else return new W(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new W(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),n)}}class yTt extends oDe{constructor(){super({id:"deleteAllRight",label:w("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];for(let o=0,s=t.length,a=0;o{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new W(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new W(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(W.compareRangesUsingStarts),r}}class wTt extends pt{constructor(){super({id:"editor.action.joinLines",label:w("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let r=t.getSelection();if(r===null)return;n.sort(W.compareRangesUsingStarts);const o=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new Et(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new Et(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h=1){let M=!0;L===""&&(M=!1),M&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(M=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const P=k.substr(T-1);L+=(M?" ":"")+P,M?v=P.length+1:v=P.length}else v=0}const E=new W(p,m,_,y);if(!E.isEmpty()){let D;g.isEmpty()?(l.push(Qi.replace(E,L)),D=new Et(E.startLineNumber-d,L.length-v+1,p-d,L.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(Qi.replace(E,L)),D=new Et(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Qi.replace(E,L)),D=new Et(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-S)),W.intersectRanges(E,r)!==null?u=D:c.push(D)}d+=E.endLineNumber-E.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class STt extends pt{constructor(){super({id:"editor.action.transpose",label:w("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:K.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===r.getLineCount())continue;const d=new W(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new ls(new Et(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new W(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new JY(d,h,new Et(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class cx extends pt{run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(130),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new W(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Qi.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Qi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class xTt extends cx{constructor(){super({id:"editor.action.transformToUppercase",label:w("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:K.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class LTt extends cx{constructor(){super({id:"editor.action.transformToLowercase",label:w("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:K.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class MC{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class xk extends cx{constructor(){super({id:"editor.action.transformToTitlecase",label:w("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:K.writable})}_modifyText(e,t){const n=xk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,r=>r.toLocaleUpperCase()):e}}xk.titleBoundary=new MC("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class $v extends cx{constructor(){super({id:"editor.action.transformToSnakecase",label:w("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:K.writable})}_modifyText(e,t){const n=$v.caseBoundary.get(),r=$v.singleLetters.get();return!n||!r?e:e.replace(n,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}$v.caseBoundary=new MC("(\\p{Ll})(\\p{Lu})","gmu");$v.singleLetters=new MC("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Lk extends cx{constructor(){super({id:"editor.action.transformToCamelcase",label:w("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:K.writable})}_modifyText(e,t){const n=Lk.wordBoundary.get();if(!n)return e;const r=e.split(n);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Lk.wordBoundary=new MC("[_\\s-]","gm");class xp extends cx{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:w("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:K.writable})}_modifyText(e,t){const n=xp.caseBoundary.get(),r=xp.singleLetters.get(),o=xp.underscoreBoundary.get();return!n||!r||!o?e:e.replace(o,"$1-$3").replace(n,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}xp.caseBoundary=new MC("(\\p{Ll})(\\p{Lu})","gmu");xp.singleLetters=new MC("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");xp.underscoreBoundary=new MC("(\\S)(_)(\\S)","gm");Ke(aTt);Ke(lTt);Ke(cTt);Ke(uTt);Ke(dTt);Ke(hTt);Ke(fTt);Ke(gTt);Ke(uB);Ke(pTt);Ke(mTt);Ke(vTt);Ke(_Tt);Ke(bTt);Ke(CTt);Ke(yTt);Ke(wTt);Ke(STt);Ke(xTt);Ke(LTt);$v.caseBoundary.isSupported()&&$v.singleLetters.isSupported()&&Ke($v);Lk.wordBoundary.isSupported()&&Ke(Lk);xk.titleBoundary.isSupported()&&Ke(xk);xp.isSupported()&&Ke(xp);var ETt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pP;const sDe=new ct("LinkedEditingInputVisible",!1),DTt="linked-editing-decoration";let C_=pP=class extends me{static get(e){return e.getContribution(pP.ID)}constructor(e,t,n,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new Fe),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=sDe.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Fe),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(s=>{(s.hasChanged(70)||s.hasChanged(93))&&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(),n=t!==null&&(this._editor.getOption(70)||this._editor.getOption(93))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(ot.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new ad(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new ad(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const r=t.getValueInRange(n);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),r=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=this._currentRequestCts=new xr;try{const s=new Fs(!1),a=await aDe(this._providers,n,t,o.token);if(this._debounceInformation.update(n,s.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,r!==n.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,h=l.length;d({range:d,options:pP.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(s){Th(s)||nn(s),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}};C_.ID="editor.contrib.linkedEditing";C_.DECORATION=an.register({description:"linked-editing",stickiness:0,className:DTt});C_=pP=ETt([J2(1,Gt),J2(2,yt),J2(3,Ti),J2(4,_u)],C_);class ITt extends pt{constructor(){super({id:"editor.action.linkedEditing",label:w("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Re.and(K.writable,K.hasRenameProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(jn),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Ft.isUri(r)&&le.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},nn):super.runCommand(e,t)}run(e,t){const n=C_.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const kTt=zo.bindToContribution(C_.get);st(new kTt({id:"cancelLinkedEditingInput",precondition:sDe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:K.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function aDe(i,e,t,n){const r=i.ordered(e);return mY(r.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,n)}catch(s){eo(s);return}}),o=>!!o&&Ms(o==null?void 0:o.ranges))}X("editor.linkedEditingBackground",{dark:Ce.fromHex("#f00").transparent(.3),light:Ce.fromHex("#f00").transparent(.3),hcDark:Ce.fromHex("#f00").transparent(.3),hcLight:Ce.white},w("editorLinkedEditingBackground","Background color when the editor auto renames on type."));rg("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(yt);return aDe(n,e,t,wn.None)});Kn(C_.ID,C_,1);Ke(ITt);let TTt=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 LF{constructor(e){this._disposables=new Fe;let t=[];for(const[n,r]of e){const o=n.links.map(s=>new TTt(s,r));t=LF._union(t,o),tY(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;rPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,o])},eo));return Promise.all(r).then(()=>{const o=new LF(hh(n));return t.isCancellationRequested?(o.dispose(),new LF([])):o})}kn.registerCommand("_executeLinkProvider",async(i,...e)=>{let[t,n]=e;Yn(t instanceof Ft),typeof n!="number"&&(n=0);const{linkProvider:r}=i.get(yt),o=i.get(rr).getModel(t);if(!o)return[];const s=await lDe(r,o,wn.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PK;let LS=PK=class extends me{static get(e){return e.getContribution(PK.ID)}constructor(e,t,n,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new mi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new M5(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(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=No(t=>lDe(this.providers,e,t));try{const t=new Fs(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){nn(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",n=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];n.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(bw.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{r.activate(o,n),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(n=>{t.deactivate(n,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(wn.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===cn.file&&o.startsWith(`${cn.file}:`)){const a=Ft.parse(o);if(a.scheme===cn.file){const l=Yh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=Gft(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(w("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(w("missing.url","Failed to open this link because its target is missing.")):nn(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const n of t){const r=this.currentOccurrences[n.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};LS.ID="editor.linkDetector";LS=PK=NTt([eM(1,hl),eM(2,zr),eM(3,yt),eM(4,_u)],LS);const yhe={general:an.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:an.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class bw{static decoration(e,t){return{range:e.range,options:bw._getOptions(e,t,!1)}}static _getOptions(e,t,n){const r={...n?yhe.active:yhe.general};return r.hoverMessage=RTt(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,bw._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,bw._getOptions(this.link,t,!1))}}function RTt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?w("links.navigate.executeCmd","Execute command"):w("links.navigate.follow","Follow link"),r=e?Dn?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Dn?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");if(i.url){let o="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=w("tooltip.explanation","Execute command {0}",l)}}return new Ns("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,o).appendMarkdown(` (${r})`)}else return new Ns().appendText(`${n} (${r})`)}class MTt extends pt{constructor(){super({id:"editor.action.openLink",label:w("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=LS.get(t);if(!n||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=n.getLinkOccurrence(o.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}Kn(LS.ID,LS,1);Ke(MTt);class AK extends me{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(117);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}AK.ID="editor.contrib.longLinesHelper";Kn(AK.ID,AK,2);const tM=X("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},w("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);X("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},w("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);X("editor.wordHighlightTextBackground",{light:tM,dark:tM,hcDark:tM,hcLight:tM},w("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 nM=X("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));X("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));X("editor.wordHighlightTextBorder",{light:nM,dark:nM,hcDark:nM,hcLight:nM},w("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const PTt=X("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ATt=X("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},w("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),OTt=X("editorOverviewRuler.wordHighlightTextForeground",{dark:ZL,light:ZL,hcDark:ZL,hcLight:ZL},w("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),FTt=an.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:pr(ATt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),BTt=an.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:pr(OTt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),WTt=an.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:pr(ZL),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),$Tt=an.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),HTt=an.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:pr(PTt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}});function VTt(i){return i===oI.Write?FTt:i===oI.Text?BTt:HTt}function zTt(i){return i?$Tt:WTt}vu((i,e)=>{const t=i.getColor(jY);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var UTt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jTt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},OK;function $_(i,e){const t=e.filter(n=>!i.find(r=>r.equals(n)));if(t.length>=1){const n=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?w("cursorAdded","Cursor added: {0}",n):w("cursorsAdded","Cursors added: {0}",n);jf(r)}}class KTt extends pt{constructor(){super({id:"editor.action.insertCursorAbove",label:w("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,qo.addCursorUp(o,s,r)),o.revealTopMostCursor(n.source),$_(s,o.getCursorStates())}}class GTt extends pt{constructor(){super({id:"editor.action.insertCursorBelow",label:w("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,qo.addCursorDown(o,s,r)),o.revealBottomMostCursor(n.source),$_(s,o.getCursorStates())}}class qTt extends pt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:w("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let r=e.startLineNumber;r1&&n.push(new Et(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),$_(s,o.getCursorStates())}}class XTt extends pt{constructor(){super({id:"editor.action.addCursorsToBottom",label:w("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=n[0].startLineNumber;l<=r;l++)o.push(new Et(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),$_(a,s.getCursorStates())}}class YTt extends pt{constructor(){super({id:"editor.action.addCursorsToTop",label:w("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=[];for(let a=n[0].startLineNumber;a>=1;a--)r.push(new Et(a,n[0].startColumn,a,n[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),$_(s,o.getCursorStates())}}class iM{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Ek{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Ek(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=n.wholeWord,s=n.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 Et(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new Ek(e,t,r,c,o,s,u)}constructor(e,t,n,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new iM(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 iM(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],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new Et(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new iM(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 iM(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],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new Et(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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(130):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824)}}class sC extends me{static get(e){return e.getContribution(sC.ID)}constructor(e){super(),this._sessionDispose=this._register(new Fe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Ek.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new Et(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const r=e.getState().matchCase;if(!cDe(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const r=this._editor.getModel();n.searchScope?t=r.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824):t=r.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;onew Et(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}sC.ID="editor.contrib.multiCursorController";class ux extends pt{run(e,t){const n=sC.get(t);if(!n)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=Na.get(t);if(s)this._run(n,s);else{const a=e.get(Wt).createInstance(Na,t);this._run(n,a),a.dispose()}$_(o,r.getCursorStates())}}}class ZTt extends ux{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:w("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2082,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class QTt extends ux{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:w("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class JTt extends ux{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:w("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:fo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class eNt extends ux{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:w("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 tNt extends ux{constructor(){super({id:"editor.action.selectHighlights",label:w("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:3114,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class nNt extends ux{constructor(){super({id:"editor.action.changeAll",label:w("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Re.and(K.writable,K.editorTextFocus),kbOpts:{kbExpr:K.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class iNt{constructor(e,t,n,r,o){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(W.compareRangesUsingStarts)),this._cachedFindMatches}}let Dk=OK=class extends me{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(108),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new mi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(108)})),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 n=Na.get(e);n&&this._register(n.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(OK._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const r=n.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=sC.get(n);if(!o)return null;const s=Na.get(n);if(!s)return null;let a=o.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!cDe(n.getModel(),u,h))return null}a=Ek.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new iNt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(130):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 n=this.state.findMatches(),r=this.editor.getSelections();r.sort(W.compareRangesUsingStarts);const o=[];for(let c=0,u=0,d=n.length,h=r.length;c=h)o.push(f),c++;else{const g=W.compareRangesUsingStarts(f,r[u]);g<0?((r[u].isEmpty()||!W.areIntersecting(f,r[u]))&&o.push(f),c++):(g>0||c++,u++)}}const s=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,l=o.map(c=>({range:c,options:zTt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};Dk.ID="editor.contrib.selectionHighlighter";Dk=OK=UTt([jTt(1,yt)],Dk);function cDe(i,e,t){const n=whe(i,e[0],!t);for(let r=1,o=e.length;r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dNt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const rW="inline-edit";let FK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Vn(this,!1),this.currentTextModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=en(this,r=>{var o;if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const a=this.model.ghostText.read(r);if(!a)return;let l=(o=this.model.range)===null||o===void 0?void 0:o.read(r);l&&l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn&&(l=void 0);const c=(l?l.startLineNumber===l.endLineNumber:!0)&&a.parts.length===1&&a.parts[0].lines.length===1,u=a.parts.length===1&&a.parts[0].lines.every(y=>y.length===0),d=[],h=[];function f(y,S){if(h.length>0){const L=h[h.length-1];S&&L.decorations.push(new wa(L.content.length+1,L.content.length+1+y[0].length,S,0)),L.content+=y[0],y=y.slice(1)}for(const L of y)h.push({content:L,decorations:S?[new wa(1,L.length+1,S,0)]:[]})}const g=s.getLineContent(a.lineNumber);let p,m=0;if(!u){for(const y of a.parts){let S=y.lines;l&&!c&&(f(S,rW),S=[]),p===void 0?(d.push({column:y.column,text:S[0],preview:y.preview}),S=S.slice(1)):f([g.substring(m,y.column-1)],void 0),S.length>0&&(f(S,rW),p===void 0&&y.column<=g.length&&(p=y.column)),m=y.column-1}p!==void 0&&f([g.substring(m)],void 0)}const v=p!==void 0?new VEe(p,g.length+1):void 0,_=c||!l?a.lineNumber:l.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:_,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s,range:l,isSingleLine:c,isPureRemove:u,backgroundColoring:this.model.backgroundColoring.read(r)}}),this.decorations=en(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];if(o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const c=o.range.endLineNumber-o.range.startLineNumber;for(let u=0;u{const o=this.uiState.read(r);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ot(()=>{this.isDisposed.set(!0,void 0)})),this._register(zEe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};FK=uNt([dNt(2,qi)],FK);var rJ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mP;let BK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=en(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.widget.model.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new le(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ah((r,o)=>{if(!this.model.read(r)||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(ES,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ot(()=>e.removeContentWidget(a)))}))}};BK=rJ([qg(2,Wt)],BK);let ES=mP=class extends me{constructor(e,t,n,r,o,s){super(),this.editor=e,this.withBorder=t,this._position=n,this._contextKeyService=o,this._menuService=s,this.id=`InlineEditHintsContentWidget${mP.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=pi("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[pi("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(H.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(r.createInstance(WK,this.nodes.toolBar,this.editor,H.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof bc)return r.createInstance(hNt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{mP._dropDownVisible=a})),this._register(yn(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(yn(a=>{const l=[];for(const[c,u]of this.inlineCompletionsActionsMenus.getActions())for(const d of u)d instanceof bc&&l.push(d);l.length>0&&l.unshift(new ho),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};ES._dropDownVisible=!1;ES.id=0;ES=mP=rJ([qg(3,Wt),qg(4,Gt),qg(5,mu)],ES);class hNt extends s_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=pi("div.keybinding").root;new ex(t,Ll,{disableTitle:!0,...GSe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let WK=class extends sk{constructor(e,t,n,r,o,s,a,l,c){super(e,{resetMenu:n,...r},o,s,a,l,c),this.editor=t,this.menuId=n,this.options2=r,this.menuService=o,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._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];n5(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setAdditionalSecondaryActions(e){lr(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};WK=rJ([qg(4,mu),qg(5,Gt),qg(6,$l),qg(7,ci),qg(8,ia)],WK);var fNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},IL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nb;class gNt{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}let Co=nb=class extends me{static get(e){return e.getContribution(nb.ID)}constructor(e,t,n,r,o,s){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.languageFeaturesService=r,this._commandService=o,this._configurationService=s,this._isVisibleContext=nb.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=nb.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(nk(this,void 0)),this._isAccepting=!1,this._enabled=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily),this._backgroundColoring=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).backgroundColoring);const a=_a("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(yn(h=>{this._enabled.read(h)&&(a.read(h),this.getInlineEdit(e,!0))}));const l=ji(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(yn(h=>{if(!this._enabled.read(h))return;const f=l.read(h);f&&this.checkCursorPosition(f)})),this._register(yn(h=>{const f=this._currentEdit.read(h);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const g=e.getPosition();g&&this.checkCursorPosition(g)}));const c=_a("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(yn(h=>{var f;this._enabled.read(h)&&(c.read(h),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((f=this._currentRequestCts)===null||f===void 0||f.dispose(),this._currentRequestCts=void 0,this.clear(!1)))}));const u=_a("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(yn(h=>{this._enabled.read(h)&&(u.read(h),this.getInlineEdit(e,!0))}));const d=this._register(M1e());this._register(yn(h=>{const f=this._fontFamily.read(h);d.setStyle(f===""||f==="default"?"":` +`+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const f=HE(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=yi(e.getLineContent(r.startLineNumber)),p=yl(f,o),m=yl(g,o);if(p!==m){const v=p-m;this.getIndentEditsOfMovingBlock(e,t,r,o,a,v)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,n){return{shiftIndent:r=>qc.shiftIndent(r,r.length+1,e,t,n),unshiftIndent:r=>qc.unshiftIndent(r,r.length+1,e,t,n)}}parseEnterResult(e,t,n,r,o){if(o){let s=o.indentation;o.indentAction===Zr.None||o.indentAction===Zr.Indent?s=o.indentation+o.appendText:o.indentAction===Zr.IndentOutdent?s=o.indentation:o.indentAction===Zr.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=yi(e.getLineContent(r));let c=yi(s);const u=twe(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=yl(c,n),h=yl(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,r,o,s){if(rh(s)>=0){const a=e.getLineMaxColumn(o),l=rw(this._autoIndent,e,new W(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(rh(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=rw(this._autoIndent,e,new W(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}}matchEnterRule(e,t,n,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),rh(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=rw(this._autoIndent,e,new W(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==r||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,r,o,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=yi(l),d=yl(c,r)+s,h=uD(d,r,o);h!==c&&(t.addEditOperation(new W(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=r)return null;const o=[];for(let a=n;a<=r;a++)o.push(i.getLineContent(a));let s=o.slice(0);return s.sort(Wv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:r,before:o,after:s}}function sTt(i,e,t){const n=tDe(i,e,t);return n?Ji.replace(new W(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` +`)):null}class nDe extends pt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>W.compareRangesUsingStarts(s.selection,a.selection));let r=n[0];for(let s=1;snew le(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new nTt(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}uB.ID="editor.action.trimTrailingWhitespace";class pTt extends pt{constructor(){super({id:"editor.action.deleteLines",label:w("lines.delete","Delete Line"),alias:"Delete Line",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Ji.replace(new Et(d,f,h,g),"")),a.push(new Et(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumbero.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const n=[];let r=t[0];for(let o=1;o=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(n.push(r),r=t[o]);return n.push(r),n}}class mTt extends pt{constructor(){super({id:"editor.action.indentLines",label:w("lines.indent","Indent Line"),alias:"Indent Line",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,ar.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class vTt extends pt{constructor(){super({id:"editor.action.outdentLines",label:w("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2140,weight:100}})}run(e,t){ow.Outdent.runEditorCommand(e,t,null)}}class _Tt extends pt{constructor(){super({id:"editor.action.insertLineBefore",label:w("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,ar.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class bTt extends pt{constructor(){super({id:"editor.action.insertLineAfter",label:w("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,ar.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class oDe extends pt{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;lJi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class CTt extends oDe{constructor(){super({id:"deleteAllLeft",label:w("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new Et(l,s.startColumn,l,s.startColumn)}else a=new Et(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:r.push(a)}),n&&r.unshift(n),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const r=e.getModel();return r===null?[]:(n.sort(W.compareRangesUsingStarts),n=n.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new W(s,a,o.startLineNumber,1)}else return new W(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new W(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),n)}}class yTt extends oDe{constructor(){super({id:"deleteAllRight",label:w("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];for(let o=0,s=t.length,a=0;o{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new W(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new W(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(W.compareRangesUsingStarts),r}}class wTt extends pt{constructor(){super({id:"editor.action.joinLines",label:w("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:K.writable,kbOpts:{kbExpr:K.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let r=t.getSelection();if(r===null)return;n.sort(W.compareRangesUsingStarts);const o=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new Et(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new Et(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h=1){let M=!0;L===""&&(M=!1),M&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(M=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const P=k.substr(T-1);L+=(M?" ":"")+P,M?v=P.length+1:v=P.length}else v=0}const E=new W(p,m,_,y);if(!E.isEmpty()){let D;g.isEmpty()?(l.push(Ji.replace(E,L)),D=new Et(E.startLineNumber-d,L.length-v+1,p-d,L.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(Ji.replace(E,L)),D=new Et(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Ji.replace(E,L)),D=new Et(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-S)),W.intersectRanges(E,r)!==null?u=D:c.push(D)}d+=E.endLineNumber-E.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class STt extends pt{constructor(){super({id:"editor.action.transpose",label:w("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:K.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===r.getLineCount())continue;const d=new W(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new ls(new Et(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new W(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new JY(d,h,new Et(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class cx extends pt{run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(130),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new W(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Ji.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Ji.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class xTt extends cx{constructor(){super({id:"editor.action.transformToUppercase",label:w("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:K.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class LTt extends cx{constructor(){super({id:"editor.action.transformToLowercase",label:w("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:K.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class MC{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class xk extends cx{constructor(){super({id:"editor.action.transformToTitlecase",label:w("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:K.writable})}_modifyText(e,t){const n=xk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,r=>r.toLocaleUpperCase()):e}}xk.titleBoundary=new MC("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class $v extends cx{constructor(){super({id:"editor.action.transformToSnakecase",label:w("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:K.writable})}_modifyText(e,t){const n=$v.caseBoundary.get(),r=$v.singleLetters.get();return!n||!r?e:e.replace(n,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}$v.caseBoundary=new MC("(\\p{Ll})(\\p{Lu})","gmu");$v.singleLetters=new MC("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Lk extends cx{constructor(){super({id:"editor.action.transformToCamelcase",label:w("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:K.writable})}_modifyText(e,t){const n=Lk.wordBoundary.get();if(!n)return e;const r=e.split(n);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Lk.wordBoundary=new MC("[_\\s-]","gm");class xp extends cx{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:w("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:K.writable})}_modifyText(e,t){const n=xp.caseBoundary.get(),r=xp.singleLetters.get(),o=xp.underscoreBoundary.get();return!n||!r||!o?e:e.replace(o,"$1-$3").replace(n,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}xp.caseBoundary=new MC("(\\p{Ll})(\\p{Lu})","gmu");xp.singleLetters=new MC("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");xp.underscoreBoundary=new MC("(\\S)(_)(\\S)","gm");Ke(aTt);Ke(lTt);Ke(cTt);Ke(uTt);Ke(dTt);Ke(hTt);Ke(fTt);Ke(gTt);Ke(uB);Ke(pTt);Ke(mTt);Ke(vTt);Ke(_Tt);Ke(bTt);Ke(CTt);Ke(yTt);Ke(wTt);Ke(STt);Ke(xTt);Ke(LTt);$v.caseBoundary.isSupported()&&$v.singleLetters.isSupported()&&Ke($v);Lk.wordBoundary.isSupported()&&Ke(Lk);xk.titleBoundary.isSupported()&&Ke(xk);xp.isSupported()&&Ke(xp);var ETt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pP;const sDe=new ct("LinkedEditingInputVisible",!1),DTt="linked-editing-decoration";let y_=pP=class extends me{static get(e){return e.getContribution(pP.ID)}constructor(e,t,n,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new Fe),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=sDe.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Fe),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(s=>{(s.hasChanged(70)||s.hasChanged(93))&&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(),n=t!==null&&(this._editor.getOption(70)||this._editor.getOption(93))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(ot.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new ad(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new ad(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const r=t.getValueInRange(n);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),r=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=this._currentRequestCts=new xr;try{const s=new Fs(!1),a=await aDe(this._providers,n,t,o.token);if(this._debounceInformation.update(n,s.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,r!==n.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,h=l.length;d({range:d,options:pP.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(s){Th(s)||nn(s),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}};y_.ID="editor.contrib.linkedEditing";y_.DECORATION=an.register({description:"linked-editing",stickiness:0,className:DTt});y_=pP=ETt([J2(1,Gt),J2(2,yt),J2(3,Ti),J2(4,_u)],y_);class ITt extends pt{constructor(){super({id:"editor.action.linkedEditing",label:w("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Re.and(K.writable,K.hasRenameProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(jn),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Ft.isUri(r)&&le.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},nn):super.runCommand(e,t)}run(e,t){const n=y_.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const kTt=zo.bindToContribution(y_.get);st(new kTt({id:"cancelLinkedEditingInput",precondition:sDe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:K.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function aDe(i,e,t,n){const r=i.ordered(e);return mY(r.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,n)}catch(s){eo(s);return}}),o=>!!o&&Ms(o==null?void 0:o.ranges))}X("editor.linkedEditingBackground",{dark:Ce.fromHex("#f00").transparent(.3),light:Ce.fromHex("#f00").transparent(.3),hcDark:Ce.fromHex("#f00").transparent(.3),hcLight:Ce.white},w("editorLinkedEditingBackground","Background color when the editor auto renames on type."));rg("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(yt);return aDe(n,e,t,wn.None)});Kn(y_.ID,y_,1);Ke(ITt);let TTt=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 LF{constructor(e){this._disposables=new Fe;let t=[];for(const[n,r]of e){const o=n.links.map(s=>new TTt(s,r));t=LF._union(t,o),tY(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;rPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,o])},eo));return Promise.all(r).then(()=>{const o=new LF(hh(n));return t.isCancellationRequested?(o.dispose(),new LF([])):o})}kn.registerCommand("_executeLinkProvider",async(i,...e)=>{let[t,n]=e;Yn(t instanceof Ft),typeof n!="number"&&(n=0);const{linkProvider:r}=i.get(yt),o=i.get(or).getModel(t);if(!o)return[];const s=await lDe(r,o,wn.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PK;let LS=PK=class extends me{static get(e){return e.getContribution(PK.ID)}constructor(e,t,n,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new mi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new M5(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(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=No(t=>lDe(this.providers,e,t));try{const t=new Fs(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){nn(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",n=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];n.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(bw.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{r.activate(o,n),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(n=>{t.deactivate(n,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(wn.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===cn.file&&o.startsWith(`${cn.file}:`)){const a=Ft.parse(o);if(a.scheme===cn.file){const l=Yh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=Gft(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(w("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(w("missing.url","Failed to open this link because its target is missing.")):nn(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const n of t){const r=this.currentOccurrences[n.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};LS.ID="editor.linkDetector";LS=PK=NTt([eM(1,hl),eM(2,zr),eM(3,yt),eM(4,_u)],LS);const yhe={general:an.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:an.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class bw{static decoration(e,t){return{range:e.range,options:bw._getOptions(e,t,!1)}}static _getOptions(e,t,n){const r={...n?yhe.active:yhe.general};return r.hoverMessage=RTt(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,bw._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,bw._getOptions(this.link,t,!1))}}function RTt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?w("links.navigate.executeCmd","Execute command"):w("links.navigate.follow","Follow link"),r=e?Dn?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Dn?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");if(i.url){let o="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=w("tooltip.explanation","Execute command {0}",l)}}return new Ns("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,o).appendMarkdown(` (${r})`)}else return new Ns().appendText(`${n} (${r})`)}class MTt extends pt{constructor(){super({id:"editor.action.openLink",label:w("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=LS.get(t);if(!n||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=n.getLinkOccurrence(o.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}Kn(LS.ID,LS,1);Ke(MTt);class AK extends me{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(117);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}AK.ID="editor.contrib.longLinesHelper";Kn(AK.ID,AK,2);const tM=X("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},w("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);X("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},w("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);X("editor.wordHighlightTextBackground",{light:tM,dark:tM,hcDark:tM,hcLight:tM},w("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 nM=X("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));X("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Ki,hcLight:Ki},w("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));X("editor.wordHighlightTextBorder",{light:nM,dark:nM,hcDark:nM,hcLight:nM},w("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const PTt=X("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ATt=X("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},w("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),OTt=X("editorOverviewRuler.wordHighlightTextForeground",{dark:ZL,light:ZL,hcDark:ZL,hcLight:ZL},w("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),FTt=an.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:pr(ATt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),BTt=an.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:pr(OTt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),WTt=an.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:pr(ZL),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}}),$Tt=an.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),HTt=an.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:pr(PTt),position:Cc.Center},minimap:{color:pr(R3),position:kl.Inline}});function VTt(i){return i===oI.Write?FTt:i===oI.Text?BTt:HTt}function zTt(i){return i?$Tt:WTt}vu((i,e)=>{const t=i.getColor(jY);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var UTt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jTt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},OK;function H_(i,e){const t=e.filter(n=>!i.find(r=>r.equals(n)));if(t.length>=1){const n=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?w("cursorAdded","Cursor added: {0}",n):w("cursorsAdded","Cursors added: {0}",n);jf(r)}}class KTt extends pt{constructor(){super({id:"editor.action.insertCursorAbove",label:w("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,qo.addCursorUp(o,s,r)),o.revealTopMostCursor(n.source),H_(s,o.getCursorStates())}}class GTt extends pt{constructor(){super({id:"editor.action.insertCursorBelow",label:w("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,qo.addCursorDown(o,s,r)),o.revealBottomMostCursor(n.source),H_(s,o.getCursorStates())}}class qTt extends pt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:w("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let r=e.startLineNumber;r1&&n.push(new Et(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),H_(s,o.getCursorStates())}}class XTt extends pt{constructor(){super({id:"editor.action.addCursorsToBottom",label:w("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=n[0].startLineNumber;l<=r;l++)o.push(new Et(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),H_(a,s.getCursorStates())}}class YTt extends pt{constructor(){super({id:"editor.action.addCursorsToTop",label:w("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=[];for(let a=n[0].startLineNumber;a>=1;a--)r.push(new Et(a,n[0].startColumn,a,n[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),H_(s,o.getCursorStates())}}class iM{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Ek{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Ek(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=n.wholeWord,s=n.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 Et(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new Ek(e,t,r,c,o,s,u)}constructor(e,t,n,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new iM(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 iM(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],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new Et(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new iM(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 iM(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],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new Et(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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(130):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824)}}class aC extends me{static get(e){return e.getContribution(aC.ID)}constructor(e){super(),this._sessionDispose=this._register(new Fe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Ek.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new Et(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const r=e.getState().matchCase;if(!cDe(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const r=this._editor.getModel();n.searchScope?t=r.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824):t=r.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;onew Et(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}aC.ID="editor.contrib.multiCursorController";class ux extends pt{run(e,t){const n=aC.get(t);if(!n)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=Na.get(t);if(s)this._run(n,s);else{const a=e.get(Wt).createInstance(Na,t);this._run(n,a),a.dispose()}H_(o,r.getCursorStates())}}}class ZTt extends ux{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:w("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2082,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class QTt extends ux{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:w("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class JTt extends ux{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:w("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:fo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class eNt extends ux{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:w("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 tNt extends ux{constructor(){super({id:"editor.action.selectHighlights",label:w("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:3114,weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"3_multi",title:w({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class nNt extends ux{constructor(){super({id:"editor.action.changeAll",label:w("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Re.and(K.writable,K.editorTextFocus),kbOpts:{kbExpr:K.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class iNt{constructor(e,t,n,r,o){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(W.compareRangesUsingStarts)),this._cachedFindMatches}}let Dk=OK=class extends me{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(108),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new mi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(108)})),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 n=Na.get(e);n&&this._register(n.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(OK._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const r=n.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=aC.get(n);if(!o)return null;const s=Na.get(n);if(!s)return null;let a=o.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!cDe(n.getModel(),u,h))return null}a=Ek.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new iNt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(130):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 n=this.state.findMatches(),r=this.editor.getSelections();r.sort(W.compareRangesUsingStarts);const o=[];for(let c=0,u=0,d=n.length,h=r.length;c=h)o.push(f),c++;else{const g=W.compareRangesUsingStarts(f,r[u]);g<0?((r[u].isEmpty()||!W.areIntersecting(f,r[u]))&&o.push(f),c++):(g>0||c++,u++)}}const s=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,l=o.map(c=>({range:c,options:zTt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};Dk.ID="editor.contrib.selectionHighlighter";Dk=OK=UTt([jTt(1,yt)],Dk);function cDe(i,e,t){const n=whe(i,e[0],!t);for(let r=1,o=e.length;r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dNt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const rW="inline-edit";let FK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Vn(this,!1),this.currentTextModel=ji(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=en(this,r=>{var o;if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const a=this.model.ghostText.read(r);if(!a)return;let l=(o=this.model.range)===null||o===void 0?void 0:o.read(r);l&&l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn&&(l=void 0);const c=(l?l.startLineNumber===l.endLineNumber:!0)&&a.parts.length===1&&a.parts[0].lines.length===1,u=a.parts.length===1&&a.parts[0].lines.every(y=>y.length===0),d=[],h=[];function f(y,S){if(h.length>0){const L=h[h.length-1];S&&L.decorations.push(new wa(L.content.length+1,L.content.length+1+y[0].length,S,0)),L.content+=y[0],y=y.slice(1)}for(const L of y)h.push({content:L,decorations:S?[new wa(1,L.length+1,S,0)]:[]})}const g=s.getLineContent(a.lineNumber);let p,m=0;if(!u){for(const y of a.parts){let S=y.lines;l&&!c&&(f(S,rW),S=[]),p===void 0?(d.push({column:y.column,text:S[0],preview:y.preview}),S=S.slice(1)):f([g.substring(m,y.column-1)],void 0),S.length>0&&(f(S,rW),p===void 0&&y.column<=g.length&&(p=y.column)),m=y.column-1}p!==void 0&&f([g.substring(m)],void 0)}const v=p!==void 0?new VEe(p,g.length+1):void 0,_=c||!l?a.lineNumber:l.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:_,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s,range:l,isSingleLine:c,isPureRemove:u,backgroundColoring:this.model.backgroundColoring.read(r)}}),this.decorations=en(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];if(o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const c=o.range.endLineNumber-o.range.startLineNumber;for(let u=0;u{const o=this.uiState.read(r);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ot(()=>{this.isDisposed.set(!0,void 0)})),this._register(zEe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};FK=uNt([dNt(2,qi)],FK);var rJ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mP;let BK=class extends me{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=en(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.widget.model.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new le(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ah((r,o)=>{if(!this.model.read(r)||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(ES,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ot(()=>e.removeContentWidget(a)))}))}};BK=rJ([qg(2,Wt)],BK);let ES=mP=class extends me{constructor(e,t,n,r,o,s){super(),this.editor=e,this.withBorder=t,this._position=n,this._contextKeyService=o,this._menuService=s,this.id=`InlineEditHintsContentWidget${mP.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=pi("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[pi("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(H.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(r.createInstance(WK,this.nodes.toolBar,this.editor,H.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof bc)return r.createInstance(hNt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{mP._dropDownVisible=a})),this._register(yn(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(yn(a=>{const l=[];for(const[c,u]of this.inlineCompletionsActionsMenus.getActions())for(const d of u)d instanceof bc&&l.push(d);l.length>0&&l.unshift(new ho),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};ES._dropDownVisible=!1;ES.id=0;ES=mP=rJ([qg(3,Wt),qg(4,Gt),qg(5,mu)],ES);class hNt extends a_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=pi("div.keybinding").root;new ex(t,Ll,{disableTitle:!0,...GSe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let WK=class extends sk{constructor(e,t,n,r,o,s,a,l,c){super(e,{resetMenu:n,...r},o,s,a,l,c),this.editor=t,this.menuId=n,this.options2=r,this.menuService=o,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._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];n5(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setAdditionalSecondaryActions(e){lr(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};WK=rJ([qg(4,mu),qg(5,Gt),qg(6,$l),qg(7,ci),qg(8,ia)],WK);var fNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},IL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ib;class gNt{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}let Co=ib=class extends me{static get(e){return e.getContribution(ib.ID)}constructor(e,t,n,r,o,s){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.languageFeaturesService=r,this._commandService=o,this._configurationService=s,this._isVisibleContext=ib.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=ib.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(nk(this,void 0)),this._isAccepting=!1,this._enabled=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily),this._backgroundColoring=ji(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).backgroundColoring);const a=_a("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(yn(h=>{this._enabled.read(h)&&(a.read(h),this.getInlineEdit(e,!0))}));const l=ji(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(yn(h=>{if(!this._enabled.read(h))return;const f=l.read(h);f&&this.checkCursorPosition(f)})),this._register(yn(h=>{const f=this._currentEdit.read(h);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const g=e.getPosition();g&&this.checkCursorPosition(g)}));const c=_a("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(yn(h=>{var f;this._enabled.read(h)&&(c.read(h),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((f=this._currentRequestCts)===null||f===void 0||f.dispose(),this._currentRequestCts=void 0,this.clear(!1)))}));const u=_a("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(yn(h=>{this._enabled.read(h)&&(u.read(h),this.getInlineEdit(e,!0))}));const d=this._register(M1e());this._register(yn(h=>{const f=this._fontFamily.read(h);d.setStyle(f===""||f==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { font-family: ${f}; }`)})),this._register(new BK(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){var t;if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(W.containsPosition(n.range,e))}validateInlineEdit(e,t){var n,r;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,a=t.range.endColumn,l=(r=(n=e.getModel())===null||n===void 0?void 0:n.getLineLength(s))!==null&&r!==void 0?r:0;if(a!==l+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const n=e.getModel();if(!n)return;const r=n.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(n);if(o.length===0)return;const s=o[0];this._currentRequestCts=new xr;const a=this._currentRequestCts.token,l=t?AA.Automatic:AA.Invoke;if(t&&await pNt(50,a),a.isCancellationRequested||n.isDisposed()||n.getVersionId()!==r)return;const u=await s.provideInlineEdit(n,{triggerKind:l},a);if(u&&!(a.isCancellationRequested||n.isDisposed()||n.getVersionId()!==r)&&this.validateInlineEdit(e,u))return u}async getInlineEdit(e,t){var n;this._isCursorAtInlineEditContext.set(!1),this.clear(),this._isAccepting=!1;const r=await this.fetchInlineEdit(e,t);if(!r)return;const o=r.range.endLineNumber,s=r.range.endColumn,a=new _k(o,[new bF(s,r.text,!1)]),l=this.instantiationService.createInstance(FK,this.editor,{ghostText:fp(a),minReservedLineCount:fp(0),targetTextModel:fp((n=this.editor.getModel())!==null&&n!==void 0?n:void 0),range:fp(r.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new gNt(l,r),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}accept(){var e;this._isAccepting=!0;const t=(e=this._currentEdit.get())===null||e===void 0?void 0:e.edit;if(!t)return;let n=t.text;t.text.startsWith(` -`)&&(n=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Qi.replace(W.lift(t.range),n)]),t.accepted&&this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]),this.freeEdit(t),this._currentEdit.set(void 0,void 0)}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n)return;const r=le.lift({lineNumber:n.range.startLineNumber,column:n.range.startColumn});this.editor.setPosition(r),this.editor.revealPositionInCenterIfOutsideViewport(r)}clear(e=!0){var t;const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;n&&(n!=null&&n.rejected)&&!this._isAccepting&&e&&this._commandService.executeCommand(n.rejected.id,...n.rejected.arguments||[]),n&&this.freeEdit(n),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const n=this.languageFeaturesService.inlineEditProvider.all(t);n.length!==0&&n[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const n=t.edit,r=t.widget.model;if(W.containsPosition(n.range,e.getStartPosition())||W.containsPosition(n.range,e.getEndPosition()))return!0;const s=r.ghostText.get();return s?s.parts.some(a=>e.containsPosition(new le(s.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&n!==void 0?n:!1}};Co.ID="editor.contrib.inlineEditController";Co.inlineEditVisibleKey="inlineEditVisible";Co.inlineEditVisibleContext=new ct(nb.inlineEditVisibleKey,!1);Co.cursorAtInlineEditKey="cursorAtInlineEdit";Co.cursorAtInlineEditContext=new ct(nb.cursorAtInlineEditKey,!1);Co=nb=fNt([IL(1,Wt),IL(2,Gt),IL(3,yt),IL(4,cr),IL(5,mn)],Co);function pNt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class mNt extends pt{constructor(){super({id:sNt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:Re.and(K.writable,Co.inlineEditVisibleContext),kbOpts:[{weight:100+1,primary:2,kbExpr:Re.and(K.writable,Co.inlineEditVisibleContext,Co.cursorAtInlineEditContext)}],menuOpts:[{menuId:H.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const n=Co.get(t);n==null||n.accept()}}class vNt extends pt{constructor(){const e=Re.and(K.writable,Re.not(Co.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e}})}async run(e,t){const n=Co.get(t);n==null||n.trigger()}}class _Nt extends pt{constructor(){const e=Re.and(K.writable,Co.inlineEditVisibleContext,Re.not(Co.cursorAtInlineEditKey));super({id:lNt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const n=Co.get(t);n==null||n.jumpToCurrent()}}class bNt extends pt{constructor(){const e=Re.and(K.writable,Co.cursorAtInlineEditContext);super({id:cNt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:100+10,primary:2646,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const n=Co.get(t);n==null||n.jumpBack()}}class CNt extends pt{constructor(){const e=Re.and(K.writable,Co.inlineEditVisibleContext);super({id:aNt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const n=Co.get(t);n==null||n.clear()}}var yNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},She=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class wNt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let $K=class{constructor(e,t,n){this._editor=e,this._instantiationService=t,this._telemetryService=n,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=Co.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId)){const o=n.range;return new bb(1e3,this,o,e.event.posx,e.event.posy,!1)}}return n.type===7&&t.shouldShowHoverAt(n.range)?new bb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new bb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(63).showToolbar!=="onHover")return[];const n=Co.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new wNt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Fe;this._telemetryService.publicLog2("inlineEditHover.shown");const r=this._instantiationService.createInstance(ES,this._editor,!1,fp(null));return e.fragment.appendChild(r.getDomNode()),n.add(r),n}};$K=yNt([She(1,Wt),She(2,ia)],$K);Ke(mNt);Ke(CNt);Ke(_Nt);Ke(bNt);Ke(vNt);Kn(Co.ID,Co,3);W_.register($K);const aC={Visible:new ct("parameterHintsVisible",!1),MultipleSignatures:new ct("parameterHintsMultipleSignatures",!1)};async function uDe(i,e,t,n,r){const o=i.ordered(e);for(const s of o)try{const a=await s.provideSignatureHelp(e,t,r,n);if(a)return a}catch(a){eo(a)}}kn.registerCommand("_executeSignatureHelpProvider",async(i,...e)=>{const[t,n,r]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string"||!r);const o=i.get(yt),s=await i.get(ul).createModelReference(t);try{const a=await uDe(o.signatureHelpProvider,s.object.textEditorModel,le.lift(n),{triggerKind:Af.Invoke,isRetrigger:!1,triggerCharacter:r},wn.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}});var Am;(function(i){i.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}i.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}i.Active=t})(Am||(Am={}));class dB extends me{constructor(e,t,n=dB.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new ae),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Am.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Vo),this.triggerChars=new qA,this.retriggerChars=new qA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new ad(n),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=Am.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(nn)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Am.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,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(SNt);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new Am.Pending(No(l=>uDe(this.providers,s,a,o,l)),n);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 Am.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Am.Default),nn(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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const r=n.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:Af.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Af.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Af.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}dB.DEFAULT_DELAY=120;function SNt(i,e){switch(e.triggerKind){case Af.Invoke:return e;case Af.ContentChange:return i;case Af.TriggerCharacter:default:return e}}var xNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HK;const ql=Xe,LNt=Or("parameter-hints-next",tt.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),ENt=Or("parameter-hints-previous",tt.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let EF=HK=class extends me{constructor(e,t,n,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Fe),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new qf({editor:e},o,r)),this.keyVisible=aC.Visible.bindTo(n),this.keyMultipleSignatures=aC.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=ql(".editor-widget.parameter-hints-widget"),t=Oe(e,ql(".phwrapper"));t.tabIndex=-1;const n=Oe(t,ql(".controls")),r=Oe(n,ql(".button"+Vt.asCSSSelector(ENt))),o=Oe(n,ql(".overloads")),s=Oe(n,ql(".button"+Vt.asCSSSelector(LNt)));this._register(xe(r,"click",h=>{gn.stop(h),this.previous()})),this._register(xe(s,"click",h=>{gn.stop(h),this.next()}));const a=ql(".body"),l=new ST(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Oe(a,ql(".signature")),u=Oe(a,ql(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(ot.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=Oe(this.domNodes.signature,ql(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=Oe(o,ql("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=ql("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}Oe(this.domNodes.docs,ql("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")Oe(this.domNodes.docs,ql("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);Oe(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(Pl(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Ym(t.documentation).length>0||t&&typeof t.documentation=="object"&&Ym(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Ym(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Ym(e.documentation.value).length>0)}renderParameters(e,t,n){const[r,o]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),Oe(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const r=new RegExp(`(\\W|^)${vc(n.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-n.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return HK.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};EF.ID="editor.widget.parameterHintsWidget";EF=HK=xNt([oW(2,Gt),oW(3,hl),oW(4,qi)],EF);X("editorHoverWidget.highlightForeground",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var DNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VK;let lC=VK=class extends me{static get(e){return e.getContribution(VK.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new dB(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new tg(()=>this._register(t.createInstance(EF,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};lC.ID="editor.controller.parameterHints";lC=VK=DNt([xhe(1,Wt),xhe(2,yt)],lC);class INt extends pt{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:K.hasSignatureHelpProvider,kbOpts:{kbExpr:K.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=lC.get(t);n==null||n.trigger({triggerKind:Af.Invoke})}}Kn(lC.ID,lC,2);Ke(INt);const oJ=100+75,sJ=zo.bindToContribution(lC.get);st(new sJ({id:"closeParameterHints",precondition:aC.Visible,handler:i=>i.cancel(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:9,secondary:[1033]}}));st(new sJ({id:"showPrevParameterHint",precondition:Re.and(aC.Visible,aC.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));st(new sJ({id:"showNextParameterHint",precondition:Re.and(aC.Visible,aC.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var kNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const dx=new ct("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible")),zK=new ct("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let UK=class{constructor(e,t,n,r,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=r,this._logService=s,this._disposables=new Fe,this.allowEditorOverflow=!0,this._visibleContextKey=dx.bindTo(o),this._focusedContextKey=zK.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._disposables.add(xe(this._input,"focus",()=>{this._focusedContextKey.set(!0)})),this._disposables.add(xe(this._input,"blur",()=>{this._focusedContextKey.reset()})),this._domNode.appendChild(this._input),this._candidatesView=this._disposables.add(new TNt(this._domNode,{fontInfo:this._editor.getOption(50),onSelectionChange:()=>this.acceptInput(!1)})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,n,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(np),a=e.getColor(Lye);this._domNode.style.backgroundColor=String((t=e.getColor(Pr))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(Dye))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((r=e.getColor(Eye))!==null&&r!==void 0?r:"");const l=e.getColor(Iye);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label||!this._candidatesView)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._candidatesView.updateFont(e),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=Wp(this.getDomNode().ownerDocument.body),t=Hr(this._editor.getDomNode()),n=this._getTopForPosition();this._nPxAvailableAbove=n+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:o}=cC.getLayoutInfo({lineHeight:r}),s=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:s}}beforeRender(){var e,t;const[n,r]=this._acceptKeybindings;return this._label.innerText=w({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Yn(this._candidatesView),Yn(this._nPxAvailableAbove!==void 0),Yn(this._nPxAvailableBelow!==void 0);const t=ep(this._input),n=ep(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._candidatesView.layout({height:r-n-t,width:ha(this._input)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e,t){var n;this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),(n=this._currentCancelInput)===null||n===void 0||n.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._candidatesView)===null||e===void 0||e.focusNext()}focusPreviousRenameSuggestion(){var e;!((e=this._candidatesView)===null||e===void 0)&&e.focusPrevious()||this._input.focus()}getInput(e,t,n,r,o,s,a){this._domNode.classList.toggle("preview",o),this._position=new le(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const l=new Fe;return l.add(Ot(()=>a.dispose(!0))),this._updateRenameCandidates(s,t,a.token),new Promise(c=>{this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._candidatesView)===null||d===void 0||d.clearCandidates(),c(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),Yn(this._input!==void 0),Yn(this._candidatesView!==void 0);const d=this._candidatesView.nCandidates;let h,f;const g=this._candidatesView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),h=g,f="renameSuggestion"):(this._trace("using new name from inputField"),h=this._input.value,f="inputField"),h===t||h.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._candidatesView.clearCandidates(),c({newName:h,wantsPreview:o&&u,source:f,nRenameSuggestions:d})},l.add(a.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!(!((u=this._domNode)===null||u===void 0)&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show()}).finally(()=>{l.dispose(),this._hide()})}_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._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,n){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const o=await gT(Promise.allSettled(e),n);if(o===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const s=o.flatMap(c=>c.status==="fulfilled"&&Pf(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const a=Ap(s,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>{var u;return c.trim().length>0&&c!==((u=this._input)===null||u===void 0?void 0:u.value)&&c!==t});if(r(`valid distinct candidates - ${s.length} candidates.`),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._candidatesView.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("RenameInputField#_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("RenameInputField",...e)}};UK=kNt([rM(2,Mo),rM(3,ci),rM(4,Gt),rM(5,Ra)],UK);class TNt{constructor(e,t){this._disposables=new Fe,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.style.fontFamily=t.fontInfo.fontFamily,this._listContainer.style.fontWeight=t.fontInfo.fontWeight,this._listContainer.style.fontSize=`${t.fontInfo.fontSize}px`,e.appendChild(this._listContainer);const n=this,r=new class{getTemplateId(s){return"candidate"}getHeight(s){return n._candidateViewHeight}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(s){return new cC(s,{lineHeight:n._lineHeight})}renderElement(s,a,l){l.model=s}disposeTemplate(s){s.dispose()}};this._listWidget=new Ec("NewSymbolNameCandidates",this._listContainer,r,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1}),this._disposables.add(this._listWidget.onDidChangeSelection(s=>{s.elements.length>0&&t.onSelectionChange()})),this._disposables.add(this._listWidget.onDidBlur(s=>{this._listWidget.setFocus([])})),this._listWidget.style(O_)}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(e.length),n=this._pickListWidth(e);this._listWidget.layout(t,n),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${n}px`,jf(w("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}updateFont(e){this._listContainer.style.fontFamily=e.fontFamily,this._listContainer.style.fontWeight=e.fontWeight,this._listContainer.style.fontSize=`${e.fontSize}px`,this._lineHeight=e.lineHeight,this._listWidget.rerender()}focusNext(){this._listWidget.length!==0&&(this._listWidget.isDOMFocused()?this._listWidget.focusNext():(this._listWidget.domFocus(),this._listWidget.focusFirst()),this._listWidget.reveal(this._listWidget.getFocus()[0]))}focusPrevious(){if(this._listWidget.length===0)return!1;this._listWidget.domFocus();const e=this._listWidget.getFocus()[0];return e!==0&&(this._listWidget.focusPrevious(),this._listWidget.reveal(this._listWidget.getFocus()[0])),e>0}get _candidateViewHeight(){const{totalHeight:e}=cC.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e,n=7;return Math.min(t,this._availableHeight,this._candidateViewHeight*n)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,4+16+5+t+10)}}class cC{constructor(e,{lineHeight:t}){this.domNode=document.createElement("div"),this.domNode.style.display="flex",this.domNode.style.alignItems="center",this.domNode.style.height=`${t}px`,this.domNode.style.padding=`${cC._PADDING}px`,this._icon=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._icon.style.width=this._icon.style.height=`${t*.8}px`,this.domNode.appendChild(this._icon),this._label=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._label.style.marginLeft="5px",this.domNode.appendChild(this._label),e.appendChild(this.domNode)}set model(e){this._icon.children.length===0&&this._icon.appendChild(FI(tt.sparkle)),this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+cC._PADDING*2}}dispose(){}}cC._PADDING=2;var NNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_m=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jK;class aJ{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`)&&(n=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Ji.replace(W.lift(t.range),n)]),t.accepted&&this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]),this.freeEdit(t),this._currentEdit.set(void 0,void 0)}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n)return;const r=le.lift({lineNumber:n.range.startLineNumber,column:n.range.startColumn});this.editor.setPosition(r),this.editor.revealPositionInCenterIfOutsideViewport(r)}clear(e=!0){var t;const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;n&&(n!=null&&n.rejected)&&!this._isAccepting&&e&&this._commandService.executeCommand(n.rejected.id,...n.rejected.arguments||[]),n&&this.freeEdit(n),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const n=this.languageFeaturesService.inlineEditProvider.all(t);n.length!==0&&n[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const n=t.edit,r=t.widget.model;if(W.containsPosition(n.range,e.getStartPosition())||W.containsPosition(n.range,e.getEndPosition()))return!0;const s=r.ghostText.get();return s?s.parts.some(a=>e.containsPosition(new le(s.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&n!==void 0?n:!1}};Co.ID="editor.contrib.inlineEditController";Co.inlineEditVisibleKey="inlineEditVisible";Co.inlineEditVisibleContext=new ct(ib.inlineEditVisibleKey,!1);Co.cursorAtInlineEditKey="cursorAtInlineEdit";Co.cursorAtInlineEditContext=new ct(ib.cursorAtInlineEditKey,!1);Co=ib=fNt([IL(1,Wt),IL(2,Gt),IL(3,yt),IL(4,cr),IL(5,mn)],Co);function pNt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class mNt extends pt{constructor(){super({id:sNt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:Re.and(K.writable,Co.inlineEditVisibleContext),kbOpts:[{weight:100+1,primary:2,kbExpr:Re.and(K.writable,Co.inlineEditVisibleContext,Co.cursorAtInlineEditContext)}],menuOpts:[{menuId:H.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const n=Co.get(t);n==null||n.accept()}}class vNt extends pt{constructor(){const e=Re.and(K.writable,Re.not(Co.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e}})}async run(e,t){const n=Co.get(t);n==null||n.trigger()}}class _Nt extends pt{constructor(){const e=Re.and(K.writable,Co.inlineEditVisibleContext,Re.not(Co.cursorAtInlineEditKey));super({id:lNt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const n=Co.get(t);n==null||n.jumpToCurrent()}}class bNt extends pt{constructor(){const e=Re.and(K.writable,Co.cursorAtInlineEditContext);super({id:cNt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:100+10,primary:2646,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const n=Co.get(t);n==null||n.jumpBack()}}class CNt extends pt{constructor(){const e=Re.and(K.writable,Co.inlineEditVisibleContext);super({id:aNt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:H.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const n=Co.get(t);n==null||n.clear()}}var yNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},She=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class wNt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let $K=class{constructor(e,t,n){this._editor=e,this._instantiationService=t,this._telemetryService=n,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=Co.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId)){const o=n.range;return new Cb(1e3,this,o,e.event.posx,e.event.posy,!1)}}return n.type===7&&t.shouldShowHoverAt(n.range)?new Cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new Cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(63).showToolbar!=="onHover")return[];const n=Co.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new wNt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Fe;this._telemetryService.publicLog2("inlineEditHover.shown");const r=this._instantiationService.createInstance(ES,this._editor,!1,fp(null));return e.fragment.appendChild(r.getDomNode()),n.add(r),n}};$K=yNt([She(1,Wt),She(2,ia)],$K);Ke(mNt);Ke(CNt);Ke(_Nt);Ke(bNt);Ke(vNt);Kn(Co.ID,Co,3);$_.register($K);const lC={Visible:new ct("parameterHintsVisible",!1),MultipleSignatures:new ct("parameterHintsMultipleSignatures",!1)};async function uDe(i,e,t,n,r){const o=i.ordered(e);for(const s of o)try{const a=await s.provideSignatureHelp(e,t,r,n);if(a)return a}catch(a){eo(a)}}kn.registerCommand("_executeSignatureHelpProvider",async(i,...e)=>{const[t,n,r]=e;Yn(Ft.isUri(t)),Yn(le.isIPosition(n)),Yn(typeof r=="string"||!r);const o=i.get(yt),s=await i.get(ul).createModelReference(t);try{const a=await uDe(o.signatureHelpProvider,s.object.textEditorModel,le.lift(n),{triggerKind:Af.Invoke,isRetrigger:!1,triggerCharacter:r},wn.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}});var Am;(function(i){i.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}i.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}i.Active=t})(Am||(Am={}));class dB extends me{constructor(e,t,n=dB.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new ae),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Am.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Vo),this.triggerChars=new qA,this.retriggerChars=new qA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new ad(n),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=Am.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(nn)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Am.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,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(SNt);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new Am.Pending(No(l=>uDe(this.providers,s,a,o,l)),n);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 Am.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Am.Default),nn(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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const r=n.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:Af.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Af.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Af.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}dB.DEFAULT_DELAY=120;function SNt(i,e){switch(e.triggerKind){case Af.Invoke:return e;case Af.ContentChange:return i;case Af.TriggerCharacter:default:return e}}var xNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HK;const ql=Xe,LNt=Or("parameter-hints-next",tt.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),ENt=Or("parameter-hints-previous",tt.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let EF=HK=class extends me{constructor(e,t,n,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Fe),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new qf({editor:e},o,r)),this.keyVisible=lC.Visible.bindTo(n),this.keyMultipleSignatures=lC.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=ql(".editor-widget.parameter-hints-widget"),t=Oe(e,ql(".phwrapper"));t.tabIndex=-1;const n=Oe(t,ql(".controls")),r=Oe(n,ql(".button"+Vt.asCSSSelector(ENt))),o=Oe(n,ql(".overloads")),s=Oe(n,ql(".button"+Vt.asCSSSelector(LNt)));this._register(xe(r,"click",h=>{gn.stop(h),this.previous()})),this._register(xe(s,"click",h=>{gn.stop(h),this.next()}));const a=ql(".body"),l=new ST(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Oe(a,ql(".signature")),u=Oe(a,ql(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(ot.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=Oe(this.domNodes.signature,ql(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=Oe(o,ql("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=ql("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}Oe(this.domNodes.docs,ql("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")Oe(this.domNodes.docs,ql("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);Oe(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(Pl(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Ym(t.documentation).length>0||t&&typeof t.documentation=="object"&&Ym(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Ym(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Ym(e.documentation.value).length>0)}renderParameters(e,t,n){const[r,o]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),Oe(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const r=new RegExp(`(\\W|^)${vc(n.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-n.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return HK.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};EF.ID="editor.widget.parameterHintsWidget";EF=HK=xNt([oW(2,Gt),oW(3,hl),oW(4,qi)],EF);X("editorHoverWidget.highlightForeground",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var DNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VK;let cC=VK=class extends me{static get(e){return e.getContribution(VK.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new dB(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new tg(()=>this._register(t.createInstance(EF,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};cC.ID="editor.controller.parameterHints";cC=VK=DNt([xhe(1,Wt),xhe(2,yt)],cC);class INt extends pt{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:K.hasSignatureHelpProvider,kbOpts:{kbExpr:K.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=cC.get(t);n==null||n.trigger({triggerKind:Af.Invoke})}}Kn(cC.ID,cC,2);Ke(INt);const oJ=100+75,sJ=zo.bindToContribution(cC.get);st(new sJ({id:"closeParameterHints",precondition:lC.Visible,handler:i=>i.cancel(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:9,secondary:[1033]}}));st(new sJ({id:"showPrevParameterHint",precondition:Re.and(lC.Visible,lC.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));st(new sJ({id:"showNextParameterHint",precondition:Re.and(lC.Visible,lC.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:oJ,kbExpr:K.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var kNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const dx=new ct("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible")),zK=new ct("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let UK=class{constructor(e,t,n,r,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=r,this._logService=s,this._disposables=new Fe,this.allowEditorOverflow=!0,this._visibleContextKey=dx.bindTo(o),this._focusedContextKey=zK.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._disposables.add(xe(this._input,"focus",()=>{this._focusedContextKey.set(!0)})),this._disposables.add(xe(this._input,"blur",()=>{this._focusedContextKey.reset()})),this._domNode.appendChild(this._input),this._candidatesView=this._disposables.add(new TNt(this._domNode,{fontInfo:this._editor.getOption(50),onSelectionChange:()=>this.acceptInput(!1)})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,n,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(np),a=e.getColor(Lye);this._domNode.style.backgroundColor=String((t=e.getColor(Pr))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(Dye))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((r=e.getColor(Eye))!==null&&r!==void 0?r:"");const l=e.getColor(Iye);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label||!this._candidatesView)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._candidatesView.updateFont(e),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=Wp(this.getDomNode().ownerDocument.body),t=Hr(this._editor.getDomNode()),n=this._getTopForPosition();this._nPxAvailableAbove=n+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:o}=uC.getLayoutInfo({lineHeight:r}),s=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:s}}beforeRender(){var e,t;const[n,r]=this._acceptKeybindings;return this._label.innerText=w({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Yn(this._candidatesView),Yn(this._nPxAvailableAbove!==void 0),Yn(this._nPxAvailableBelow!==void 0);const t=ep(this._input),n=ep(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._candidatesView.layout({height:r-n-t,width:ha(this._input)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e,t){var n;this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),(n=this._currentCancelInput)===null||n===void 0||n.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._candidatesView)===null||e===void 0||e.focusNext()}focusPreviousRenameSuggestion(){var e;!((e=this._candidatesView)===null||e===void 0)&&e.focusPrevious()||this._input.focus()}getInput(e,t,n,r,o,s,a){this._domNode.classList.toggle("preview",o),this._position=new le(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const l=new Fe;return l.add(Ot(()=>a.dispose(!0))),this._updateRenameCandidates(s,t,a.token),new Promise(c=>{this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._candidatesView)===null||d===void 0||d.clearCandidates(),c(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),Yn(this._input!==void 0),Yn(this._candidatesView!==void 0);const d=this._candidatesView.nCandidates;let h,f;const g=this._candidatesView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),h=g,f="renameSuggestion"):(this._trace("using new name from inputField"),h=this._input.value,f="inputField"),h===t||h.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._candidatesView.clearCandidates(),c({newName:h,wantsPreview:o&&u,source:f,nRenameSuggestions:d})},l.add(a.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!(!((u=this._domNode)===null||u===void 0)&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show()}).finally(()=>{l.dispose(),this._hide()})}_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._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,n){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const o=await gT(Promise.allSettled(e),n);if(o===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const s=o.flatMap(c=>c.status==="fulfilled"&&Pf(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const a=Ap(s,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>{var u;return c.trim().length>0&&c!==((u=this._input)===null||u===void 0?void 0:u.value)&&c!==t});if(r(`valid distinct candidates - ${s.length} candidates.`),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._candidatesView.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("RenameInputField#_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("RenameInputField",...e)}};UK=kNt([rM(2,Mo),rM(3,ci),rM(4,Gt),rM(5,Ra)],UK);class TNt{constructor(e,t){this._disposables=new Fe,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.style.fontFamily=t.fontInfo.fontFamily,this._listContainer.style.fontWeight=t.fontInfo.fontWeight,this._listContainer.style.fontSize=`${t.fontInfo.fontSize}px`,e.appendChild(this._listContainer);const n=this,r=new class{getTemplateId(s){return"candidate"}getHeight(s){return n._candidateViewHeight}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(s){return new uC(s,{lineHeight:n._lineHeight})}renderElement(s,a,l){l.model=s}disposeTemplate(s){s.dispose()}};this._listWidget=new Ec("NewSymbolNameCandidates",this._listContainer,r,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1}),this._disposables.add(this._listWidget.onDidChangeSelection(s=>{s.elements.length>0&&t.onSelectionChange()})),this._disposables.add(this._listWidget.onDidBlur(s=>{this._listWidget.setFocus([])})),this._listWidget.style(F_)}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(e.length),n=this._pickListWidth(e);this._listWidget.layout(t,n),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${n}px`,jf(w("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}updateFont(e){this._listContainer.style.fontFamily=e.fontFamily,this._listContainer.style.fontWeight=e.fontWeight,this._listContainer.style.fontSize=`${e.fontSize}px`,this._lineHeight=e.lineHeight,this._listWidget.rerender()}focusNext(){this._listWidget.length!==0&&(this._listWidget.isDOMFocused()?this._listWidget.focusNext():(this._listWidget.domFocus(),this._listWidget.focusFirst()),this._listWidget.reveal(this._listWidget.getFocus()[0]))}focusPrevious(){if(this._listWidget.length===0)return!1;this._listWidget.domFocus();const e=this._listWidget.getFocus()[0];return e!==0&&(this._listWidget.focusPrevious(),this._listWidget.reveal(this._listWidget.getFocus()[0])),e>0}get _candidateViewHeight(){const{totalHeight:e}=uC.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e,n=7;return Math.min(t,this._availableHeight,this._candidateViewHeight*n)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,4+16+5+t+10)}}class uC{constructor(e,{lineHeight:t}){this.domNode=document.createElement("div"),this.domNode.style.display="flex",this.domNode.style.alignItems="center",this.domNode.style.height=`${t}px`,this.domNode.style.padding=`${uC._PADDING}px`,this._icon=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._icon.style.width=this._icon.style.height=`${t*.8}px`,this.domNode.appendChild(this._icon),this._label=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._label.style.marginLeft="5px",this.domNode.appendChild(this._label),e.appendChild(this.domNode)}set model(e){this._icon.children.length===0&&this._icon.appendChild(FI(tt.sparkle)),this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+uC._PADDING*2}}dispose(){}}uC._PADDING=2;var NNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_m=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jK;class aJ{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:W.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,n,r){const o=this._providers[t];if(!o)return{edits:[],rejectReason:n.join(` -`)};const s=await o.provideRenameEdits(this.model,this.position,e,r);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),r)}else return this._provideRenameEdits(e,t+1,n.concat(w("no result","No result.")),r);return s}}async function RNt(i,e,t,n){const r=new aJ(e,t,i),o=await r.resolveRenameLocation(wn.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(n,wn.None)}let Vp=jK=class{static get(e){return e.getContribution(jK.ID)}constructor(e,t,n,r,o,s,a,l,c){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=r,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new Fe,this._cts=new xr,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(UK,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;const n=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new xr,!this.editor.hasModel()){n("editor has no model");return}const r=this.editor.getPosition(),o=new aJ(this.editor.getModel(),r,this._languageFeaturesService.renameProvider);if(!o.hasProvider()){n("skeleton has no provider");return}const s=new l_(this.editor,5,void 0,this._cts.token);let a;try{n("resolving rename location");const y=o.resolveRenameLocation(s.token);this._progressService.showWhile(y,250),a=await y,n("resolved rename location")}catch(y){n("resolve rename location failed",JSON.stringify(y,null," ")),(e=Da.get(this.editor))===null||e===void 0||e.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),r);return}finally{s.dispose()}if(!a){n("returning early - no loc");return}if(a.rejectReason){n(`returning early - rejected with reason: ${a.rejectReason}`,a.rejectReason),(t=Da.get(this.editor))===null||t===void 0||t.showMessage(a.rejectReason,r);return}if(s.token.isCancellationRequested){n("returning early - cts1 cancelled");return}const l=new l_(this.editor,5,a.range,this._cts.token),c=this.editor.getModel(),u=new xr(l.token),d=this._languageFeaturesService.newSymbolNamesProvider.all(c),h=d.map(y=>y.provideNewSymbolNames(c,a.range,u.token));n(`requested new symbol names from ${d.length} providers`);const f=this.editor.getSelection();let g=0,p=a.text.length;!W.isEmpty(f)&&!W.spansMultipleLines(f)&&W.containsRange(a.range,f)&&(g=Math.max(0,f.startColumn-a.range.startColumn),p=Math.min(a.range.endColumn,f.endColumn)-a.range.startColumn),n("creating rename input field and awaiting its result");const m=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),v=await this._renameInputField.getInput(a.range,a.text,g,p,m,h,u);if(n("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,c.getLanguageId(),v),typeof v=="boolean"){n(`returning early - rename input field response - ${v}`),v&&this.editor.focus(),l.dispose();return}this.editor.focus(),n("requesting rename edits");const _=gT(o.provideRenameEdits(v.newName,l.token),l.token).then(async y=>{if(!y){n("returning early - no rename edits result");return}if(!this.editor.hasModel()){n("returning early - no model after rename edits are provided");return}if(y.rejectReason){n(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),n("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:v.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,v.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,v.newName),respectAutoSaveConfig:!0}).then(S=>{n("edits applied"),S.ariaSummary&&Pl(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,v.newName,S.ariaSummary))}).catch(S=>{n(`error when applying edits ${JSON.stringify(S,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(S)})},y=>{n("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{l.dispose()});return n("returning rename operation"),this._progressService.showWhile(_,250),_}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameInputField.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameInputField.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.source,nRenameSuggestions:n.nRenameSuggestions,wantsPreview:n.wantsPreview};this._telemetryService.publicLog2("renameInvokedEvent",r)}};Vp.ID="editor.contrib.renameController";Vp=jK=NNt([_m(1,Wt),_m(2,zr),_m(3,NT),_m(4,P_),_m(5,Ra),_m(6,AY),_m(7,yt),_m(8,ia)],Vp);class MNt extends pt{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Re.and(K.writable,K.hasRenameProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(jn),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Ft.isUri(r)&&le.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},nn):super.runCommand(e,t)}run(e,t){const n=e.get(Ra),r=Vp.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}Kn(Vp.ID,Vp,4);Ke(MNt);const lJ=zo.bindToContribution(Vp.get);st(new lJ({id:"acceptRenameInput",precondition:dx,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:3}}));st(new lJ({id:"acceptRenameInputWithPreview",precondition:Re.and(dx,Re.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:1024+3}}));st(new lJ({id:"cancelRenameInput",precondition:dx,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:K.focus,primary:9,secondary:[1033]}}));ki(class extends dl{constructor(){super({id:"focusNextRenameSuggestion",title:{...Hn("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:dx,keybinding:[{primary:2,secondary:[18],weight:100+99}]})}run(e){const t=e.get(jn).getFocusedCodeEditor();if(!t)return;const n=Vp.get(t);n&&n.focusNextRenameSuggestion()}});ki(class extends dl{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Hn("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:dx,keybinding:[{when:zK,primary:6,weight:100+99},{when:zK.toNegated(),primary:1026,secondary:[16],weight:100+99}]})}run(e){const t=e.get(jn).getFocusedCodeEditor();if(!t)return;const n=Vp.get(t);n&&n.focusPreviousRenameSuggestion()}});rg("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Yn(typeof r=="string");const{renameProvider:o}=i.get(yt);return RNt(o,e,t,r)});rg("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(yt),o=await new aJ(e,t,n).resolveRenameLocation(wn.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});ur.as(Rh.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function PNt(i){for(let e=0,t=i.length;e0?t[0]:[]}async function gDe(i,e,t,n,r){const o=BNt(i,e),s=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!hB(l)&&!hDe(l))&&(l=null),new FNt(a,l,c)}));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null}function WNt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class $Nt{constructor(e,t){this.provider=e,this.tokens=t}}function HNt(i,e){return i.has(e)}function pDe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function cJ(i,e,t,n){const r=pDe(i,e),o=await Promise.all(r.map(async s=>{let a;try{a=await s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){eo(l),a=null}return(!a||!hB(a))&&(a=null),new $Nt(s,a)}));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null}kn.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Yn(t instanceof Ft);const n=i.get(rr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(yt),o=WNt(r,n);return o?o[0].getLegend():i.get(cr).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});kn.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Yn(t instanceof Ft);const n=i.get(rr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(yt);if(!fDe(r,n))return i.get(cr).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const o=await gDe(r,n,null,null,wn.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!hB(a))return;const l=dDe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l});kn.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Yn(t instanceof Ft);const r=i.get(rr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(yt),s=pDe(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!W.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=await cJ(o,r,W.lift(n),wn.None);if(a)return a.provider.getLegend()});kn.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Yn(t instanceof Ft),Yn(W.isIRange(n));const r=i.get(rr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(yt),s=await cJ(o,r,W.lift(n),wn.None);if(!(!s||!s.tokens))return dDe({id:0,type:"full",data:s.tokens.data})});const uJ="editor.semanticHighlighting";function vP(i,e,t){var n;const r=(n=t.getValue(uJ,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var mDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},df=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},km;let KK=class extends me{constructor(e,t,n,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new Ik(u,e,n,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];vP(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{vP(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{vP(u,n,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(uJ)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};KK=mDe([df(0,j3),df(1,rr),df(2,Mo),df(3,mn),df(4,_u),df(5,yt)],KK);let Ik=km=class extends me{constructor(e,t,n,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:km.REQUEST_MIN_DELAY,max:km.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new mi(()=>this._fetchDocumentSemanticTokensNow(),km.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const s=()=>{si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!fDe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new xr,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=gDe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Fs(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(Th(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||nn(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,o){o=Math.min(o,n.length-r,e.length-t);for(let s=0;s{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(hDe(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(km._copy(l,u-g,c,d-g,g),d-=g),f.data&&(km._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&km._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(hB(t)){this._currentDocumentResponse=new VNt(e,t.resultId,t.data);const a=zwe(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};Ik.REQUEST_MIN_DELAY=300;Ik.REQUEST_MAX_DELAY=2e3;Ik=km=mDe([df(1,j3),df(2,Mo),df(3,_u),df(4,yt)],Ik);class VNt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}BT(KK);var zNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},kL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let kk=class extends me{constructor(e,t,n,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new mi(()=>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(uJ)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=No(s=>Promise.resolve(cJ(this._provider,e,t,s))),o=new Fs(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,zwe(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};kk.ID="editor.contrib.viewportSemanticTokens";kk=zNt([kL(1,j3),kL(2,Mo),kL(3,mn),kL(4,_u),kL(5,yt)],kk);Kn(kk.ID,kk,1);class UNt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:o,startColumn:s}=r,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Zm(d)&&af(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new W(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var jNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KNt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},GK;class dJ{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 n=new dJ(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let DS=GK=class{static get(e){return e.getContribution(GK.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await _De(this._languageFeaturesService.selectionRangeProvider,n,t.map(o=>o.getPosition()),this._editor.getOption(113),wn.None).then(o=>{var s;if(!(!Ms(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!lr(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new dJ(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>Et.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};DS.ID="editor.contrib.smartSelectController";DS=GK=jNt([KNt(1,yt)],DS);class vDe extends pt{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=DS.get(t);n&&await n.run(this._forward)}}class GNt extends vDe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}kn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class qNt extends vDe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Kn(DS.ID,DS,4);Ke(GNt);Ke(qNt);async function _De(i,e,t,n,r){const o=i.all(e).concat(new UNt(n.selectSubwords));o.length===1&&o.unshift(new Jl);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Ms(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>le.isBefore(h.getStartPosition(),f.getStartPosition())?1:le.isBefore(f.getStartPosition(),h.getStartPosition())||le.isBefore(h.getEndPosition(),f.getEndPosition())?-1:le.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||W.containsRange(h,u)&&!W.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),sW="data-sticky-line-index",Dhe="data-sticky-is-line",YNt="data-sticky-is-line-number",Ihe="data-sticky-is-folding-icon";class ZNt extends me{constructor(e){super(),this._editor=e,this._foldingIconStore=new Fe,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 d_),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(115).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(115)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{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,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),o=r?void 0:e,s=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(o,t,s),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 n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}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 n=this._previousState,r=e.startLineNumbers.findIndex(o=>!n.startLineNumbers.includes(o));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;ta.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(110)==="mouseover"&&(this._foldingIconStore.add(xe(this._lineNumbersDomNode,Je.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(xe(this._lineNumbersDomNode,Je.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new le(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(68);let c;try{c=wa.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new R_(!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 KS(2e3),h=bT(u,d);let f;Ehe?f=Ehe.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(sW,String(e)),g.setAttribute(Dhe,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(sW,String(e)),p.setAttribute(YNt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=r.contentLeft;p.style.width=`${m}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`,p.appendChild(v);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(v),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new QNt(e,t,g,p,_,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(110);if(!e||n==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new JNt(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Ihe,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=XY(t.characterMapping,e,0);return new le(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n: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,sW);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Dhe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Ihe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class QNt{constructor(e,t,n,r,o,s,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=a}}class JNt{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=Vt.asClassName(e?G5:K5)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class dD{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class DF{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class bDe{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var fB=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Tk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hD;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(hD||(hD={}));var dv;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(dv||(dv={}));let qK=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new ad(300)),this._updateOperation=this._register(new Fe);const o=new XK(n),s=new ZK(this._editor,n),a=new YK(this._editor,t);switch(r){case hD.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case hD.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case hD.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,n){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,n);this._modelPromise=s;const a=await o;if(this._modelPromise!==s)return null;switch(a){case dv.CANCELED:return this._updateOperation.clear(),null;case dv.VALID:return r.stickyModel}}return null}).catch(r=>(nn(r),null))}};qK=fB([Tk(1,Ti),Tk(2,yt)],qK);class CDe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,dv.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=No(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?n.isCancellationRequested?dv.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,o),dv.VALID):this._invalid()).then(void 0,o=>(nn(o),dv.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let XK=class extends CDe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return Hg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new bDe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(In.first(e.children.values())instanceof HEe){const a=In.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],o=Array.from(n.values()).sort((a,l)=>{const c=new dD(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new dD(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new DF(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())n.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));n.sort((o,s)=>this._comparator(o.range,s.range));const r=new dD(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new DF(r,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof vK?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};XK=fB([Tk(0,yt)],XK);class yDe extends CDe{constructor(e){super(),this._foldingLimitReporter=new BEe(e)}createStickyModel(e,t,n,r){const o=this._fromFoldingRegions(r);return new bDe(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new DF(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,n){const r=Jf.getFoldingRangeProviders(this._languageFeaturesService,e);return new YQ(e,r,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};ZK=fB([Tk(1,yt)],ZK);var eRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},khe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class tRt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let QK=class extends me{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new ae),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Fe),this._updateSoon=this._register(new mi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(115)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(115),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new qK(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new xr,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=this._editor.getModel(),n=t.getVersionId(),r=await this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=r)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;uu-d)),c=this.updateIndex(JD(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new tRt(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,o)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};QK=eRt([khe(1,yt),khe(2,Ti)],QK);var nRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},T1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},JK;let eg=JK=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new Fe,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new ZNt(this._editor),this._stickyLineCandidateProvider=new QK(this._editor,n,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Lhe([],[],0),this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(115)||u.hasChanged(73)||u.hasChanged(67)||u.hasChanged(110))&&this._readConfiguration()})),this._register(xe(l,Je.CONTEXT_MENU,async u=>{this._onContextMenu(Bt(l),u)})),this._stickyScrollFocusedContextKey=K.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=K.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(ph(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(xe(l,Je.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(JK.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Fe,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&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(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Fe),t=this._register(new M5(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),n=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(Lr(r,Je.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new le(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new le(c,1)}this._revealPosition(l)})),this._register(Lr(r,Je.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(xe(r,Je.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=n(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new xr;e.add(Ot(()=>u.dispose(!0)));let d;W5(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new le(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Ot(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Ot(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(QEe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new Gu(e,t);this._contextMenuService.showContextMenu({menuId:H.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;MEe(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(115);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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=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){var t,n;const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(n=await((t=Jf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(115).maxLineCount),n=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new dD(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,m=this._editor.getBottomForLineNumber(d)-n,v=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>v&&g<=_){o.push(d),s.push(h+1),r=_-p;break}else p>m&&p<=_&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new Lhe(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};eg.ID="store.contrib.stickyScrollController";eg=JK=nRt([T1(1,$l),T1(2,yt),T1(3,Wt),T1(4,Ti),T1(5,_u),T1(6,Gt)],eg);class iRt extends dl{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Hn("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},category:XNt.View,toggled:{condition:Re.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:H.CommandPalette},{id:H.MenubarAppearanceMenu,group:"4_editor",order:3},{id:H.StickyScrollContext}]})}async run(e){const t=e.get(mn),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const gB=100;class rRt extends Nh{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Hn("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:Re.and(Re.has("config.editor.stickyScroll.enabled"),K.stickyScrollVisible),menu:[{id:H.CommandPalette}]})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focus()}}class oRt extends Nh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Hn("selectNextStickyScrollLine.title","Select next sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:18}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focusNext()}}class sRt extends Nh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Hn("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:16}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focusPrevious()}}class aRt extends Nh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Hn("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:3}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.goToFocused()}}class lRt extends Nh{constructor(){super({id:"editor.action.selectEditor",title:Hn("selectEditor.title","Select Editor"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:9}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.selectEditor()}}Kn(eg.ID,eg,1);ki(iRt);ki(rRt);ki(sRt);ki(oRt);ki(aRt);ki(lRt);var wDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},uE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class cRt{constructor(e,t,n,r,o,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=o,this.completion=s}}let eG=class extends wit{constructor(e,t,n,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(wn.None)}return t}};eG=wDe([uE(5,Q5)],eG);let tG=class extends me{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var o;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const a=s.getOption(89);if(Ny.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),c=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Ny.valueFor(a,c)!=="inline")return;let u=e.getWordAtPosition(t),d;if(u!=null&&u.word||(d=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!d||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let h;const f=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,u))){const g=new bhe(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await QQ(this._languageFeatureService.completionProvider,e,t,new bk(void 0,SF.createSuggestFilter(s).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new Um(g.items,t.column,new bhe(f,0),jd.None,s.getOption(118),s.getOption(112),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new eG(e,t.lineNumber,u,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(wn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const r=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};tG=wDe([uE(0,yt),uE(1,Zp),uE(2,Q5),uE(3,jn)],tG);BT(tG);class uRt extends pt{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new Fs;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Ke(uRt);class pB extends dl{constructor(){super({id:pB.ID,title:Hn({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},f1:!0})}run(){const t=!Qw.getTabFocusMode();Qw.setTabFocusMode(t),Pl(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}pB.ID="editor.action.toggleTabFocusMode";ki(pB);var dRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hRt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nG=class extends me{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,n={},r){var o;super(),this._link=t,this._enabled=!0,this.el=Oe(e,Xe("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=ot.chain(a.event,d=>d.map(h=>new Oi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Ei.Tap)).event;this._register(Li.addTarget(this.el));const u=ot.any(s.event,l,c);this._register(u(d=>{this.enabled&&(gn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};nG=dRt([hRt(3,hl)],nG);var SDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xDe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fRt=26;let iG=class extends me{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(rG))}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===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,fRt)}};iG=SDe([xDe(1,Wt)],iG);let rG=class extends me{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(qf,{}),this.element=Xe("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=Xe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ps(this.element)}show(e){Ps(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Oe(this.element,Xe("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(Xe(`div${Vt.asCSSSelector(e.icon)}`));const r=Oe(this.element,Xe("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Oe(this.element,Xe("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(nG,this.messageActionsContainer,{...s,tabIndex:-1},{}));const o=Oe(this.element,Xe("div.action-container"));this.actionBar=this._register(new du(o)),this.actionBar.push(this._register(new Il("banner.close","Close Banner",Vt.asClassName(txe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};rG=SDe([xDe(0,Wt)],rG);var hJ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cw=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const gRt=Or("extensions-warning-message",tt.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));let IS=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new fx};else if(o.ambiguousCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new H_};else if(o.invisibleCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new hx};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:gRt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(iG,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(125),this._register(n.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._options=e.getOption(125),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=pRt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?wnt:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new oG(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new mRt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};IS.ID="editor.contrib.unicodeHighlighter";IS=hJ([Cw(1,vd),Cw(2,uSe),Cw(3,Wt)],IS);function pRt(i,e){return{nonBasicASCII:e.nonBasicASCII===Yl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Yl?!i:e.includeComments,includeStrings:e.includeStrings===Yl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let oG=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new mi(()=>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 n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:IF.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!mZ(t,e))return null;const n=t.getValueInRange(e.range);return{reason:EDe(n,this._options),inComment:vZ(t,e),inString:_Z(t,e)}}};oG=hJ([Cw(3,vd)],oG);class mRt extends me{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new mi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=TY.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||o.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:IF.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return mZ(t,e)?{reason:EDe(n,this._options),inComment:vZ(t,e),inString:_Z(t,e)}:null}}const LDe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let sG=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(IS.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=aW(d);let f;switch(c.reason.kind){case 0:{hT(c.reason.confusableWith)?f=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,aW(c.reason.confusableWith.codePointAt(0))):f=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,aW(c.reason.confusableWith.codePointAt(0)));break}case 1:f=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=w("unicodeHighlight.adjustSettings","Adjust settings"),m=`command:${JT.ID}?${encodeURIComponent(JSON.stringify(g))}`,v=new Ns("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,LDe);o.push(new qd(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return cEe(e,t,this._editor,this._languageService,this._openerService)}};sG=hJ([Cw(1,qi),Cw(2,hl)],sG);function aG(i){return`U+${i.toString(16).padStart(4,"0")}`}function aW(i){let e=`\`${aG(i)}\``;return Of.isInvisibleCharacter(i)||(e+=` "${`${vRt(i)}`}"`),e}function vRt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function EDe(i,e){return TY.computeUnicodeHighlightReason(i,e)}class IF{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=an.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}}IF.instance=new IF;class _Rt extends pt{constructor(){super({id:H_.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.includeComments,!1,2)}}class bRt extends pt{constructor(){super({id:H_.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.includeStrings,!1,2)}}class H_ extends pt{constructor(){super({id:H_.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.ambiguousCharacters,!1,2)}}H_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class hx extends pt{constructor(){super({id:hx.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.invisibleCharacters,!1,2)}}hx.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class fx extends pt{constructor(){super({id:fx.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.nonBasicASCII,!1,2)}}fx.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class JT extends pt{constructor(){super({id:JT.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:o,inString:s,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Ph),u=e.get(mn);function d(g){return Of.isInvisibleCharacter(g)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",aG(g)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${aG(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{yRt(u,[g])}});if(h.push({label:d(r),run:()=>CRt(u,[r])}),a){const g=new _Rt;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s){const g=new bRt;h.push({label:g.label,run:async()=>g.runAction(u)})}if(o.kind===0){const g=new H_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===1){const g=new hx;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===2){const g=new fx;h.push({label:g.label,run:async()=>g.runAction(u)})}else wRt(o);const f=await c.pick(h,{title:LDe});f&&await f.run()}}JT.ID="editor.action.unicodeHighlight.showExcludeOptions";async function CRt(i,e){const t=i.getValue(Za.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(Za.allowedCharacters,n,2)}async function yRt(i,e){var t;const n=(t=i.inspect(Za.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof n=="object"&&n?r=Object.assign({},n):r={};for(const o of e)r[o]=!0;await i.updateValue(Za.allowedLocales,r,2)}function wRt(i){throw new Error(`Unexpected value: ${i}`)}Ke(H_);Ke(hx);Ke(fx);Ke(JT);Kn(IS.ID,IS,1);W_.register(sG);var SRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},The=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const DDe="ignoreUnusualLineTerminators";function xRt(i,e,t){i.setModelProperty(e.uri,DDe,t)}function LRt(i,e){return i.getModelProperty(e.uri,DDe)}let Nk=class extends me{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(126),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._config=this._editor.getOption(126),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()||LRt(this._codeEditorService,e)===!0||this._editor.getOption(91))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("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`.",uu(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){xRt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};Nk.ID="editor.contrib.unusualLineTerminatorsDetector";Nk=SRt([The(1,kT),The(2,jn)],Nk);Kn(Nk.ID,Nk,1);var IDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mo,lG;const mB=new ct("hasWordHighlights",!1);function kDe(i,e,t,n){const r=i.ordered(e);return mY(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,n)).then(void 0,eo)),Ms).then(o=>{if(o){const s=new Mr;return s.set(e.uri,o),s}return new Mr})}function ERt(i,e,t,n,r,o){const s=i.ordered(e);return mY(s.map(a=>()=>{const l=o.filter(c=>uye(c)).filter(c=>wZ(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,eo)}),a=>a instanceof Mr&&a.size>0)}class fJ{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=No(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new W(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class DRt extends fJ{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return kDe(this._providers,e,t.getPosition(),r).then(o=>o||new Mr)}}class IRt extends fJ{constructor(e,t,n,r,o){super(e,t,n),this._providers=r,this._otherModels=o}_compute(e,t,n,r){return ERt(this._providers,e,t.getPosition(),n,r,this._otherModels).then(o=>o||new Mr)}}class TDe extends fJ{constructor(e,t,n,r,o){super(e,t,r),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=n}_compute(e,t,n,r){return Yv(250,r).then(()=>{const o=new Mr;let s;if(this._word?s=this._word:s=e.getWordAtPosition(t.getPosition()),!s)return new Mr;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const u=l.findMatches(s.word,!0,!1,!0,n,!1).map(d=>({range:d.range,kind:oI.Text}));u&&o.set(l.uri,u)}return o})}isValid(e,t,n){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,n)}}function kRt(i,e,t,n,r){return i.has(e)?new DRt(e,t,r,i):new TDe(e,t,n,r,[])}function TRt(i,e,t,n,r,o){return i.has(e)?new IRt(e,t,r,i,o):new TDe(e,t,n,r,o)}rg("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(yt),r=await kDe(n.documentHighlightProvider,e,t,wn.None);return r==null?void 0:r.get(e.uri)});let Rk=mo=class{constructor(e,t,n,r,o){this.toUnhook=new Fe,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Mr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=o,this._hasWordHighlights=mB.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(s=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(s)})),this.toUnhook.add(e.onDidFocusEditorText(s=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(s=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(s=>{!s.newModelUrl&&s.oldModelUrl?this._stopSingular():mo.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(s=>{const a=this.editor.getOption(81);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,mo.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=mo.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),mo.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const n of e){if(!n.hasModel())continue;const r=mo.storedDecorations.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),t.push(n.getModel().uri);const o=zp.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of t)mo.storedDecorations.delete(n)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==cn.vscodeNotebookCell&&((n=(t=mo.query)===null||t===void 0?void 0:t.modelInfo)===null||n===void 0?void 0:n.model.uri.scheme)!==cn.vscodeNotebookCell?(mo.query=null,this._run()):!((r=mo.query)===null||r===void 0)&&r.modelInfo&&(mo.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(){this._removeAllDecorations(),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||t===void 0?void 0:t.uri.scheme)!==cn.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===cn.vscodeNotebookCell){const o=[],s=this.codeEditorService.listCodeEditors();for(const a of s){const l=a.getModel();l&&l!==e&&l.uri.scheme===cn.vscodeNotebookCell&&o.push(l)}return o}const n=[],r=this.codeEditorService.listCodeEditors();for(const o of r){if(!CQ(o))continue;const s=o.getModel();s&&e===s.modified&&n.push(s.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const o of r){const s=o.getModel();s&&s!==e&&n.push(s)}return n}_run(){var e;let t;if(this.editor.hasTextFocus()){const r=this.editor.getSelection();if(!r||r.startLineNumber!==r.endLineNumber){mo.query=null,this._stopAll();return}const o=r.startColumn,s=r.endColumn,a=this._getWord();if(!a||a.startColumn>o||a.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=s||[],this._beginRenderDecorations())},nn)}}computeWithModel(e,t,n,r){return r.length?TRt(this.multiDocumentProviders,e,t,n,this.editor.getOption(130),r):kRt(this.providers,e,t,n,this.editor.getOption(130))}_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 e,t,n;this.renderDecorationsTimer=-1;const r=this.codeEditorService.listCodeEditors();for(const o of r){const s=zp.get(o);if(!s)continue;const a=[],l=(e=o.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const c=mo.storedDecorations.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:VTt(h.kind)});let d=[];o.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),mo.storedDecorations=mo.storedDecorations.set(l,d),a.length>0&&((t=s.wordHighlighter)===null||t===void 0||t.decorations.set(a),(n=s.wordHighlighter)===null||n===void 0||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};Rk.storedDecorations=new Mr;Rk.query=null;Rk=mo=IDe([_P(4,jn)],Rk);let zp=lG=class extends me{static get(e){return e.getContribution(lG.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Rk(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(s=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};zp.ID="editor.contrib.wordHighlighter";zp=lG=IDe([_P(1,Gt),_P(2,yt),_P(3,jn)],zp);class NDe extends pt{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=zp.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class NRt extends NDe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:mB,kbOpts:{kbExpr:K.editorTextFocus,primary:65,weight:100}})}}class RRt extends NDe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:mB,kbOpts:{kbExpr:K.editorTextFocus,primary:1089,weight:100}})}}class MRt extends pt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:mB.toNegated(),kbOpts:{kbExpr:K.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=zp.get(t);r&&r.restoreViewState(!0)}}Kn(zp.ID,zp,0);Ke(NRt);Ke(RRt);Ke(MRt);class vB extends zo{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=cu(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new le(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>$n.fromModelSelection(l))),a.length===1){const l=new le(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new Et(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Et(t.lineNumber,t.column,t.lineNumber,t.column)}}class V_ extends vB{_move(e,t,n,r){return Qn.moveWordLeft(e,t,n,r)}}class z_ extends vB{_move(e,t,n,r){return Qn.moveWordRight(e,t,n,r)}}class PRt extends V_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class ARt extends V_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class ORt extends V_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class FRt extends V_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class BRt extends V_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class WRt extends V_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class $Rt extends V_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class HRt extends V_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class VRt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class zRt extends z_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class URt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class jRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class KRt extends z_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class GRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class qRt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class XRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class _B extends zo{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(Ti);if(!t.hasModel())return;const o=cu(t.getOption(130)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ls(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class gJ extends _B{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new W(1,1,1,1)}}class pJ extends _B{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new W(r,o,r,o)}}class YRt extends gJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:K.writable})}}class ZRt extends gJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:K.writable})}}class QRt extends gJ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class JRt extends pJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:K.writable})}}class e2t extends pJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:K.writable})}}class t2t extends pJ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class n2t extends pt{constructor(){super({id:"deleteInsideWord",precondition:K.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=cu(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(r,o,l);return new ls(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}st(new PRt);st(new ARt);st(new ORt);st(new FRt);st(new BRt);st(new WRt);st(new VRt);st(new zRt);st(new URt);st(new jRt);st(new KRt);st(new GRt);st(new $Rt);st(new HRt);st(new qRt);st(new XRt);st(new YRt);st(new ZRt);st(new QRt);st(new JRt);st(new e2t);st(new t2t);Ke(n2t);class i2t extends _B{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=F3.deleteWordPartLeft(e);return n||new W(1,1,1,1)}}class r2t extends _B{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=F3.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new W(r,o,r,o)}}class RDe extends vB{_move(e,t,n,r){return F3.moveWordPartLeft(e,t,n)}}class o2t extends RDe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}kn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class s2t extends RDe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}kn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class MDe extends vB{_move(e,t,n,r){return F3.moveWordPartRight(e,t,n)}}class a2t extends MDe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class l2t extends MDe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}st(new i2t);st(new r2t);st(new o2t);st(new s2t);st(new a2t);st(new l2t);class cG extends me{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Da.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(92);t||(this.editor.isSimpleWidget?t=new Ns(w("editor.simple.readonly","Cannot edit in read-only input")):t=new Ns(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}cG.ID="editor.contrib.readOnlyMessageController";Kn(cG.ID,cG,2);var c2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Nhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let uG=class extends me{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=Vn(this,void 0);const r=_a("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=_a("_textModel.onDidChangeContent",ot.debounce(s=>this._textModel.onDidChangeContent(s),()=>{},100));this._register(Ah(async(s,a)=>{r.read(s),o.read(s);const l=a.add(new C1t),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(kCe(nu(o=>o.range.endLineNumber-o.range.startLineNumber,mp))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};uG=c2t([Nhe(1,yt),Nhe(2,ZT)],uG);ik.setBreadcrumbsSourceFactory((i,e)=>e.createInstance(uG,i));class dG extends me{constructor(e){super(),this.editor=e,this.widget=null,fh&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(91);!this.widget&&e?this.widget=new bB(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}dG.ID="editor.contrib.iPadShowKeyboard";class bB extends me{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(xe(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(xe(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return bB.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}bB.ID="editor.contrib.ShowKeyboardWidget";Kn(dG.ID,dG,3);var u2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Rhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hG;let kS=hG=class extends me{static get(e){return e.getContribution(hG.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(gr.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 CB(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};kS.ID="editor.contrib.inspectTokens";kS=hG=u2t([Rhe(1,Dc),Rhe(2,qi)],kS);class d2t extends pt{constructor(){super({id:"editor.action.inspectTokens",label:bU.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=kS.get(t);n==null||n.launch()}}function h2t(i){let e="";for(let t=0,n=i.length;tZw,tokenize:(r,o,s)=>FY(e,s),tokenizeEncoded:(r,o,s)=>k3(n,s)}}class CB extends me{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=f2t(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return CB._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dE;let kF=dE=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ur.as(DC.Quickaccess)}provide(e){const t=new Fe;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(dE.PREFIX.length));r&&r.prefix&&r.prefix!==dE.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==dE.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};kF.PREFIX="?";kF=dE=g2t([Mhe(0,Ph),Mhe(1,ci)],kF);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:kF,prefix:"",helpEntries:[{description:CU.helpQuickAccessActionLabel}]});class PDe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const r=new Fe;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Vo);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var n;const r=new Fe,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=Exe(o);if(a){let l=(n=o.saveViewState())!==null&&n!==void 0?n:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(Gv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(Ot(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&jf(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return CQ(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:pr(Gye),position:Cc.Full}}}],[s,a]=n.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class yB extends PDe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,me.None}provideWithTextEditor(e,t,n){const r=e.editor,o=new Fe;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(yB.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=Exe(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Ot(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):w("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):w("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,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:n};return r.validatePosition(o).equals(o)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}yB.PREFIX=":";var p2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},m2t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Mk=class extends yB{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=ot.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Mk=p2t([m2t(0,jn)],Mk);let mJ=class ADe extends pt{constructor(){super({id:ADe.ID,label:LO.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ph).quickAccess.show(Mk.PREFIX)}};mJ.ID="editor.action.gotoLine";Ke(mJ);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:Mk,prefix:Mk.PREFIX,helpEntries:[{description:LO.gotoLineActionLabel,commandId:mJ.ID}]});const ODe=[void 0,[]];function lW(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?v2t(i,r.values,t,n):FDe(i,e,t,n)}function v2t(i,e,t,n){let r=0;const o=[];for(const s of e){const[a,l]=FDe(i,s,t,n);if(typeof a!="number")return ODe;r+=a,o.push(...l)}return[r,_2t(o)]}function FDe(i,e,t,n){const r=Ub(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],TT(r)]:ODe}function _2t(i){const e=i.sort((r,o)=>r.start-o.start),t=[];let n;for(const r of e)!n||!b2t(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function b2t(i,e){return!(i.end=0,s=Phe(i);let a;const l=i.split(BDe);if(l.length>1)for(const c of l){const u=Phe(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=Ahe(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function Ahe(i){let e;Os?e=i.replace(/\//g,ih):e=i.replace(/\\/g,ih);const t=drt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Ohe(i){return Array.isArray(i)?fG(i.map(e=>e.original).join(BDe)):fG(i.original)}var C2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yw;let $f=yw=class extends PDe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),me.None}provideWithTextEditor(e,t,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n):this.doProvideWithoutEditorSymbols(e,o,t,n):me.None}doProvideWithoutEditorSymbols(e,t,n,r){const o=new Fe;return this.provideLabelPick(n,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),o}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 n=new s3,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Ot(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r){var o;const s=e.editor,a=new Fe;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async d=>{c==null||c.dispose(!0),n.busy=!1,c=new xr(r),n.busy=!0;try{const h=fG(n.value.substr(yw.PREFIX.length).trim()),f=await this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=fI(f,p=>!!(p.type!=="separator"&&p.range&&W.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,w("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r){var o,s;const a=await e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(yw.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=Ohe(t.values[0]),d=Ohe(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?Vt.asClassName(tt.splitHorizontal):Vt.asClassName(tt.splitVertical),tooltip:f==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const g=[];for(let v=0;vc){let N=!1;if(u!==t&&([D,k]=lW(S,{...t,values:void 0},c,L),typeof D=="number"&&(N=!0)),typeof D!="number"&&([D,k]=lW(S,u,c,L),typeof D!="number"))continue;if(!N&&d){if(E&&d.original.length>0&&([T,M]=lW(E,d)),typeof T!="number")continue;typeof D=="number"&&(D+=T)}}const P=_.tags&&_.tags.indexOf(1)>=0;g.push({index:v,kind:_.kind,score:D,label:S,ariaLabel:nrt(_.name,_.kind),description:E,highlights:P?void 0:{label:k,description:M},range:{selection:W.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:P,buttons:h})}const p=g.sort((v,_)=>l?this.compareByKindAndScore(v,_):this.compareByScore(v,_));let m=[];if(l){let S=function(){_&&typeof v=="number"&&y>0&&(_.label=Ob(uW[v]||cW,y))},v,_,y=0;for(const L of p)v!==L.kind?(S(),v=L.kind,y=1,_={type:"separator"},m.push(_)):y++,m.push(L);S()}else p.length>0&&(m=[{label:w("symbols","symbols ({0})",g.length),type:"separator"},...p]);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.scoret.index?1:0}compareByKindAndScore(e,t){const n=uW[e.kind]||cW,r=uW[t.kind]||cW,o=n.localeCompare(r);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};$f.PREFIX="@";$f.SCOPE_PREFIX=":";$f.PREFIX_BY_CATEGORY=`${yw.PREFIX}${yw.SCOPE_PREFIX}`;$f=yw=C2t([Fhe(0,yt),Fhe(1,ZT)],$f);const cW=w("property","properties ({0})"),uW={[5]:w("method","methods ({0})"),[11]:w("function","functions ({0})"),[8]:w("_constructor","constructors ({0})"),[12]:w("variable","variables ({0})"),[4]:w("class","classes ({0})"),[22]:w("struct","structs ({0})"),[23]:w("event","events ({0})"),[24]:w("operator","operators ({0})"),[10]:w("interface","interfaces ({0})"),[2]:w("namespace","namespaces ({0})"),[3]:w("package","packages ({0})"),[25]:w("typeParameter","type parameters ({0})"),[1]:w("modules","modules ({0})"),[6]:w("property","properties ({0})"),[9]:w("enum","enumerations ({0})"),[21]:w("enumMember","enumeration members ({0})"),[14]:w("string","strings ({0})"),[0]:w("file","files ({0})"),[17]:w("array","arrays ({0})"),[15]:w("number","numbers ({0})"),[16]:w("boolean","booleans ({0})"),[18]:w("object","objects ({0})"),[19]:w("key","keys ({0})"),[7]:w("field","fields ({0})"),[13]:w("constant","constants ({0})")};var y2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let gG=class extends $f{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=ot.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};gG=y2t([dW(0,jn),dW(1,yt),dW(2,ZT)],gG);class eN extends pt{constructor(){super({id:eN.ID,label:$I.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:K.hasDocumentSymbolProvider,kbOpts:{kbExpr:K.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ph).quickAccess.show($f.PREFIX,{itemActivation:Od.NONE})}}eN.ID="editor.action.quickOutline";Ke(eN);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:gG,prefix:$f.PREFIX,helpEntries:[{description:$I.quickOutlineActionLabel,prefix:$f.PREFIX,commandId:eN.ID},{description:$I.quickOutlineByCategoryActionLabel,prefix:$f.PREFIX_BY_CATEGORY}]});function hW(i,e){return e&&(i.stack||i.stacktrace)?w("stackTrace.format","{0}: {1}",Whe(i),Bhe(i.stack)||Bhe(i.stacktrace)):Whe(i)}function Bhe(i){return Array.isArray(i)?i.join(` -`):i}function Whe(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function WDe(i=null,e=!1){if(!i)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=hh(i),n=WDe(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(Ea(i))return i;if(i.detail){const t=i.detail;if(t.error)return hW(t.error,e);if(t.exception)return hW(t.exception,e)}return i.stack?hW(i,e):i.message?i.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function w2t(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class fD{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return w2t(fD.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const r=[];for(const o of n.textChunks){const s=fD.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(n.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=n.get(o);typeof l!="number"&&(l=this.computeIdf(o),n.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=fD.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const o=this.computeIdf(n);o>0&&(t[n]=r*o)}return t}}function S2t(i){var e,t;const n=i.slice(0);n.sort((o,s)=>s.score-o.score);const r=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of n)o.score/=r;return n}var Ry;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(Ry||(Ry={}));function fW(i){const e=i;return Array.isArray(e.items)}function $he(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class x2t extends me{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var r;const o=new Fe;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Vo),l=async()=>{var c;const u=a.value=new Fe;s==null||s.dispose(!0),e.busy=!1,s=new xr(t);const d=s.token;let h=e.value.substring(this.prefix.length);!((c=this.options)===null||c===void 0)&&c.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(m,v)=>{var _;let y,S;if(fW(m)?(y=m.items,S=m.active):y=m,y.length===0){if(v)return!1;(h.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(tI(this.options.noResultsPick)?y=[this.options.noResultsPick(h)]:y=[this.options.noResultsPick])}return e.items=y,S&&(e.activeItems=[S]),!0},p=async m=>{let v=!1,_=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Yv(m.mergeDelay),d.isCancellationRequested)||_||(v=g(m.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await m.additionalPicks;if(d.isCancellationRequested)return;let S,L;fW(m.picks)?(S=m.picks.items,L=m.picks.active):S=m.picks;let E,D;if(fW(y)?(E=y.items,D=y.active):E=y,E.length>0||!v){let k;if(!L&&!D){const T=e.activeItems[0];T&&S.indexOf(T)!==-1&&(k=T)}g({items:[...S,...E],active:L||D||k})}}finally{d.isCancellationRequested||(e.busy=!1),_=!0}})()])};if(f!==null)if($he(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const m=await f;if(d.isCancellationRequested)return;$he(m)?await p(m):g(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(async({button:c,item:u})=>{var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case Ry.NO_ACTION:break;case Ry.CLOSE_PICKER:e.hide();break;case Ry.REFRESH_PICKER:l();break;case Ry.REMOVE_ITEM:{const m=e.items.indexOf(u);if(m!==-1){const v=e.items.slice(),_=v.splice(m,1),y=e.activeItems.filter(L=>L!==_[0]),S=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=S}break}}}}})),o}}var $De=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},O0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},S0,ro;let uC=S0=class extends x2t{constructor(e,t,n,r,o,s){super(S0.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(y_)),this.options=e}async _getPicks(e,t,n,r){var o,s,a,l;const c=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=Gv(()=>{const v=new fD;v.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));const _=v.calculateScores(e,n);return S2t(_).filter(y=>y.score>S0.TFIDF_THRESHOLD).slice(0,S0.TFIDF_MAX_RESULTS)}),d=[];for(const v of c){const _=(o=S0.WORD_FILTER(e,v.label))!==null&&o!==void 0?o:void 0,y=v.commandAlias&&(s=S0.WORD_FILTER(e,v.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)v.highlights={label:_,detail:this.options.showAlias?y:void 0},d.push(v);else if(e===v.commandId)d.push(v);else if(e.length>=3){const S=u();if(n.isCancellationRequested)return[];const L=S.find(E=>E.key===v.commandId);L&&(v.tfIdfScore=L.score,d.push(v))}}const h=new Map;for(const v of d){const _=h.get(v.label);_?(v.description=v.commandId,_.description=_.commandId):h.set(v.label,v)}d.sort((v,_)=>{if(v.tfIdfScore&&_.tfIdfScore)return v.tfIdfScore===_.tfIdfScore?v.label.localeCompare(_.label):_.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(v.commandId),S=this.commandsHistory.peek(_.commandId);if(y&&S)return y>S?-1:1;if(y)return-1;if(S)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(v.commandId),E=this.options.suggestedCommandIds.has(_.commandId);if(L&&E)return 0;if(L)return-1;if(E)return 1}return v.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,m=!!this.options.suggestedCommandIds;for(let v=0;v{var v;const _=await this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const y=_.map(S=>this.toCommandPick(S,r));return p&&((v=y[0])===null||v===void 0?void 0:v.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:f}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){Th(a)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),WDe(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};uC.PREFIX=">";uC.TFIDF_THRESHOLD=.5;uC.TFIDF_MAX_RESULTS=5;uC.WORD_FILTER=EZ(BI,Wmt,Zwe);uC=S0=$De([O0(1,Wt),O0(2,ci),O0(3,cr),O0(4,ia),O0(5,kT)],uC);let y_=ro=class extends me{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===UI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=ro.getConfiguredCommandHistoryLength(this.configurationService),ro.cache&&ro.cache.limit!==this.configuredCommandsHistoryLength&&(ro.cache.limit=this.configuredCommandsHistoryLength,ro.hasChanges=!0))}load(){const e=this.storageService.get(ro.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=ro.cache=new N_(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>n.set(o.key,o.value))}ro.counter=this.storageService.getNumber(ro.PREF_KEY_COUNTER,0,ro.counter)}push(e){ro.cache&&(ro.cache.set(e,ro.counter++),ro.hasChanges=!0)}peek(e){var t;return(t=ro.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!ro.cache||!ro.hasChanges)return;const e={usesLRU:!0,entries:[]};ro.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(ro.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(ro.PREF_KEY_COUNTER,ro.counter,0,0),ro.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,n;const o=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof o=="number"?o:ro.DEFAULT_COMMANDS_HISTORY_LENGTH}};y_.DEFAULT_COMMANDS_HISTORY_LENGTH=50;y_.PREF_KEY_CACHE="commandPalette.mru.cache";y_.PREF_KEY_COUNTER="commandPalette.mru.counter";y_.counter=1;y_.hasChanges=!1;y_=ro=$De([O0(0,md),O0(1,mn)],y_);class L2t extends uC{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:RZ(n.label)||n.id});return t}}var E2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Pk=class extends L2t{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,r,o,s){super({showAlias:!1},e,n,r,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Pk=E2t([N1(0,Wt),N1(1,jn),N1(2,ci),N1(3,cr),N1(4,ia),N1(5,kT)],Pk);class tN extends pt{constructor(){super({id:tN.ID,label:EO.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ph).quickAccess.show(Pk.PREFIX)}}tN.ID="editor.action.quickCommand";Ke(tN);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:Pk,prefix:Pk.PREFIX,helpEntries:[{description:EO.quickCommandHelp,commandId:tN.ID}]});var D2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let pG=class extends f_{constructor(e,t,n,r,o,s,a){super(!0,e,t,n,r,o,s,a)}};pG=D2t([R1(1,Gt),R1(2,jn),R1(3,zr),R1(4,Wt),R1(5,md),R1(6,mn)],pG);Kn(f_.ID,pG,4);class I2t extends pt{constructor(){super({id:"editor.action.toggleHighContrast",label:yU.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Dc),r=n.getColorTheme();sh(r.type)?(n.setTheme(this._originalThemeName||(tS(r.type)?pw:Gg)),this._originalThemeName=null):(n.setTheme(tS(r.type)?vb:_b),this._originalThemeName=r.themeName)}}Ke(I2t);const k2t=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Txe,Emitter:yQ,KeyCode:Nxe,KeyMod:Rxe,MarkerSeverity:Fxe,MarkerTag:Bxe,Position:Mxe,Range:Pxe,Selection:Axe,SelectionDirection:Oxe,Token:$xe,Uri:Wxe,editor:Hxe,languages:VT},Symbol.toStringTag,{value:"Module"}));function T2t(){return new Worker("/ir-virtual-machine/assets/editor.worker-3daf6cbf.js")}function N2t(){return new Worker("/ir-virtual-machine/assets/json.worker-4a7a65e0.js")}function R2t(){return new Worker("/ir-virtual-machine/assets/css.worker-4b5427ce.js")}function M2t(){return new Worker("/ir-virtual-machine/assets/html.worker-85cb56ae.js")}function P2t(){return new Worker("/ir-virtual-machine/assets/ts.worker-3bc0f4a5.js")}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new N2t:e==="css"||e==="scss"||e==="less"?new R2t:e==="html"||e==="handlebars"||e==="razor"?new M2t:e==="typescript"||e==="javascript"?new P2t:new T2t}};t3.config({monaco:k2t});t3.init();const A2t=()=>{const i=Yr(t=>t.locale.currentLocale),e=Yr(t=>t.theme.currentClassName);return C.useEffect(()=>{document.body.className=e},[e]),ze($3e,{messages:i,locale:"en",children:ze(d4e,{router:nnt})})},O2t=xQe({reducer:{locale:aJe,theme:uJe,vm:jQe}});gW.createRoot(document.getElementById("root")).render(ze(qe.StrictMode,{children:ze(ZOe,{store:O2t,children:ze(A2t,{})})}));export{w5 as m,oLe as t}; +`)};const s=await o.provideRenameEdits(this.model,this.position,e,r);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),r)}else return this._provideRenameEdits(e,t+1,n.concat(w("no result","No result.")),r);return s}}async function RNt(i,e,t,n){const r=new aJ(e,t,i),o=await r.resolveRenameLocation(wn.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(n,wn.None)}let Vp=jK=class{static get(e){return e.getContribution(jK.ID)}constructor(e,t,n,r,o,s,a,l,c){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=r,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new Fe,this._cts=new xr,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(UK,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;const n=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new xr,!this.editor.hasModel()){n("editor has no model");return}const r=this.editor.getPosition(),o=new aJ(this.editor.getModel(),r,this._languageFeaturesService.renameProvider);if(!o.hasProvider()){n("skeleton has no provider");return}const s=new c_(this.editor,5,void 0,this._cts.token);let a;try{n("resolving rename location");const y=o.resolveRenameLocation(s.token);this._progressService.showWhile(y,250),a=await y,n("resolved rename location")}catch(y){n("resolve rename location failed",JSON.stringify(y,null," ")),(e=Da.get(this.editor))===null||e===void 0||e.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),r);return}finally{s.dispose()}if(!a){n("returning early - no loc");return}if(a.rejectReason){n(`returning early - rejected with reason: ${a.rejectReason}`,a.rejectReason),(t=Da.get(this.editor))===null||t===void 0||t.showMessage(a.rejectReason,r);return}if(s.token.isCancellationRequested){n("returning early - cts1 cancelled");return}const l=new c_(this.editor,5,a.range,this._cts.token),c=this.editor.getModel(),u=new xr(l.token),d=this._languageFeaturesService.newSymbolNamesProvider.all(c),h=d.map(y=>y.provideNewSymbolNames(c,a.range,u.token));n(`requested new symbol names from ${d.length} providers`);const f=this.editor.getSelection();let g=0,p=a.text.length;!W.isEmpty(f)&&!W.spansMultipleLines(f)&&W.containsRange(a.range,f)&&(g=Math.max(0,f.startColumn-a.range.startColumn),p=Math.min(a.range.endColumn,f.endColumn)-a.range.startColumn),n("creating rename input field and awaiting its result");const m=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),v=await this._renameInputField.getInput(a.range,a.text,g,p,m,h,u);if(n("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,c.getLanguageId(),v),typeof v=="boolean"){n(`returning early - rename input field response - ${v}`),v&&this.editor.focus(),l.dispose();return}this.editor.focus(),n("requesting rename edits");const _=gT(o.provideRenameEdits(v.newName,l.token),l.token).then(async y=>{if(!y){n("returning early - no rename edits result");return}if(!this.editor.hasModel()){n("returning early - no model after rename edits are provided");return}if(y.rejectReason){n(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),n("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:v.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,v.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,v.newName),respectAutoSaveConfig:!0}).then(S=>{n("edits applied"),S.ariaSummary&&Pl(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,v.newName,S.ariaSummary))}).catch(S=>{n(`error when applying edits ${JSON.stringify(S,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(S)})},y=>{n("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{l.dispose()});return n("returning rename operation"),this._progressService.showWhile(_,250),_}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameInputField.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameInputField.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.source,nRenameSuggestions:n.nRenameSuggestions,wantsPreview:n.wantsPreview};this._telemetryService.publicLog2("renameInvokedEvent",r)}};Vp.ID="editor.contrib.renameController";Vp=jK=NNt([_m(1,Wt),_m(2,zr),_m(3,NT),_m(4,A_),_m(5,Ra),_m(6,AY),_m(7,yt),_m(8,ia)],Vp);class MNt extends pt{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Re.and(K.writable,K.hasRenameProvider),kbOpts:{kbExpr:K.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(jn),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Ft.isUri(r)&&le.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},nn):super.runCommand(e,t)}run(e,t){const n=e.get(Ra),r=Vp.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}Kn(Vp.ID,Vp,4);Ke(MNt);const lJ=zo.bindToContribution(Vp.get);st(new lJ({id:"acceptRenameInput",precondition:dx,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:3}}));st(new lJ({id:"acceptRenameInputWithPreview",precondition:Re.and(dx,Re.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Re.and(K.focus,Re.not("isComposing")),primary:1024+3}}));st(new lJ({id:"cancelRenameInput",precondition:dx,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:K.focus,primary:9,secondary:[1033]}}));ki(class extends dl{constructor(){super({id:"focusNextRenameSuggestion",title:{...Hn("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:dx,keybinding:[{primary:2,secondary:[18],weight:100+99}]})}run(e){const t=e.get(jn).getFocusedCodeEditor();if(!t)return;const n=Vp.get(t);n&&n.focusNextRenameSuggestion()}});ki(class extends dl{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Hn("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:dx,keybinding:[{when:zK,primary:6,weight:100+99},{when:zK.toNegated(),primary:1026,secondary:[16],weight:100+99}]})}run(e){const t=e.get(jn).getFocusedCodeEditor();if(!t)return;const n=Vp.get(t);n&&n.focusPreviousRenameSuggestion()}});rg("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Yn(typeof r=="string");const{renameProvider:o}=i.get(yt);return RNt(o,e,t,r)});rg("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(yt),o=await new aJ(e,t,n).resolveRenameLocation(wn.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});ur.as(Rh.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function PNt(i){for(let e=0,t=i.length;e0?t[0]:[]}async function gDe(i,e,t,n,r){const o=BNt(i,e),s=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!hB(l)&&!hDe(l))&&(l=null),new FNt(a,l,c)}));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null}function WNt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class $Nt{constructor(e,t){this.provider=e,this.tokens=t}}function HNt(i,e){return i.has(e)}function pDe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function cJ(i,e,t,n){const r=pDe(i,e),o=await Promise.all(r.map(async s=>{let a;try{a=await s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){eo(l),a=null}return(!a||!hB(a))&&(a=null),new $Nt(s,a)}));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null}kn.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Yn(t instanceof Ft);const n=i.get(or).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(yt),o=WNt(r,n);return o?o[0].getLegend():i.get(cr).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});kn.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Yn(t instanceof Ft);const n=i.get(or).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(yt);if(!fDe(r,n))return i.get(cr).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const o=await gDe(r,n,null,null,wn.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!hB(a))return;const l=dDe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l});kn.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Yn(t instanceof Ft);const r=i.get(or).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(yt),s=pDe(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!W.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=await cJ(o,r,W.lift(n),wn.None);if(a)return a.provider.getLegend()});kn.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Yn(t instanceof Ft),Yn(W.isIRange(n));const r=i.get(or).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(yt),s=await cJ(o,r,W.lift(n),wn.None);if(!(!s||!s.tokens))return dDe({id:0,type:"full",data:s.tokens.data})});const uJ="editor.semanticHighlighting";function vP(i,e,t){var n;const r=(n=t.getValue(uJ,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var mDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},df=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},km;let KK=class extends me{constructor(e,t,n,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new Ik(u,e,n,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];vP(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{vP(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{vP(u,n,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(uJ)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};KK=mDe([df(0,j3),df(1,or),df(2,Mo),df(3,mn),df(4,_u),df(5,yt)],KK);let Ik=km=class extends me{constructor(e,t,n,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:km.REQUEST_MIN_DELAY,max:km.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new mi(()=>this._fetchDocumentSemanticTokensNow(),km.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const s=()=>{si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!fDe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new xr,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=gDe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Fs(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(Th(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||nn(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,o){o=Math.min(o,n.length-r,e.length-t);for(let s=0;s{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(hDe(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(km._copy(l,u-g,c,d-g,g),d-=g),f.data&&(km._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&km._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(hB(t)){this._currentDocumentResponse=new VNt(e,t.resultId,t.data);const a=zwe(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};Ik.REQUEST_MIN_DELAY=300;Ik.REQUEST_MAX_DELAY=2e3;Ik=km=mDe([df(1,j3),df(2,Mo),df(3,_u),df(4,yt)],Ik);class VNt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}BT(KK);var zNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},kL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let kk=class extends me{constructor(e,t,n,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new mi(()=>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(uJ)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=No(s=>Promise.resolve(cJ(this._provider,e,t,s))),o=new Fs(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,zwe(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};kk.ID="editor.contrib.viewportSemanticTokens";kk=zNt([kL(1,j3),kL(2,Mo),kL(3,mn),kL(4,_u),kL(5,yt)],kk);Kn(kk.ID,kk,1);class UNt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:o,startColumn:s}=r,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Zm(d)&&af(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new W(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var jNt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KNt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},GK;class dJ{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 n=new dJ(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let DS=GK=class{static get(e){return e.getContribution(GK.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await _De(this._languageFeaturesService.selectionRangeProvider,n,t.map(o=>o.getPosition()),this._editor.getOption(113),wn.None).then(o=>{var s;if(!(!Ms(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!lr(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new dJ(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>Et.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};DS.ID="editor.contrib.smartSelectController";DS=GK=jNt([KNt(1,yt)],DS);class vDe extends pt{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=DS.get(t);n&&await n.run(this._forward)}}class GNt extends vDe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}kn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class qNt extends vDe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:H.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Kn(DS.ID,DS,4);Ke(GNt);Ke(qNt);async function _De(i,e,t,n,r){const o=i.all(e).concat(new UNt(n.selectSubwords));o.length===1&&o.unshift(new Jl);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Ms(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>le.isBefore(h.getStartPosition(),f.getStartPosition())?1:le.isBefore(f.getStartPosition(),h.getStartPosition())||le.isBefore(h.getEndPosition(),f.getEndPosition())?-1:le.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||W.containsRange(h,u)&&!W.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),sW="data-sticky-line-index",Dhe="data-sticky-is-line",YNt="data-sticky-is-line-number",Ihe="data-sticky-is-folding-icon";class ZNt extends me{constructor(e){super(),this._editor=e,this._foldingIconStore=new Fe,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 h_),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(115).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(115)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{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,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),o=r?void 0:e,s=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(o,t,s),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 n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}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 n=this._previousState,r=e.startLineNumbers.findIndex(o=>!n.startLineNumbers.includes(o));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;ta.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(110)==="mouseover"&&(this._foldingIconStore.add(xe(this._lineNumbersDomNode,Je.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(xe(this._lineNumbersDomNode,Je.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new le(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(68);let c;try{c=wa.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new M_(!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 KS(2e3),h=bT(u,d);let f;Ehe?f=Ehe.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(sW,String(e)),g.setAttribute(Dhe,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(sW,String(e)),p.setAttribute(YNt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=r.contentLeft;p.style.width=`${m}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`,p.appendChild(v);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(v),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new QNt(e,t,g,p,_,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(110);if(!e||n==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new JNt(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Ihe,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=XY(t.characterMapping,e,0);return new le(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n: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,sW);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Dhe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Ihe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class QNt{constructor(e,t,n,r,o,s,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=a}}class JNt{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=Vt.asClassName(e?G5:K5)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class dD{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class DF{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class bDe{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var fB=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Tk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hD;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(hD||(hD={}));var dv;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(dv||(dv={}));let qK=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new ad(300)),this._updateOperation=this._register(new Fe);const o=new XK(n),s=new ZK(this._editor,n),a=new YK(this._editor,t);switch(r){case hD.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case hD.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case hD.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,n){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,n);this._modelPromise=s;const a=await o;if(this._modelPromise!==s)return null;switch(a){case dv.CANCELED:return this._updateOperation.clear(),null;case dv.VALID:return r.stickyModel}}return null}).catch(r=>(nn(r),null))}};qK=fB([Tk(1,Ti),Tk(2,yt)],qK);class CDe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,dv.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=No(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?n.isCancellationRequested?dv.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,o),dv.VALID):this._invalid()).then(void 0,o=>(nn(o),dv.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let XK=class extends CDe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return Hg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new bDe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(In.first(e.children.values())instanceof HEe){const a=In.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],o=Array.from(n.values()).sort((a,l)=>{const c=new dD(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new dD(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new DF(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())n.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));n.sort((o,s)=>this._comparator(o.range,s.range));const r=new dD(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new DF(r,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof vK?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};XK=fB([Tk(0,yt)],XK);class yDe extends CDe{constructor(e){super(),this._foldingLimitReporter=new BEe(e)}createStickyModel(e,t,n,r){const o=this._fromFoldingRegions(r);return new bDe(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new DF(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,n){const r=Jf.getFoldingRangeProviders(this._languageFeaturesService,e);return new YQ(e,r,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};ZK=fB([Tk(1,yt)],ZK);var eRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},khe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class tRt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let QK=class extends me{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new ae),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Fe),this._updateSoon=this._register(new mi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(115)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(115),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new qK(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new xr,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=this._editor.getModel(),n=t.getVersionId(),r=await this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=r)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;uu-d)),c=this.updateIndex(JD(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new tRt(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,o)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};QK=eRt([khe(1,yt),khe(2,Ti)],QK);var nRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},T1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},JK;let eg=JK=class extends me{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new Fe,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new ZNt(this._editor),this._stickyLineCandidateProvider=new QK(this._editor,n,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Lhe([],[],0),this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(115)||u.hasChanged(73)||u.hasChanged(67)||u.hasChanged(110))&&this._readConfiguration()})),this._register(xe(l,Je.CONTEXT_MENU,async u=>{this._onContextMenu(Bt(l),u)})),this._stickyScrollFocusedContextKey=K.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=K.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(ph(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(xe(l,Je.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(JK.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Fe,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&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(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Fe),t=this._register(new M5(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),n=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(Lr(r,Je.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new le(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new le(c,1)}this._revealPosition(l)})),this._register(Lr(r,Je.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(xe(r,Je.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=n(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new xr;e.add(Ot(()=>u.dispose(!0)));let d;W5(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new le(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Ot(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Ot(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(QEe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new Gu(e,t);this._contextMenuService.showContextMenu({menuId:H.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;MEe(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(115);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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=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){var t,n;const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(n=await((t=Jf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(115).maxLineCount),n=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new dD(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,m=this._editor.getBottomForLineNumber(d)-n,v=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>v&&g<=_){o.push(d),s.push(h+1),r=_-p;break}else p>m&&p<=_&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new Lhe(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};eg.ID="store.contrib.stickyScrollController";eg=JK=nRt([T1(1,$l),T1(2,yt),T1(3,Wt),T1(4,Ti),T1(5,_u),T1(6,Gt)],eg);class iRt extends dl{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Hn("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},category:XNt.View,toggled:{condition:Re.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:H.CommandPalette},{id:H.MenubarAppearanceMenu,group:"4_editor",order:3},{id:H.StickyScrollContext}]})}async run(e){const t=e.get(mn),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const gB=100;class rRt extends Nh{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Hn("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:Re.and(Re.has("config.editor.stickyScroll.enabled"),K.stickyScrollVisible),menu:[{id:H.CommandPalette}]})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focus()}}class oRt extends Nh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Hn("selectNextStickyScrollLine.title","Select next sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:18}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focusNext()}}class sRt extends Nh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Hn("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:16}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.focusPrevious()}}class aRt extends Nh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Hn("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:3}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.goToFocused()}}class lRt extends Nh{constructor(){super({id:"editor.action.selectEditor",title:Hn("selectEditor.title","Select Editor"),precondition:K.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:gB,primary:9}})}runEditorCommand(e,t){var n;(n=eg.get(t))===null||n===void 0||n.selectEditor()}}Kn(eg.ID,eg,1);ki(iRt);ki(rRt);ki(sRt);ki(oRt);ki(aRt);ki(lRt);var wDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},uE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class cRt{constructor(e,t,n,r,o,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=o,this.completion=s}}let eG=class extends wit{constructor(e,t,n,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(wn.None)}return t}};eG=wDe([uE(5,Q5)],eG);let tG=class extends me{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var o;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const a=s.getOption(89);if(Ny.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),c=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Ny.valueFor(a,c)!=="inline")return;let u=e.getWordAtPosition(t),d;if(u!=null&&u.word||(d=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!d||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let h;const f=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,u))){const g=new bhe(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await QQ(this._languageFeatureService.completionProvider,e,t,new bk(void 0,SF.createSuggestFilter(s).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new Um(g.items,t.column,new bhe(f,0),jd.None,s.getOption(118),s.getOption(112),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new eG(e,t.lineNumber,u,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(wn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const r=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};tG=wDe([uE(0,yt),uE(1,Zp),uE(2,Q5),uE(3,jn)],tG);BT(tG);class uRt extends pt{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new Fs;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Ke(uRt);class pB extends dl{constructor(){super({id:pB.ID,title:Hn({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},f1:!0})}run(){const t=!Qw.getTabFocusMode();Qw.setTabFocusMode(t),Pl(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}pB.ID="editor.action.toggleTabFocusMode";ki(pB);var dRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hRt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nG=class extends me{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,n={},r){var o;super(),this._link=t,this._enabled=!0,this.el=Oe(e,Xe("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=ot.chain(a.event,d=>d.map(h=>new Oi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Ei.Tap)).event;this._register(Li.addTarget(this.el));const u=ot.any(s.event,l,c);this._register(u(d=>{this.enabled&&(gn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};nG=dRt([hRt(3,hl)],nG);var SDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xDe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fRt=26;let iG=class extends me{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(rG))}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===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,fRt)}};iG=SDe([xDe(1,Wt)],iG);let rG=class extends me{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(qf,{}),this.element=Xe("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=Xe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ps(this.element)}show(e){Ps(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Oe(this.element,Xe("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(Xe(`div${Vt.asCSSSelector(e.icon)}`));const r=Oe(this.element,Xe("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Oe(this.element,Xe("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(nG,this.messageActionsContainer,{...s,tabIndex:-1},{}));const o=Oe(this.element,Xe("div.action-container"));this.actionBar=this._register(new du(o)),this.actionBar.push(this._register(new Il("banner.close","Close Banner",Vt.asClassName(txe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};rG=SDe([xDe(0,Wt)],rG);var hJ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cw=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const gRt=Or("extensions-warning-message",tt.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));let IS=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new fx};else if(o.ambiguousCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new V_};else if(o.invisibleCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new hx};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:gRt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(iG,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(125),this._register(n.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._options=e.getOption(125),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=pRt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?wnt:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new oG(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new mRt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};IS.ID="editor.contrib.unicodeHighlighter";IS=hJ([Cw(1,vd),Cw(2,uSe),Cw(3,Wt)],IS);function pRt(i,e){return{nonBasicASCII:e.nonBasicASCII===Yl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Yl?!i:e.includeComments,includeStrings:e.includeStrings===Yl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let oG=class extends me{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new mi(()=>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 n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:IF.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!mZ(t,e))return null;const n=t.getValueInRange(e.range);return{reason:EDe(n,this._options),inComment:vZ(t,e),inString:_Z(t,e)}}};oG=hJ([Cw(3,vd)],oG);class mRt extends me{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new mi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=TY.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||o.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:IF.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return mZ(t,e)?{reason:EDe(n,this._options),inComment:vZ(t,e),inString:_Z(t,e)}:null}}const LDe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let sG=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(IS.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=aW(d);let f;switch(c.reason.kind){case 0:{hT(c.reason.confusableWith)?f=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,aW(c.reason.confusableWith.codePointAt(0))):f=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,aW(c.reason.confusableWith.codePointAt(0)));break}case 1:f=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=w("unicodeHighlight.adjustSettings","Adjust settings"),m=`command:${JT.ID}?${encodeURIComponent(JSON.stringify(g))}`,v=new Ns("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,LDe);o.push(new qd(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return cEe(e,t,this._editor,this._languageService,this._openerService)}};sG=hJ([Cw(1,qi),Cw(2,hl)],sG);function aG(i){return`U+${i.toString(16).padStart(4,"0")}`}function aW(i){let e=`\`${aG(i)}\``;return Of.isInvisibleCharacter(i)||(e+=` "${`${vRt(i)}`}"`),e}function vRt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function EDe(i,e){return TY.computeUnicodeHighlightReason(i,e)}class IF{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=an.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}}IF.instance=new IF;class _Rt extends pt{constructor(){super({id:V_.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.includeComments,!1,2)}}class bRt extends pt{constructor(){super({id:V_.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.includeStrings,!1,2)}}class V_ extends pt{constructor(){super({id:V_.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.ambiguousCharacters,!1,2)}}V_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class hx extends pt{constructor(){super({id:hx.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.invisibleCharacters,!1,2)}}hx.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class fx extends pt{constructor(){super({id:fx.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(mn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Za.nonBasicASCII,!1,2)}}fx.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class JT extends pt{constructor(){super({id:JT.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:o,inString:s,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Ph),u=e.get(mn);function d(g){return Of.isInvisibleCharacter(g)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",aG(g)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${aG(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{yRt(u,[g])}});if(h.push({label:d(r),run:()=>CRt(u,[r])}),a){const g=new _Rt;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s){const g=new bRt;h.push({label:g.label,run:async()=>g.runAction(u)})}if(o.kind===0){const g=new V_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===1){const g=new hx;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===2){const g=new fx;h.push({label:g.label,run:async()=>g.runAction(u)})}else wRt(o);const f=await c.pick(h,{title:LDe});f&&await f.run()}}JT.ID="editor.action.unicodeHighlight.showExcludeOptions";async function CRt(i,e){const t=i.getValue(Za.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(Za.allowedCharacters,n,2)}async function yRt(i,e){var t;const n=(t=i.inspect(Za.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof n=="object"&&n?r=Object.assign({},n):r={};for(const o of e)r[o]=!0;await i.updateValue(Za.allowedLocales,r,2)}function wRt(i){throw new Error(`Unexpected value: ${i}`)}Ke(V_);Ke(hx);Ke(fx);Ke(JT);Kn(IS.ID,IS,1);$_.register(sG);var SRt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},The=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const DDe="ignoreUnusualLineTerminators";function xRt(i,e,t){i.setModelProperty(e.uri,DDe,t)}function LRt(i,e){return i.getModelProperty(e.uri,DDe)}let Nk=class extends me{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(126),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._config=this._editor.getOption(126),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()||LRt(this._codeEditorService,e)===!0||this._editor.getOption(91))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("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`.",uu(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){xRt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};Nk.ID="editor.contrib.unusualLineTerminatorsDetector";Nk=SRt([The(1,kT),The(2,jn)],Nk);Kn(Nk.ID,Nk,1);var IDe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mo,lG;const mB=new ct("hasWordHighlights",!1);function kDe(i,e,t,n){const r=i.ordered(e);return mY(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,n)).then(void 0,eo)),Ms).then(o=>{if(o){const s=new Mr;return s.set(e.uri,o),s}return new Mr})}function ERt(i,e,t,n,r,o){const s=i.ordered(e);return mY(s.map(a=>()=>{const l=o.filter(c=>uye(c)).filter(c=>wZ(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,eo)}),a=>a instanceof Mr&&a.size>0)}class fJ{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=No(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new W(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class DRt extends fJ{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return kDe(this._providers,e,t.getPosition(),r).then(o=>o||new Mr)}}class IRt extends fJ{constructor(e,t,n,r,o){super(e,t,n),this._providers=r,this._otherModels=o}_compute(e,t,n,r){return ERt(this._providers,e,t.getPosition(),n,r,this._otherModels).then(o=>o||new Mr)}}class TDe extends fJ{constructor(e,t,n,r,o){super(e,t,r),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=n}_compute(e,t,n,r){return Zv(250,r).then(()=>{const o=new Mr;let s;if(this._word?s=this._word:s=e.getWordAtPosition(t.getPosition()),!s)return new Mr;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const u=l.findMatches(s.word,!0,!1,!0,n,!1).map(d=>({range:d.range,kind:oI.Text}));u&&o.set(l.uri,u)}return o})}isValid(e,t,n){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,n)}}function kRt(i,e,t,n,r){return i.has(e)?new DRt(e,t,r,i):new TDe(e,t,n,r,[])}function TRt(i,e,t,n,r,o){return i.has(e)?new IRt(e,t,r,i,o):new TDe(e,t,n,r,o)}rg("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(yt),r=await kDe(n.documentHighlightProvider,e,t,wn.None);return r==null?void 0:r.get(e.uri)});let Rk=mo=class{constructor(e,t,n,r,o){this.toUnhook=new Fe,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Mr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=o,this._hasWordHighlights=mB.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(s=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(s)})),this.toUnhook.add(e.onDidFocusEditorText(s=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(s=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(s=>{!s.newModelUrl&&s.oldModelUrl?this._stopSingular():mo.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(s=>{const a=this.editor.getOption(81);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,mo.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=mo.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),mo.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const n of e){if(!n.hasModel())continue;const r=mo.storedDecorations.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),t.push(n.getModel().uri);const o=zp.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of t)mo.storedDecorations.delete(n)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==cn.vscodeNotebookCell&&((n=(t=mo.query)===null||t===void 0?void 0:t.modelInfo)===null||n===void 0?void 0:n.model.uri.scheme)!==cn.vscodeNotebookCell?(mo.query=null,this._run()):!((r=mo.query)===null||r===void 0)&&r.modelInfo&&(mo.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(){this._removeAllDecorations(),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||t===void 0?void 0:t.uri.scheme)!==cn.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===cn.vscodeNotebookCell){const o=[],s=this.codeEditorService.listCodeEditors();for(const a of s){const l=a.getModel();l&&l!==e&&l.uri.scheme===cn.vscodeNotebookCell&&o.push(l)}return o}const n=[],r=this.codeEditorService.listCodeEditors();for(const o of r){if(!CQ(o))continue;const s=o.getModel();s&&e===s.modified&&n.push(s.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const o of r){const s=o.getModel();s&&s!==e&&n.push(s)}return n}_run(){var e;let t;if(this.editor.hasTextFocus()){const r=this.editor.getSelection();if(!r||r.startLineNumber!==r.endLineNumber){mo.query=null,this._stopAll();return}const o=r.startColumn,s=r.endColumn,a=this._getWord();if(!a||a.startColumn>o||a.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=s||[],this._beginRenderDecorations())},nn)}}computeWithModel(e,t,n,r){return r.length?TRt(this.multiDocumentProviders,e,t,n,this.editor.getOption(130),r):kRt(this.providers,e,t,n,this.editor.getOption(130))}_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 e,t,n;this.renderDecorationsTimer=-1;const r=this.codeEditorService.listCodeEditors();for(const o of r){const s=zp.get(o);if(!s)continue;const a=[],l=(e=o.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const c=mo.storedDecorations.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:VTt(h.kind)});let d=[];o.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),mo.storedDecorations=mo.storedDecorations.set(l,d),a.length>0&&((t=s.wordHighlighter)===null||t===void 0||t.decorations.set(a),(n=s.wordHighlighter)===null||n===void 0||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};Rk.storedDecorations=new Mr;Rk.query=null;Rk=mo=IDe([_P(4,jn)],Rk);let zp=lG=class extends me{static get(e){return e.getContribution(lG.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Rk(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(s=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};zp.ID="editor.contrib.wordHighlighter";zp=lG=IDe([_P(1,Gt),_P(2,yt),_P(3,jn)],zp);class NDe extends pt{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=zp.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class NRt extends NDe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:mB,kbOpts:{kbExpr:K.editorTextFocus,primary:65,weight:100}})}}class RRt extends NDe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:mB,kbOpts:{kbExpr:K.editorTextFocus,primary:1089,weight:100}})}}class MRt extends pt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:mB.toNegated(),kbOpts:{kbExpr:K.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=zp.get(t);r&&r.restoreViewState(!0)}}Kn(zp.ID,zp,0);Ke(NRt);Ke(RRt);Ke(MRt);class vB extends zo{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=cu(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new le(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>$n.fromModelSelection(l))),a.length===1){const l=new le(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new Et(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Et(t.lineNumber,t.column,t.lineNumber,t.column)}}class z_ extends vB{_move(e,t,n,r){return Qn.moveWordLeft(e,t,n,r)}}class U_ extends vB{_move(e,t,n,r){return Qn.moveWordRight(e,t,n,r)}}class PRt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class ARt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class ORt extends z_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class FRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class BRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class WRt extends z_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class $Rt extends z_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class HRt extends z_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class VRt extends U_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class zRt extends U_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class URt extends U_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class jRt extends U_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class KRt extends U_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Re.and(K.textInputFocus,(e=Re.and(CT,o5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class GRt extends U_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class qRt extends U_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class XRt extends U_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r){return super._move(cu(kh.wordSeparators.defaultValue),t,n,r)}}class _B extends zo{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(Ti);if(!t.hasModel())return;const o=cu(t.getOption(130)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ls(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class gJ extends _B{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new W(1,1,1,1)}}class pJ extends _B{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new W(r,o,r,o)}}class YRt extends gJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:K.writable})}}class ZRt extends gJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:K.writable})}}class QRt extends gJ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class JRt extends pJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:K.writable})}}class e2t extends pJ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:K.writable})}}class t2t extends pJ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class n2t extends pt{constructor(){super({id:"deleteInsideWord",precondition:K.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=cu(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(r,o,l);return new ls(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}st(new PRt);st(new ARt);st(new ORt);st(new FRt);st(new BRt);st(new WRt);st(new VRt);st(new zRt);st(new URt);st(new jRt);st(new KRt);st(new GRt);st(new $Rt);st(new HRt);st(new qRt);st(new XRt);st(new YRt);st(new ZRt);st(new QRt);st(new JRt);st(new e2t);st(new t2t);Ke(n2t);class i2t extends _B{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=F3.deleteWordPartLeft(e);return n||new W(1,1,1,1)}}class r2t extends _B{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=F3.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new W(r,o,r,o)}}class RDe extends vB{_move(e,t,n,r){return F3.moveWordPartLeft(e,t,n)}}class o2t extends RDe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}kn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class s2t extends RDe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}kn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class MDe extends vB{_move(e,t,n,r){return F3.moveWordPartRight(e,t,n)}}class a2t extends MDe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class l2t extends MDe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}st(new i2t);st(new r2t);st(new o2t);st(new s2t);st(new a2t);st(new l2t);class cG extends me{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Da.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(92);t||(this.editor.isSimpleWidget?t=new Ns(w("editor.simple.readonly","Cannot edit in read-only input")):t=new Ns(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}cG.ID="editor.contrib.readOnlyMessageController";Kn(cG.ID,cG,2);var c2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Nhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let uG=class extends me{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=Vn(this,void 0);const r=_a("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=_a("_textModel.onDidChangeContent",ot.debounce(s=>this._textModel.onDidChangeContent(s),()=>{},100));this._register(Ah(async(s,a)=>{r.read(s),o.read(s);const l=a.add(new C1t),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(kCe(nu(o=>o.range.endLineNumber-o.range.startLineNumber,mp))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};uG=c2t([Nhe(1,yt),Nhe(2,ZT)],uG);ik.setBreadcrumbsSourceFactory((i,e)=>e.createInstance(uG,i));class dG extends me{constructor(e){super(),this.editor=e,this.widget=null,fh&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(91);!this.widget&&e?this.widget=new bB(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}dG.ID="editor.contrib.iPadShowKeyboard";class bB extends me{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(xe(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(xe(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return bB.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}bB.ID="editor.contrib.ShowKeyboardWidget";Kn(dG.ID,dG,3);var u2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Rhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hG;let kS=hG=class extends me{static get(e){return e.getContribution(hG.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(gr.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 CB(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};kS.ID="editor.contrib.inspectTokens";kS=hG=u2t([Rhe(1,Dc),Rhe(2,qi)],kS);class d2t extends pt{constructor(){super({id:"editor.action.inspectTokens",label:bU.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=kS.get(t);n==null||n.launch()}}function h2t(i){let e="";for(let t=0,n=i.length;tZw,tokenize:(r,o,s)=>FY(e,s),tokenizeEncoded:(r,o,s)=>k3(n,s)}}class CB extends me{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=f2t(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return CB._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dE;let kF=dE=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ur.as(DC.Quickaccess)}provide(e){const t=new Fe;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(dE.PREFIX.length));r&&r.prefix&&r.prefix!==dE.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==dE.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};kF.PREFIX="?";kF=dE=g2t([Mhe(0,Ph),Mhe(1,ci)],kF);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:kF,prefix:"",helpEntries:[{description:CU.helpQuickAccessActionLabel}]});class PDe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const r=new Fe;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Vo);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var n;const r=new Fe,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=Exe(o);if(a){let l=(n=o.saveViewState())!==null&&n!==void 0?n:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(qv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(Ot(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&jf(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return CQ(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:pr(Gye),position:Cc.Full}}}],[s,a]=n.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class yB extends PDe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,me.None}provideWithTextEditor(e,t,n){const r=e.editor,o=new Fe;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(yB.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=Exe(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Ot(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):w("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):w("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,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:n};return r.validatePosition(o).equals(o)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}yB.PREFIX=":";var p2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},m2t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Mk=class extends yB{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=ot.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Mk=p2t([m2t(0,jn)],Mk);let mJ=class ADe extends pt{constructor(){super({id:ADe.ID,label:LO.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ph).quickAccess.show(Mk.PREFIX)}};mJ.ID="editor.action.gotoLine";Ke(mJ);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:Mk,prefix:Mk.PREFIX,helpEntries:[{description:LO.gotoLineActionLabel,commandId:mJ.ID}]});const ODe=[void 0,[]];function lW(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?v2t(i,r.values,t,n):FDe(i,e,t,n)}function v2t(i,e,t,n){let r=0;const o=[];for(const s of e){const[a,l]=FDe(i,s,t,n);if(typeof a!="number")return ODe;r+=a,o.push(...l)}return[r,_2t(o)]}function FDe(i,e,t,n){const r=jb(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],TT(r)]:ODe}function _2t(i){const e=i.sort((r,o)=>r.start-o.start),t=[];let n;for(const r of e)!n||!b2t(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function b2t(i,e){return!(i.end=0,s=Phe(i);let a;const l=i.split(BDe);if(l.length>1)for(const c of l){const u=Phe(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=Ahe(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function Ahe(i){let e;Os?e=i.replace(/\//g,ih):e=i.replace(/\\/g,ih);const t=drt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Ohe(i){return Array.isArray(i)?fG(i.map(e=>e.original).join(BDe)):fG(i.original)}var C2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fhe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yw;let $f=yw=class extends PDe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),me.None}provideWithTextEditor(e,t,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n):this.doProvideWithoutEditorSymbols(e,o,t,n):me.None}doProvideWithoutEditorSymbols(e,t,n,r){const o=new Fe;return this.provideLabelPick(n,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),o}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 n=new s3,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Ot(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r){var o;const s=e.editor,a=new Fe;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async d=>{c==null||c.dispose(!0),n.busy=!1,c=new xr(r),n.busy=!0;try{const h=fG(n.value.substr(yw.PREFIX.length).trim()),f=await this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=fI(f,p=>!!(p.type!=="separator"&&p.range&&W.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,w("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r){var o,s;const a=await e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(yw.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=Ohe(t.values[0]),d=Ohe(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?Vt.asClassName(tt.splitHorizontal):Vt.asClassName(tt.splitVertical),tooltip:f==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const g=[];for(let v=0;vc){let N=!1;if(u!==t&&([D,k]=lW(S,{...t,values:void 0},c,L),typeof D=="number"&&(N=!0)),typeof D!="number"&&([D,k]=lW(S,u,c,L),typeof D!="number"))continue;if(!N&&d){if(E&&d.original.length>0&&([T,M]=lW(E,d)),typeof T!="number")continue;typeof D=="number"&&(D+=T)}}const P=_.tags&&_.tags.indexOf(1)>=0;g.push({index:v,kind:_.kind,score:D,label:S,ariaLabel:nrt(_.name,_.kind),description:E,highlights:P?void 0:{label:k,description:M},range:{selection:W.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:P,buttons:h})}const p=g.sort((v,_)=>l?this.compareByKindAndScore(v,_):this.compareByScore(v,_));let m=[];if(l){let S=function(){_&&typeof v=="number"&&y>0&&(_.label=Fb(uW[v]||cW,y))},v,_,y=0;for(const L of p)v!==L.kind?(S(),v=L.kind,y=1,_={type:"separator"},m.push(_)):y++,m.push(L);S()}else p.length>0&&(m=[{label:w("symbols","symbols ({0})",g.length),type:"separator"},...p]);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.scoret.index?1:0}compareByKindAndScore(e,t){const n=uW[e.kind]||cW,r=uW[t.kind]||cW,o=n.localeCompare(r);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};$f.PREFIX="@";$f.SCOPE_PREFIX=":";$f.PREFIX_BY_CATEGORY=`${yw.PREFIX}${yw.SCOPE_PREFIX}`;$f=yw=C2t([Fhe(0,yt),Fhe(1,ZT)],$f);const cW=w("property","properties ({0})"),uW={[5]:w("method","methods ({0})"),[11]:w("function","functions ({0})"),[8]:w("_constructor","constructors ({0})"),[12]:w("variable","variables ({0})"),[4]:w("class","classes ({0})"),[22]:w("struct","structs ({0})"),[23]:w("event","events ({0})"),[24]:w("operator","operators ({0})"),[10]:w("interface","interfaces ({0})"),[2]:w("namespace","namespaces ({0})"),[3]:w("package","packages ({0})"),[25]:w("typeParameter","type parameters ({0})"),[1]:w("modules","modules ({0})"),[6]:w("property","properties ({0})"),[9]:w("enum","enumerations ({0})"),[21]:w("enumMember","enumeration members ({0})"),[14]:w("string","strings ({0})"),[0]:w("file","files ({0})"),[17]:w("array","arrays ({0})"),[15]:w("number","numbers ({0})"),[16]:w("boolean","booleans ({0})"),[18]:w("object","objects ({0})"),[19]:w("key","keys ({0})"),[7]:w("field","fields ({0})"),[13]:w("constant","constants ({0})")};var y2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dW=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let gG=class extends $f{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=ot.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};gG=y2t([dW(0,jn),dW(1,yt),dW(2,ZT)],gG);class eN extends pt{constructor(){super({id:eN.ID,label:$I.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:K.hasDocumentSymbolProvider,kbOpts:{kbExpr:K.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ph).quickAccess.show($f.PREFIX,{itemActivation:Od.NONE})}}eN.ID="editor.action.quickOutline";Ke(eN);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:gG,prefix:$f.PREFIX,helpEntries:[{description:$I.quickOutlineActionLabel,prefix:$f.PREFIX,commandId:eN.ID},{description:$I.quickOutlineByCategoryActionLabel,prefix:$f.PREFIX_BY_CATEGORY}]});function hW(i,e){return e&&(i.stack||i.stacktrace)?w("stackTrace.format","{0}: {1}",Whe(i),Bhe(i.stack)||Bhe(i.stacktrace)):Whe(i)}function Bhe(i){return Array.isArray(i)?i.join(` +`):i}function Whe(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function WDe(i=null,e=!1){if(!i)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=hh(i),n=WDe(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(Ea(i))return i;if(i.detail){const t=i.detail;if(t.error)return hW(t.error,e);if(t.exception)return hW(t.exception,e)}return i.stack?hW(i,e):i.message?i.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function w2t(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class fD{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return w2t(fD.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const r=[];for(const o of n.textChunks){const s=fD.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(n.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=n.get(o);typeof l!="number"&&(l=this.computeIdf(o),n.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=fD.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const o=this.computeIdf(n);o>0&&(t[n]=r*o)}return t}}function S2t(i){var e,t;const n=i.slice(0);n.sort((o,s)=>s.score-o.score);const r=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of n)o.score/=r;return n}var Ry;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(Ry||(Ry={}));function fW(i){const e=i;return Array.isArray(e.items)}function $he(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class x2t extends me{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var r;const o=new Fe;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Vo),l=async()=>{var c;const u=a.value=new Fe;s==null||s.dispose(!0),e.busy=!1,s=new xr(t);const d=s.token;let h=e.value.substring(this.prefix.length);!((c=this.options)===null||c===void 0)&&c.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(m,v)=>{var _;let y,S;if(fW(m)?(y=m.items,S=m.active):y=m,y.length===0){if(v)return!1;(h.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(tI(this.options.noResultsPick)?y=[this.options.noResultsPick(h)]:y=[this.options.noResultsPick])}return e.items=y,S&&(e.activeItems=[S]),!0},p=async m=>{let v=!1,_=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Zv(m.mergeDelay),d.isCancellationRequested)||_||(v=g(m.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await m.additionalPicks;if(d.isCancellationRequested)return;let S,L;fW(m.picks)?(S=m.picks.items,L=m.picks.active):S=m.picks;let E,D;if(fW(y)?(E=y.items,D=y.active):E=y,E.length>0||!v){let k;if(!L&&!D){const T=e.activeItems[0];T&&S.indexOf(T)!==-1&&(k=T)}g({items:[...S,...E],active:L||D||k})}}finally{d.isCancellationRequested||(e.busy=!1),_=!0}})()])};if(f!==null)if($he(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const m=await f;if(d.isCancellationRequested)return;$he(m)?await p(m):g(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(async({button:c,item:u})=>{var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case Ry.NO_ACTION:break;case Ry.CLOSE_PICKER:e.hide();break;case Ry.REFRESH_PICKER:l();break;case Ry.REMOVE_ITEM:{const m=e.items.indexOf(u);if(m!==-1){const v=e.items.slice(),_=v.splice(m,1),y=e.activeItems.filter(L=>L!==_[0]),S=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=S}break}}}}})),o}}var $De=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},x0,ro;let dC=x0=class extends x2t{constructor(e,t,n,r,o,s){super(x0.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(w_)),this.options=e}async _getPicks(e,t,n,r){var o,s,a,l;const c=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=qv(()=>{const v=new fD;v.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));const _=v.calculateScores(e,n);return S2t(_).filter(y=>y.score>x0.TFIDF_THRESHOLD).slice(0,x0.TFIDF_MAX_RESULTS)}),d=[];for(const v of c){const _=(o=x0.WORD_FILTER(e,v.label))!==null&&o!==void 0?o:void 0,y=v.commandAlias&&(s=x0.WORD_FILTER(e,v.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)v.highlights={label:_,detail:this.options.showAlias?y:void 0},d.push(v);else if(e===v.commandId)d.push(v);else if(e.length>=3){const S=u();if(n.isCancellationRequested)return[];const L=S.find(E=>E.key===v.commandId);L&&(v.tfIdfScore=L.score,d.push(v))}}const h=new Map;for(const v of d){const _=h.get(v.label);_?(v.description=v.commandId,_.description=_.commandId):h.set(v.label,v)}d.sort((v,_)=>{if(v.tfIdfScore&&_.tfIdfScore)return v.tfIdfScore===_.tfIdfScore?v.label.localeCompare(_.label):_.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(v.commandId),S=this.commandsHistory.peek(_.commandId);if(y&&S)return y>S?-1:1;if(y)return-1;if(S)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(v.commandId),E=this.options.suggestedCommandIds.has(_.commandId);if(L&&E)return 0;if(L)return-1;if(E)return 1}return v.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,m=!!this.options.suggestedCommandIds;for(let v=0;v{var v;const _=await this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const y=_.map(S=>this.toCommandPick(S,r));return p&&((v=y[0])===null||v===void 0?void 0:v.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:f}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){Th(a)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),WDe(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};dC.PREFIX=">";dC.TFIDF_THRESHOLD=.5;dC.TFIDF_MAX_RESULTS=5;dC.WORD_FILTER=EZ(BI,Wmt,Zwe);dC=x0=$De([F0(1,Wt),F0(2,ci),F0(3,cr),F0(4,ia),F0(5,kT)],dC);let w_=ro=class extends me{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===UI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=ro.getConfiguredCommandHistoryLength(this.configurationService),ro.cache&&ro.cache.limit!==this.configuredCommandsHistoryLength&&(ro.cache.limit=this.configuredCommandsHistoryLength,ro.hasChanges=!0))}load(){const e=this.storageService.get(ro.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=ro.cache=new R_(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>n.set(o.key,o.value))}ro.counter=this.storageService.getNumber(ro.PREF_KEY_COUNTER,0,ro.counter)}push(e){ro.cache&&(ro.cache.set(e,ro.counter++),ro.hasChanges=!0)}peek(e){var t;return(t=ro.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!ro.cache||!ro.hasChanges)return;const e={usesLRU:!0,entries:[]};ro.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(ro.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(ro.PREF_KEY_COUNTER,ro.counter,0,0),ro.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,n;const o=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof o=="number"?o:ro.DEFAULT_COMMANDS_HISTORY_LENGTH}};w_.DEFAULT_COMMANDS_HISTORY_LENGTH=50;w_.PREF_KEY_CACHE="commandPalette.mru.cache";w_.PREF_KEY_COUNTER="commandPalette.mru.counter";w_.counter=1;w_.hasChanges=!1;w_=ro=$De([F0(0,md),F0(1,mn)],w_);class L2t extends dC{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:RZ(n.label)||n.id});return t}}var E2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Pk=class extends L2t{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,r,o,s){super({showAlias:!1},e,n,r,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Pk=E2t([N1(0,Wt),N1(1,jn),N1(2,ci),N1(3,cr),N1(4,ia),N1(5,kT)],Pk);class tN extends pt{constructor(){super({id:tN.ID,label:EO.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ph).quickAccess.show(Pk.PREFIX)}}tN.ID="editor.action.quickCommand";Ke(tN);ur.as(DC.Quickaccess).registerQuickAccessProvider({ctor:Pk,prefix:Pk.PREFIX,helpEntries:[{description:EO.quickCommandHelp,commandId:tN.ID}]});var D2t=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let pG=class extends g_{constructor(e,t,n,r,o,s,a){super(!0,e,t,n,r,o,s,a)}};pG=D2t([R1(1,Gt),R1(2,jn),R1(3,zr),R1(4,Wt),R1(5,md),R1(6,mn)],pG);Kn(g_.ID,pG,4);class I2t extends pt{constructor(){super({id:"editor.action.toggleHighContrast",label:yU.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Dc),r=n.getColorTheme();sh(r.type)?(n.setTheme(this._originalThemeName||(tS(r.type)?pw:Gg)),this._originalThemeName=null):(n.setTheme(tS(r.type)?_b:bb),this._originalThemeName=r.themeName)}}Ke(I2t);const k2t=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Txe,Emitter:yQ,KeyCode:Nxe,KeyMod:Rxe,MarkerSeverity:Fxe,MarkerTag:Bxe,Position:Mxe,Range:Pxe,Selection:Axe,SelectionDirection:Oxe,Token:$xe,Uri:Wxe,editor:Hxe,languages:VT},Symbol.toStringTag,{value:"Module"}));function T2t(){return new Worker("/ir-virtual-machine/assets/editor.worker-3daf6cbf.js")}function N2t(){return new Worker("/ir-virtual-machine/assets/json.worker-4a7a65e0.js")}function R2t(){return new Worker("/ir-virtual-machine/assets/css.worker-4b5427ce.js")}function M2t(){return new Worker("/ir-virtual-machine/assets/html.worker-85cb56ae.js")}function P2t(){return new Worker("/ir-virtual-machine/assets/ts.worker-3bc0f4a5.js")}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new N2t:e==="css"||e==="scss"||e==="less"?new R2t:e==="html"||e==="handlebars"||e==="razor"?new M2t:e==="typescript"||e==="javascript"?new P2t:new T2t}};t3.config({monaco:k2t});t3.init();const A2t=()=>{const i=Yr(t=>t.locale.currentLocale),e=Yr(t=>t.theme.currentClassName);return C.useEffect(()=>{document.body.className=e},[e]),ze($3e,{messages:i,locale:"en",children:ze(d4e,{router:nnt})})},O2t=xQe({reducer:{locale:aJe,theme:uJe,vm:jQe}});gW.createRoot(document.getElementById("root")).render(ze(qe.StrictMode,{children:ze(ZOe,{store:O2t,children:ze(A2t,{})})}));export{w5 as m,oLe as t}; diff --git a/docs/assets/javascript-399e9239.js b/docs/assets/javascript-f8924fc5.js similarity index 89% rename from docs/assets/javascript-399e9239.js rename to docs/assets/javascript-f8924fc5.js index 4a05a2d..5b0cff8 100644 --- a/docs/assets/javascript-399e9239.js +++ b/docs/assets/javascript-f8924fc5.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-e9193306.js";import"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-b38ad017.js";import"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/jsonMode-2b57b708.js b/docs/assets/jsonMode-d2a2b345.js similarity index 99% rename from docs/assets/jsonMode-2b57b708.js rename to docs/assets/jsonMode-d2a2b345.js index c8a75bc..e4da5bb 100644 --- a/docs/assets/jsonMode-2b57b708.js +++ b/docs/assets/jsonMode-d2a2b345.js @@ -1,4 +1,4 @@ -import{m as et}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as et}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/liquid-a87f169a.js b/docs/assets/liquid-6545a9f9.js similarity index 98% rename from docs/assets/liquid-a87f169a.js rename to docs/assets/liquid-6545a9f9.js index 87779e5..4439bd3 100644 --- a/docs/assets/liquid-a87f169a.js +++ b/docs/assets/liquid-6545a9f9.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/mdx-31bb8f6b.js b/docs/assets/mdx-41f16e00.js similarity index 98% rename from docs/assets/mdx-31bb8f6b.js rename to docs/assets/mdx-41f16e00.js index 4dec429..3ae9d0e 100644 --- a/docs/assets/mdx-31bb8f6b.js +++ b/docs/assets/mdx-41f16e00.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/python-a17e322c.js b/docs/assets/python-a4947be7.js similarity index 98% rename from docs/assets/python-a17e322c.js rename to docs/assets/python-a4947be7.js index 384c191..8636ff2 100644 --- a/docs/assets/python-a17e322c.js +++ b/docs/assets/python-a4947be7.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/razor-3c2726ff.js b/docs/assets/razor-939b62e5.js similarity index 99% rename from docs/assets/razor-3c2726ff.js rename to docs/assets/razor-939b62e5.js index 3566af3..d8c9532 100644 --- a/docs/assets/razor-3c2726ff.js +++ b/docs/assets/razor-939b62e5.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/tsMode-dc546b1f.js b/docs/assets/tsMode-f8221b75.js similarity index 99% rename from docs/assets/tsMode-dc546b1f.js rename to docs/assets/tsMode-f8221b75.js index d13d08c..293e240 100644 --- a/docs/assets/tsMode-dc546b1f.js +++ b/docs/assets/tsMode-f8221b75.js @@ -1,4 +1,4 @@ -import{t as I,m as N}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{t as I,m as N}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/typescript-e9193306.js b/docs/assets/typescript-b38ad017.js similarity index 98% rename from docs/assets/typescript-e9193306.js rename to docs/assets/typescript-b38ad017.js index bb2bf67..a02b1d6 100644 --- a/docs/assets/typescript-e9193306.js +++ b/docs/assets/typescript-b38ad017.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/xml-91f8402c.js b/docs/assets/xml-1046e63e.js similarity index 97% rename from docs/assets/xml-91f8402c.js rename to docs/assets/xml-1046e63e.js index 7267a30..8c2cb11 100644 --- a/docs/assets/xml-91f8402c.js +++ b/docs/assets/xml-1046e63e.js @@ -1,4 +1,4 @@ -import{m}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/yaml-36087f86.js b/docs/assets/yaml-01b0ca08.js similarity index 98% rename from docs/assets/yaml-36087f86.js rename to docs/assets/yaml-01b0ca08.js index e2ff663..6a961a1 100644 --- a/docs/assets/yaml-36087f86.js +++ b/docs/assets/yaml-01b0ca08.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-3502a0fe.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-7530a5d9.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/index.html b/docs/index.html index af3544f..ef8bc1f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ rel="stylesheet" /> IR虚拟机 - + diff --git a/package.json b/package.json index 363755e..2bea5fb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ir-virtual-machine", "private": true, - "version": "3.5.0", + "version": "3.5.1", "type": "module", "scripts": { "dev": "vite",